AtomLinter / linter-scss-lint

Linter plugin for SCSS, using scss-lint
36 stars 21 forks source link

Global exclude setting not works #110

Open h8is2w8 opened 8 years ago

h8is2w8 commented 8 years ago

I want to exclude some files. But Linter always runs on them. I'm sure the relative path is correct, because scss_lint command works with all exclusions. Please help.

scss_files: 'app/assets/stylesheets/client/*.scss'
exclude: 'app/assets/stylesheets/general/plugin-modifications/*.scss'

linters:
  SelectorFormat:
    enabled: true
    convention: hyphenated_BEM
  ElsePlacement:
    enabled: false
Arcanemagus commented 8 years ago

It's debatable whether this is a bug or not, you are explicitly asking it to lint the file, but also asking it to ignore it, which is it supposed to do?

If scss_lint on the command line shows no errors for an ignored file then I would gladly review a PR that fixes this behavior.

h8is2w8 commented 8 years ago

Yes, scss_lint on the CL shows no errors for all ignored files. Thank you.

Arcanemagus commented 8 years ago

If you want to implement this you will need to create a parser for the configuration files, and then something to parse the exclude section, check the current file's path and see if they match before attempting to lint.

SpainTrain commented 8 years ago

@h8is2w8 Would you mind performing a test?

cat path/to/ignored/file.scss | scss_lint --stdin-file-path=path/to/ignored/file.scss

and see whether that properly ignores the file?

SpainTrain commented 8 years ago

If that works, then https://github.com/AtomLinter/linter-scss-lint/issues/103 would solve this issue.

h8is2w8 commented 8 years ago

@SpainTrain I updated scss_lint to 0.43.2. Test failed. File is not ignored via stdin. I still don't get what should I do :(

SpainTrain commented 8 years ago

Ok, mind filing that as an upstream issue at https://github.com/brigade/scss-lint/issues? I am pretty sure that the intended behavior is to have the ignore rule work with the stdin-file-path. Once it is fixed upstream, #103 will fix it here.

FYI, they are very good about addressing bugs and feature requests (https://github.com/brigade/scss-lint/issues/578).

mvasin commented 7 years ago

I also have the issue of not ignoring the ignored files. Here's my .scss-lint.yml:

exclude:
  - 'vendor/**/*'
  - 'assets/main.scss'

I do have the files ignored by cli scss-lint, but atom shows warnings when I open those files anyway.