Skip to content

Commit

Permalink
Apply php-cs-fixer with default PSR12 ruleset
Browse files Browse the repository at this point in the history
  • Loading branch information
pjcdawkins committed Dec 23, 2024
1 parent 2c970e2 commit a129d36
Show file tree
Hide file tree
Showing 274 changed files with 2,612 additions and 937 deletions.
17 changes: 10 additions & 7 deletions .github/workflows/ci.yml
Original file line number Diff line number Diff line change
Expand Up @@ -44,19 +44,22 @@ jobs:
CI_COMMIT_SHORT_SHA=$(echo $CI_COMMIT_SHA | head -c8)
./bin/platform self:build --no-composer-rebuild --yes --replace-version "$CI_COMMIT_REF_NAME"-"$CI_COMMIT_SHORT_SHA" --output platform.phar
- name: Lint PHP files
run: make lint-php-cs-fixer lint-phpstan

- name: Run PHPUnit tests
run: |
composer install --no-interaction --no-scripts
./scripts/test/unit.sh
- name: Set up Go
uses: actions/setup-go@v4
with:
go-version: 1.22
cache-dependency-path: cli/go.sum

- name: Lint files
run: make lint-gofmt lint-phpstan

- name: Run PHPUnit tests
run: |
composer install --no-interaction --no-scripts
./scripts/test/unit.sh
- name: Lint Go files
run: make lint-gofmt

- name: Run integration tests
run: |
Expand Down
1 change: 1 addition & 0 deletions .gitignore
Original file line number Diff line number Diff line change
Expand Up @@ -6,3 +6,4 @@
/local-php-security-checker
/.phpunit.result.cache
/.phpunit.cache
/.php-cs-fixer.cache
10 changes: 8 additions & 2 deletions Makefile
Original file line number Diff line number Diff line change
@@ -1,12 +1,18 @@
GO_TESTS_DIR=go-tests

vendor/bin/phpstan:
composer_tools=phpstan php-cs-fixer

$(composer_tools):
composer install

.PHONY: lint-phpstan
lint-phpstan: vendor/bin/phpstan
./vendor/bin/phpstan analyse

.PHONY: lint-php-cs-fixer
lint-php-cs-fixer: vendor/bin/php-cs-fixer
./vendor/bin/php-cs-fixer check src

.PHONY: lint-gofmt
lint-gofmt:
cd $(GO_TESTS_DIR) && go fmt ./...
Expand All @@ -17,7 +23,7 @@ lint-golangci:
cd $(GO_TESTS_DIR) && golangci-lint run

.PHONY: lint
lint: lint-gofmt lint-golangci lint-phpstan
lint: lint-gofmt lint-golangci lint-php-cs-fixer lint-phpstan

.PHONY: test
test:
Expand Down
3 changes: 2 additions & 1 deletion composer.json
Original file line number Diff line number Diff line change
Expand Up @@ -48,7 +48,8 @@
},
"require-dev": {
"phpunit/phpunit": "^11",
"rector/rector": "^1.2"
"rector/rector": "^1.2",
"friendsofphp/php-cs-fixer": "^3.65"
},
"authors": [
{
Expand Down
Loading

0 comments on commit a129d36

Please sign in to comment.