Created
August 26, 2020 01:05
-
-
Save kapitanluffy/2d3b17bb6daabb884012739c9fc3e81e to your computer and use it in GitHub Desktop.
SublimeLinter setup
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Install this in a separate directory: | |
- https://github.com/phpstan/phpstan | |
- https://github.com/phpmd/phpmd | |
- https://github.com/squizlabs/PHP_CodeSniffer | |
You can either use composer or downloading the phar file. I prefer composer since I can update it easily w/o redownloading the phar.. |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Show hidden characters
{ | |
"debug": true, | |
"delay": 0.5, | |
"linters": { | |
// basically, this is just what you need in enabling a linter | |
"php": { | |
"disable": false | |
}, | |
"phpcs": { | |
"args": [ | |
// specify the standards you want phpcs to check | |
"--standard=PSR1,PSR2,PSR12" | |
], | |
"disable": false, | |
"excludes": [], | |
// lint only on save because this shit is slow sometimes | |
"lint_mode": "save" | |
}, | |
"phpmd": { | |
"args": [], | |
// ruleset ignoring some annoying rules | |
"rulesets": "D://~/bin/phpmd/legacy-ruleset.xml", | |
"disable": false, | |
"excludes": [], | |
// lint only on save because this shit is slow sometimes | |
"lint_mode": "save" | |
}, | |
"phpstan": { | |
"working_dir": "${folder:$file_path}", | |
"disable": false, | |
"args": [ | |
"--memory-limit=2048M" | |
], | |
"excludes": [] | |
}, | |
"phplint": { | |
"disable": true, | |
"args": [], | |
"excludes": [] | |
}, | |
}, | |
"paths": { | |
"linux": [], | |
"osx": [], | |
"windows": [ | |
// add here the paths pointing to each linter executable | |
"D://~/bin/php", | |
"D://~/bin/phpcs", | |
"D://~/bin/phpmd/vendor/bin", | |
"D://~/bin/phpstan", | |
"D://~/bin/phplint", | |
] | |
}, | |
// you can enable this but i currently prefer LSP's error panel showing up | |
"show_panel_on_save": "never", | |
"lint_mode": "background" | |
} |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment