markalfred / SublimeLinter-contrib-stylint

SublimeLinter plugin for Stylint
MIT License
10 stars 4 forks source link

bug(config): .stylintrc (with groupOutputByFile) doesn't work #11

Open Kristinita opened 6 years ago

Kristinita commented 6 years ago

1. Summary

Options from .stylintrc doesn't work for me.

#9 — possibly related issue.

2. Environment

3. Configuration

.stylintrc:

{
    "blocks": "always",
    "brackets": "never",
    "colons": "never",
    "colors": "always",
    "commaSpace": "always",
    "commentSpace": "always",
    "cssLiteral": "always",
    "depthLimit": 4,
    "duplicates": "always",
    "efficient": "always",
    "exclude": [],
    "extendPref": "@extend",
    "globalDupe": "always",
    "groupOutputByFile": "always",
    "indentPref": false,
    "leadingZero": "never",
    "maxErrors": "never",
    "maxWarnings": "never",
    "mixed": "always",
    "namingConvention": false,
    "namingConventionStrict": "always",
    "none": "always",
    "noImportant": "always",
    "parenSpace": "never",
    "placeholder": "always",
    "prefixVarsWithDollar": "always",
    "quotePref": "double",
    "semicolons": "never",
    "sortOrder": false,
    "stackedProperties": "always",
    "trailingWhitespace": "never",
    "universal": "always",
    "valid": false,
    "zeroUnits": "never",
    "zIndexNormalize": 100
}

SashaStylus.styl:

.SashaClass {
    color: red;
}

User/SublimeLinter.sublime-settings:

{
    "debug": true,
}

4. Steps to reproduce

I reproduce the problem in a version of Sublime Text without plugins and user settings.

I install SublimeLinter and SublimeLinter-contrib-stylint → I restart Sublime Text → I open Sublime Text console → I open SashaStylus.styl.

5. Expected behavior

If Stylint CLI:

D:\SashaDemoRepositories\SashaStylusDebugging>stylint SashaStylus.styl

SashaStylus.styl 1:12     warning  unnecessary bracket         brackets   true
SashaStylus.styl 2:6      warning  unnecessary colon found     colons     true
SashaStylus.styl 2:11     warning  unnecessary semicolon found semicolons true
SashaStylus.styl 3        warning  unnecessary bracket         brackets   true

Stylint: 0 Errors. (Max Errors: never)
Stylint: 4 Warnings. (Max Warnings: never)

6. Actual behavior

stylint(ok), no gutter marks.

Stylint

Warnings show in console.

SublimeLinter: SublimeLinter.sublime-package:241: Delay buffer 25 for 0.3s
SublimeLinter: SublimeLinter.sublime-package:364: detected syntax: stylus
SublimeLinter: #1 SublimeLinter.sublime-package:737: 'stylint' is linting 'SashaStylus.styl'
SublimeLinter: #1 SublimeLinter.sublime-package:105: PATH:
    D:\Andy
    C:\Program Files\Docker\Docker\Resources\bin
    C:\ProgramData\Boxstarter
    C:\Python27\Scripts
    C:\Python27
    C:\Program Files\MiKTeX 2.9\miktex\bin\x64\
    C:\tools\ruby23\bin
    C:\Python36\Scripts\
    C:\Python36\
    C:\ProgramData\Oracle\Java\javapath
    C:\WINDOWS\system32
    C:\WINDOWS
    C:\WINDOWS\System32\Wbem
    C:\WINDOWS\System32\WindowsPowerShell\v1.0\
    C:\ProgramData\chocolatey\bin
    C:\Program Files\Java\jdk1.8.0_112\bin
    C:\Program Files (x86)\Bazaar\
    C:\tools\NirLauncher\Nirsoft
    C:\tools\python2-x86_32
    C:\Program Files (x86)\Windows Kits\8.1\Windows Performance Toolkit\
    C:\Program Files\Git LFS
    C:\Program Files\Java\jdk1.8.0_121\bin
    C:\Program Files\Calibre2\
    C:\Program Files\Rust stable GNU 1.13\bin
    C:\Strawberry\c\bin
    C:\Strawberry\perl\site\bin
    C:\Strawberry\perl\bin
    C:\Program Files\Android\android-sdk\tools
    C:\Program Files\gnuplot\bin
    C:\Program Files\Rust stable GNU 1.16\bin
    C:\Program Files (x86)\gtm
    C:\Android\android-sdk\tools
    C:\HashiCorp\Vagrant\bin
    C:\ProgramData\ComposerSetup\bin
    C:\Program Files\Java\jdk1.8.0_131\bin
    C:\Program Files\Rust stable GNU 1.17\bin
    C:\Program Files\Rust stable GNU 1.18\bin
    C:\Program Files\OpenVPN\bin
    C:\Program Files\OpenSSL\bin
    C:\tools\php71
    C:\Program Files\Java\jdk1.8.0_141\bin
    C:\Program Files\Rust stable GNU 1.19\bin
    C:\Program Files\Java\jdk1.8.0_144\bin
    C:\Program Files\Rust stable GNU 1.20\bin
    C:\Program Files\Java\jdk1.8.0_152\bin
    C:\Program Files\Rust stable GNU 1.21\bin
    C:\Program Files\Rust stable GNU 1.22\bin
    C:\tools\php72
    C:\Program Files\Java\jdk1.8.0_162\bin
    C:\Program Files\Rust stable GNU 1.23\bin
    C:\tools\go\bin
    C:\Program Files\GTK3-Runtime Win64\bin
    C:\Program Files\Rust stable GNU 1.24\bin
    C:\Program Files\Git\cmd
    C:\Program Files\Rust stable GNU 1.25\bin
    C:\Program Files (x86)\Gpg4win\..\GnuPG\bin
    C:\Program Files\Java\jdk1.8.0_172\bin
    C:\Program Files\nodejs\
    C:\Program Files (x86)\Skype\Phone\
    C:\Program Files (x86)\Yarn\bin\
    C:\Program Files (x86)\Subversion\bin
    C:\Users\SashaChernykh\scoop\shims
    C:\tools\cygwin\bin
    C:\Program Files (x86)\GnuWin32\bin
    D:\Chocolatey\bin
    C:\Users\SashaChernykh\AppData\Local\Pandoc\
    D:\Chocolatey\lib\cloneapp\tools
    C:\Users\SashaChernykh\bin
    C:\Users\SashaChernykh\.local\bin
    C:\Program Files\Git\mingw64\bin
    C:\Program Files\Git\usr\bin
    C:\Program Files\Git\usr\share\vim\vim74
    C:\Program Files\Git\usr\bin\vendor_perl
    C:\Program Files\Git\usr\bin\core_perl

    C:\Users\SashaChernykh\AppData\Local\hyper\app-2.0.0\resources\bin
    C:\Users\SashaChernykh\AppData\Roaming\npm
    C:\Users\SashaChernykh\AppData\Local\Yarn\bin
    D:\Chocolatey\lib\ghc\tools\ghc-8.4.2\bin

    D:\AutoHotkey
    D:\SUDCA3~1\Data\Packages\python-pywin32\st3_windows_x64\pywin32_system32
    C:\Users\SashaChernykh\AppData\Roaming\npm
SublimeLinter: #1 SublimeLinter.sublime-package:1087: The `@` symbol in cmd has been deprecated. Use $file, $temp_file or $file_on_disk instead.
SublimeLinter: #1 SublimeLinter.sublime-package:1159: Running …

  D:\SashaDemoRepositories\SashaStylusDebugging  (working dir)
  > C:\Users\SashaChernykh\AppData\Roaming\npm\stylint.cmd c:\users\sashac~1\appdata\local\temp\tmpqxjxyj.styl

SublimeLinter: #1 SublimeLinter.sublime-package:790: stylint output:
    c:\users\sashac~1\appdata\local\temp\tmpqxjxyj.styl
    FILE                                                LINEDATA SEVERITY DESCRIPTION                 RULE       C:\USERS\SASHAC~1\APPDATA\LOCAL\TEMP\TMPQXJXYJ.STYL
    c:\users\sashac~1\appdata\local\temp\tmpqxjxyj.styl 1:12     warning  unnecessary bracket         brackets   true                                               
    c:\users\sashac~1\appdata\local\temp\tmpqxjxyj.styl 2:6      warning  unnecessary colon found     colons     true                                               
    c:\users\sashac~1\appdata\local\temp\tmpqxjxyj.styl 2:11     warning  unnecessary semicolon found semicolons true                                               
    c:\users\sashac~1\appdata\local\temp\tmpqxjxyj.styl 3        warning  unnecessary bracket         brackets   true                                               

    Stylint: 0 Errors. (Max Errors: never)
    Stylint: 4 Warnings. (Max Warnings: never)
SublimeLinter: #1 SublimeLinter.sublime-package:818: stylint: No matches for regex: (?xi)
        # Comments show example output for each line of a Stylint warning
        # /path/to/file/example.styl
        ^.*$\s*
        # 177:24 colors warning hexidecimal color should be a variable
        ^(?P<line>\d+):?(?P<near>\d+)?\s*\w+\s*((?P<warning>warning)|(?P<error>error))\s*(?P<message>.+)$\s*

SublimeLinter: SublimeLinter.sublime-package:287: Linting buffer 25 took 0.45s

Thanks.

max-degterev commented 5 years ago

No matches for regex: (?xi)

Same issue here, most of the time i get parse error in the console. Any preferred reporter config that definitely works?

markalfred commented 5 years ago
SublimeLinter: #1 SublimeLinter.sublime-package:790: stylint output:
    c:\users\sashac~1\appdata\local\temp\tmpqxjxyj.styl
    FILE                                                LINEDATA SEVERITY DESCRIPTION                 RULE       C:\USERS\SASHAC~1\APPDATA\LOCAL\TEMP\TMPQXJXYJ.STYL
    c:\users\sashac~1\appdata\local\temp\tmpqxjxyj.styl 1:12     warning  unnecessary bracket         brackets   true                                               
    c:\users\sashac~1\appdata\local\temp\tmpqxjxyj.styl 2:6      warning  unnecessary colon found     colons     true                                               
    c:\users\sashac~1\appdata\local\temp\tmpqxjxyj.styl 2:11     warning  unnecessary semicolon found semicolons true                                               
    c:\users\sashac~1\appdata\local\temp\tmpqxjxyj.styl 3        warning  unnecessary bracket         brackets   true                                               

This isn't matching because the output includes the filename at the very beginning — if you turn groupOutputByFile off, it should work.

That said, this should really be able to handle that case, so I'll work on it. Thank you for the report @Kristinita

markalfred commented 5 years ago

Just wanted to give an update on this: the plugin does not work well in many cases, I have opened a PR with stylint to help resolve this (https://github.com/SimenB/stylint/pull/454). The root issue is that parsing stylint warnings and errors is difficult, because there is no way for this plugin to dictate the format of those errors, and their format can vary drastically between versions and configurations. Once the PR above has been merged, it should be possible to get this plugin working better. 🙏