Skip to content

Instantly share code, notes, and snippets.

@kapitanluffy
Created August 26, 2020 01:05
Show Gist options
  • Save kapitanluffy/2d3b17bb6daabb884012739c9fc3e81e to your computer and use it in GitHub Desktop.
Save kapitanluffy/2d3b17bb6daabb884012739c9fc3e81e to your computer and use it in GitHub Desktop.

Revisions

  1. kapitanluffy created this gist Aug 26, 2020.
    57 changes: 57 additions & 0 deletions SublimeLinter.sublime-settings
    Original file line number Diff line number Diff line change
    @@ -0,0 +1,57 @@
    {
    "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"
    }
    6 changes: 6 additions & 0 deletions setup
    Original file line number Diff line number Diff line change
    @@ -0,0 +1,6 @@
    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..