Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Add PHPStan code analysis [WEB-2017] #688

Merged
merged 6 commits into from
Feb 5, 2025

Conversation

nikhiltri
Copy link
Member

No description provided.

Copy link
Member

@zachgarwood zachgarwood left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Love it, this is awesome!

I think we could use this in our other products, as well, so I think we should consider installing this in the data-hub-foundation package.

.github/workflows/analyze.yml Outdated Show resolved Hide resolved
- name: Install PHP dependencies
run: composer install --no-interaction --no-progress --no-scripts
- name: Run PHP CodeSniffer
run: ./vendor/bin/phpstan analyze --no-progress --no-interaction --no-ansi
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

The command requires a path:

./vendor/bin/phpstan analyze --no-progress --no-interaction --no-ansi ./some/path

Copy link
Member Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

The paths are set in the phpstan.neon config file. Passing a path in the command line here would override the paths set in the config, so I think it's better managed there.

composer.json Outdated
@@ -77,6 +77,7 @@
"mockery/mockery": "^1.0",
"nunomaduro/collision": "^7.0",
"orchestra/testbench": "^7.8 || ^8.0 || ^9.0",
"phpstan/phpstan": "^1.12",
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Can/should we install and configure PHPStan in the data-hub-foundation package, so we can use it in all of our projects?

Copy link
Member Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Yes! I moved PHPStan into the data-hub-foundation and created a composer script to invoke it.

Copy link

sonarqubecloud bot commented Feb 5, 2025

@nikhiltri nikhiltri changed the title Add PHPPStan code analysis [WEB-2017] Add PHPStan code analysis [WEB-2017] Feb 5, 2025
@nikhiltri nikhiltri merged commit e421236 into feature/twill-upgrade Feb 5, 2025
5 checks passed
@nikhiltri nikhiltri deleted the feature/phpstan branch February 5, 2025 20:13
nikhiltri added a commit that referenced this pull request Feb 6, 2025
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants