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 linting #12

Closed
felixfbecker opened this issue Sep 5, 2016 · 7 comments
Closed

Add linting #12

felixfbecker opened this issue Sep 5, 2016 · 7 comments

Comments

@felixfbecker
Copy link
Owner

I don't know what is the best linter for PHP and how to configure it?
Needs to be integrated in CI

@sunverwerth
Copy link
Contributor

sunverwerth commented Oct 8, 2016

I've been using https://github.com/squizlabs/PHP_CodeSniffer at work.
It's extendable with custom validation rules and already contains rules for PSR-2.
It's available as a composer package and actively maintained.

Overall very nice, haven't integrated it with a CI solution, however.

And since #35 already depends on it this would be a good fit.

@kaloyan-raev
Copy link
Contributor

How about using the PHP Mess Detector for additional static code analysis?

@felixfbecker
Copy link
Owner Author

felixfbecker commented Oct 10, 2016

What I desire is a linter, that can be configured through a config file and defaults to some coding best practices, that can be installed with Composer, run in CI and has an editor plugin for VS Code

If anyone has experience with one I would welcome a PR

@kaloyan-raev
Copy link
Contributor

As far as I am familiar there is no one tool to rule them all. http://phpqatools.org/ is a nice collection of popular tools that are used in CI. Some of them like Code Sniffer and Mess Detector are also often integrated in the editor/IDE.

I can imagine that the language server look for the specific configuration files in the project and if found, activate the corresponding linting tool. For example, if there is a phpcs.xml file then the language server will activate use Code Sniffer to report additional diagnostics. Of course, the client should be able to override this default behavior.

@felixfbecker
Copy link
Owner Author

@kaloyan-raev This issue is not for adding linting to the LS, it is for linting this repository (for PRs etc) 😄

@kaloyan-raev
Copy link
Contributor

OK :)

@ADmad ADmad mentioned this issue Oct 22, 2016
@ADmad
Copy link
Contributor

ADmad commented Oct 22, 2016

..and has an editor plugin for VS Code

This phpcs plugin works just fine https://marketplace.visualstudio.com/items?itemName=ikappas.phpcs

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

No branches or pull requests

4 participants