linter-scss-lint icon indicating copy to clipboard operation
linter-scss-lint copied to clipboard

Global exclude setting not works

Open h8is2w8 opened this issue 9 years ago • 8 comments

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.

  • Atom version: 1.3.1
  • LInter version: 1.11.3
  • SCSS-Lint version: 0.42.2
  • Sass version: 3.4.19
  • Ruby version: 2.2.1
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

h8is2w8 avatar Dec 15 '15 02:12 h8is2w8

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.

Arcanemagus avatar Dec 15 '15 06:12 Arcanemagus

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

h8is2w8 avatar Dec 15 '15 11:12 h8is2w8

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.

Arcanemagus avatar Dec 15 '15 17:12 Arcanemagus

@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 avatar Dec 15 '15 18:12 SpainTrain

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

SpainTrain avatar Dec 15 '15 18:12 SpainTrain

@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 :(

h8is2w8 avatar Dec 16 '15 01:12 h8is2w8

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).

SpainTrain avatar Dec 16 '15 07:12 SpainTrain

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.

mvasin avatar Aug 29 '17 07:08 mvasin