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

Consistency for static code analysis support #22

Open
peter279k opened this issue Oct 27, 2021 · 3 comments
Open

Consistency for static code analysis support #22

peter279k opened this issue Oct 27, 2021 · 3 comments
Assignees
Labels
enhancement New feature or request question Further information is requested

Comments

@peter279k
Copy link
Member

Is your feature request related to a problem? Please describe.

  • Add static code analysis support and consistency.

Describe the solution you'd like

  • It seems that this package has been defined with phpstan installation. However, other packages on this org are defined with Psalm installation. I think we should determine one of static code analysis tools support because of consistency.

Describe alternatives you've considered

N/A

Additional context

N/A

@peter279k peter279k added the question Further information is requested label Oct 27, 2021
@peter279k peter279k added the enhancement New feature or request label Oct 27, 2021
@kpicaza
Copy link
Member

kpicaza commented Nov 2, 2021

Hi @peter279k, sorry for the delay. I think the reason is that I start using psalm time after creating this package. You are right, it should have Psalm in the pipeline for consistency.
I like to use both Phpstan and Psalm, both do the same but they do in a different way, and both detect some different issues. In Pheature-Flags we are using this config and it works pretty well. https://github.com/pheature-flags/toggle-model/blob/1.0.x/composer.json (look at scripts section).

Thank you very much, I have to find some time to update Antidot packages' pipeline and PHP 8.1 compatibilities.

@peter279k
Copy link
Member Author

Hi @kpicaza, thanks for your reply and clear explanation.

Due to your explanation, I think the current solution should let Psalm and PHPStan running on every PHP package workflow pipelines.

And I also think above static code analysis tools can be added on grumphp.yml.

What do you think about these?

@kpicaza
Copy link
Member

kpicaza commented Nov 5, 2021

Yes;-D, adding both commands inside the composer check-all script will work.
The check-all script is the action configured in Grumphp.

it will be something like:

    "scripts": {
        "check-all": [
            "@cs-check",
            "@inspect",
+           "@psalm",
            "@test"
        ],
        "test": "phpunit",
        "cs-check": "phpcs src tests",
        "cs-fix": "phpcbf src tests",
        "inspect": "phpstan analyse src -l7 --ansi",
+       "psalm": "psalm"
    },

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
enhancement New feature or request question Further information is requested
Projects
None yet
Development

No branches or pull requests

2 participants