attenzione/SublimeLinter-scss-lint

It does not respect the 'exclude' directive in my .scss-lint.yml file

jblandry opened this issue · 5 comments

Hi I want certain files not to be linted in Sublime but it seems that the exclude directive is not respected by the plugin.

It works (the not-linting) in command line, because it returns 'No SCSS files specified'.

Thanks in advance

you should configure scss-lint according to
https://github.com/causes/scss-lint#configuration

make sure, that SublimeLinter uses your config file. Open Sublime console, what command is executed while linting?

I'm also having this issue.

This is my full .scss-lint.yml file:

exclude: 'app/assets/stylesheets/sprites/**'

linters:
  BangFormat:
    enabled: true
    space_before_bang: true
    space_after_bang: false

  BorderZero:
    enabled: false
    convention: zero # or `none`

  ColorKeyword:
    enabled: true

  ColorVariable:
    enabled: true

  Comment:
    enabled: true

  DebugStatement:
    enabled: true

  DeclarationOrder:
    enabled: true

  DuplicateProperty:
    enabled: true

  ElsePlacement:
    enabled: true
    style: same_line # or 'new_line'

  EmptyLineBetweenBlocks:
    enabled: true
    ignore_single_line_blocks: true

  EmptyRule:
    enabled: true

  FinalNewline:
    enabled: true
    present: true

  HexLength:
    enabled: true
    style: short # or 'long'

  HexNotation:
    enabled: true
    style: lowercase # or 'uppercase'

  HexValidation:
    enabled: true

  IdSelector:
    enabled: true

  ImportantRule:
    enabled: true

  ImportPath:
    enabled: true
    leading_underscore: false
    filename_extension: false

  Indentation:
    enabled: true
    allow_non_nested_indentation: false
    character: space # or 'tab'
    width: 2

  LeadingZero:
    enabled: true
    style: exclude_zero # or 'include_zero'

  MergeableSelector:
    enabled: true
    force_nesting: true

  NameFormat:
    enabled: true
    allow_leading_underscore: true
    convention: hyphenated_lowercase # or 'BEM', or a regex pattern

  NestingDepth:
    enabled: true
    max_depth: 3

  PlaceholderInExtend:
    enabled: false

  PropertyCount:
    enabled: false
    include_nested: false
    max_properties: 10

  PropertySortOrder:
    enabled: false
    ignore_unspecified: false
    separate_groups: false

  PropertySpelling:
    enabled: true
    extra_properties: []

  QualifyingElement:
    enabled: true
    allow_element_with_attribute: false
    allow_element_with_class: false
    allow_element_with_id: false

  SelectorDepth:
    enabled: true
    max_depth: 3

  SelectorFormat:
    enabled: true
    convention: hyphenated_lowercase # or 'BEM', or 'hyphenated_BEM', or 'snake_case', or 'camel_case', or a regex pattern

  Shorthand:
    enabled: true

  SingleLinePerProperty:
    enabled: true
    allow_single_line_rule_sets: true

  SingleLinePerSelector:
    enabled: true

  SpaceAfterComma:
    enabled: true

  SpaceAfterPropertyColon:
    enabled: true
    style: one_space # or 'no_space', or 'at_least_one_space', or 'aligned'

  SpaceAfterPropertyName:
    enabled: true

  SpaceBeforeBrace:
    enabled: true
    style: space # or 'new_line'
    allow_single_line_padding: false

  SpaceBetweenParens:
    enabled: true
    spaces: 0

  StringQuotes:
    enabled: false
    style: single_quotes # or double_quotes

  TrailingSemicolon:
    enabled: true

  TrailingZero:
    enabled: false

  UnnecessaryMantissa:
    enabled: true

  UnnecessaryParentReference:
    enabled: true

  UrlFormat:
    enabled: true

  UrlQuotes:
    enabled: true

  VariableForProperty:
    enabled: false
    properties: []

  VendorPrefixes:
    enabled: true
    identifier_list: base
    include: []
    exclude: []

  ZeroUnit:
    enabled: true

  Compass::*:
    enabled: false

I've also tried structuring the exclude section like this:

exclude:
  - "app/assets/stylesheets/sprites/_jpg.scss"
  - "app/assets/stylesheets/sprites/_png.scss"

but still no dice.

My Sublime console command looks like this:

SublimeLinter: scss: _png.scss ['/Users/nick/.rvm/bin/rvm-auto-ruby', '/Users/nick/.rvm/gems/ruby-2.1.5/bin/scss-lint', '--config', '/Users/nick/Sites/project/.scss-lint.yml']

so the correct config file is definitely being used, maybe there's an issue with my syntax or something.

Any ideas? Thanks.

Having the same issue. SublimeLinter is reporting warnings on files that I have excluded in individual linters.

Excerpt from my .scss-lint.yml

scss_files: './Styles/**/*.scss'

exclude:
  - './Styles/legacy/bootstrap/*'
  - './Styles/lib/*'

linters:

  BorderZero:
    enabled: true

  EmptyLineBetweenBlocks:
    enabled: true
    exclude:
      - './Styles/legacy/**'
    ignore_single_line_blocks: true

Files inside Styles/legacy/ still report EmptyLineBetweenBlocks as a warning. (Running scss-lint from the command line correctly skips those warnings)

When I turn on debug in SublimeLinter, it shows this being run:

SublimeLinter: scss: _video-showcase.scss ['C:\\Ruby22-x64\\bin\\ruby.exe', '-S', 'scss-lint', '--config', 'C:\\dev\\<project>\\.scss-lint.yml']

I've tried several different formats for the exclude path and none of them seem to work.

scss-lint

Same issue here with the global exclude option.

@attenzione Could it be related to this: https://github.com/attenzione/SublimeLinter-scss-lint/blob/master/linter.py#L25 ?

How come this issue is closed with no answer?