Skip to content

Commit

Permalink
Add sniff and md (#1)
Browse files Browse the repository at this point in the history
* Add sniff and md

* Update

* fix lock
  • Loading branch information
tylersriver authored Jan 21, 2023
1 parent 69cd5b0 commit 7b7f256
Show file tree
Hide file tree
Showing 11 changed files with 845 additions and 158 deletions.
12 changes: 7 additions & 5 deletions .github/workflows/php.yml
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
name: PHP Composer Tests

on: [push]
on: [push, pull_request]

jobs:
build:
Expand All @@ -16,17 +16,19 @@ jobs:
- name: Install dependencies
run: composer install --prefer-dist --no-progress --no-suggest

# - name: Run Code Sniffer
# run: composer run-script sniff
- name: Run Code Sniffer
run: composer run-script sniff

# - name: Run Linter
# run: composer run-script lint

- name: Run Static Analysis
run: composer run-script stan

# - name: Run Mess Detection
# run: composer run-script md
- name: Run Mess Detection
run: composer run-script md

- name: Run Unit Tests
env:
XDEBUG_MODE: coverage
run: composer run-script test
14 changes: 14 additions & 0 deletions .phpcs.xml
Original file line number Diff line number Diff line change
@@ -0,0 +1,14 @@
<?xml version="1.0"?>
<ruleset name="Yocto Framework Coding Standard">
<description>Yocto Framework Coding Standard</description>
<arg value="p" />

<rule ref="PSR12"/>
<rule ref="PSR1"/>
<rule ref="PSR2">
<exclude name="Generic.Files.LineEndings.InvalidEOLChar" />
<exclude name="PSR2.ControlStructures.ControlStructureSpacing.SpacingAfterOpenBrace" />
<exclude name="PSR2.Files.EndFileNewline.NoneFound" />
</rule>
<rule ref="Generic.Arrays.DisallowLongArraySyntax" />
</ruleset>
18 changes: 15 additions & 3 deletions composer.json
Original file line number Diff line number Diff line change
Expand Up @@ -9,9 +9,18 @@
}
],
"scripts": {
"check": [
"@sniff",
"@stan",
"@md",
"@test"
],
"test": "pest --coverage",
"test-github": "pest --no-coverage",
"stan": "phpstan analyse src --memory-limit=-1"
"test-github": "pest --coverage --coverage-clover=coverage.xml",
"stan": "phpstan analyse src --memory-limit=-1",
"sniff": "php vendor/squizlabs/php_codesniffer/bin/phpcs -s --colors src/",
"fix": "php vendor/squizlabs/php_codesniffer/bin/phpcbf src/",
"md": "php vendor/bin/phpmd src/ text rulesets.xml"
},
"autoload": {
"psr-4": {
Expand All @@ -25,14 +34,17 @@
"require-dev": {
"pestphp/pest": "^1.21",
"phpstan/phpstan": "^1.2",
"guzzlehttp/psr7": "^2.4"
"guzzlehttp/psr7": "^2.4",
"squizlabs/php_codesniffer": "^3.7",
"phpmd/phpmd": "^2.13"
},
"config": {
"allow-plugins": {
"pestphp/pest-plugin": true
}
},
"require": {
"php": "^8.1",
"psr/http-message": "^1.0",
"psr/http-server-middleware": "^1.0",
"psr/http-factory": "^1.0"
Expand Down
Loading

0 comments on commit 7b7f256

Please sign in to comment.