tomasbasham / ember-cli-scss-lint

An ember-cli addon to integrate sass-lint for standards adherence and improved style consistency
MIT License
7 stars 6 forks source link

No scss-lint output when running/building ember #8

Closed mschwenk closed 8 years ago

mschwenk commented 8 years ago

Hey there, I hope you can help me getting scss-lint to work with my ember project.

I rungem install scss-lint first and run ember install ember-cli-scss-lint afterwards. I also added a .scss-lint.yml configuration file. But when I run ember server or ember build there is no scss-lint output although I know there is some scss that won't fit the confirguration.

I run scss-lint in my project directory to check if scss-lint is working and I get the desired output.

So what do I have to do to get it work for my ember project running ember server or ember build?

tomasbasham commented 8 years ago

What version of scss-lint are you running? It may be the case that later versions don't work with this addon.

Tomass-MacBook-Pro data$ scss-lint --version
scss-lint 0.42.2
tomasbasham commented 8 years ago

Also since releasing this addon the scss-lint gem has been moved to scss_lint (with an underscore). I will have to update my README to reflect this change. Try sudo gem install scss_lint and see if this helps

mschwenk commented 8 years ago

scss-lint version running is 0.49.0 wich version is maximum recommended for scss-lint? 0.42.2 as you have installed?

I will try sudo gem install scss_lint aswell.

mschwenk commented 8 years ago

sudo gem install scss_lint just installed the newest version of scss_lint (0.49.0). So I changed the version to 0.42.2. It's the only existing installation of scss_lint left.

scss-lint directly works in the project directory. running ember does again give not the desired output. I also changed severity to error. Unfortunately this does not do the trick.

Are there any other dependencies I am not aware of?

tomasbasham commented 8 years ago

ok. I'll take a closer look this evening. It may be incompatible with later ember versions. This was developed around the time of ember 1.13.* and I have had no reason to update, or for that matter, test it on more recent releases. May I see your .scss-lint.yml file?

mschwenk commented 8 years ago

.scss-lint.yml just contains the following lines (as I was just starting to configure it to our needs):

scss_files: 'app/styles/'

# Default severity of all linters.
severity: error

linters:
  ColorVariable:
    enabled: true

Information on the project: ember-cli: 2.5.0 node: 4.4.7 os: win32 x64

tomasbasham commented 8 years ago

I have just create a plain ember-cli application here That uses:

ember-cli: 2.7.0 ember-cli-sass: 5.5.1 ember-cli-scss-lint: 1.0.0 ember-cli-bourbon: 1.2.2

ember-cli-sass, nor ember-cli-bourbon are crucial dependencies

This appears to be working correctly and I get the output I am expecting from the addon. Can you try cloning and running ember s on this app. This is what I see:

Tomass-MacBook-Pro mysite (master)$ ember s
Could not start watchman; falling back to NodeWatcher for file system events.
Visit http://ember-cli.com/user-guide/#watchman for more info.

Just getting started with Ember? Please visit http://localhost:4200/ember-getting-started to get going

Livereload server on http://localhost:49154
Serving on http://localhost:4200/

[scss-lint] app.scss:1 - StringQuotes: Prefer single quoted strings

Build successful - 2023ms.

Slowest Trees                                 | Total               
----------------------------------------------+---------------------
ScssLinter                                    | 485ms               
Babel                                         | 176ms               
Babel                                         | 143ms               
SourceMapConcat: Concat: Vendor /assets/ve... | 114ms               

Slowest Trees (cumulative)                    | Total (avg)         
----------------------------------------------+---------------------
Babel (12)                                    | 555ms (46 ms)       
ScssLinter (1)                                | 485ms               
SourceMapConcat: Concat: Vendor /asset... (1) | 114ms               
mschwenk commented 8 years ago

this is what I get

bootstrap-sassy config: all JS enabled, glyphicons disabled
Livereload server on http://localhost:49152
Serving on http://localhost:4200/

Build successful - 10134ms.

Slowest Trees                                 | Total
----------------------------------------------+---------------------
Babel                                         | 871ms
SassCompiler                                  | 649ms
ScssLinter                                    | 599ms

Slowest Trees (cumulative)                    | Total (avg)
----------------------------------------------+---------------------
Babel (30)                                    | 2462ms (82 ms)
SassCompiler (1)                              | 649ms
ScssLinter (1)                                | 599ms
TemplateCompiler (10)                         | 537ms (53 ms)
tomasbasham commented 8 years ago

Ok. I will have to grab a windows machine to test this out. I wont be able to do so until this evening however.

mschwenk commented 8 years ago

Okay, I can wait. It does not seem to break anything :D

"ember-cli": "2.5.0", "ember-cli-sass": "5.3.1", "ember-cli-scss-lint": "1.0.0"

Is ember-cli-bourbon necessary for scss-lint to work?

tomasbasham commented 8 years ago

ember-cli-scss-lint does not depend on ember-cli-bourbon. I used it just to quickly knock up something.

tomasbasham commented 8 years ago

Ok, so I have found the issue. Basically this line should read inputPath += '/**/*';. I'll take responsibility for that one, since this was actually my contribution to that repo. This change does not seem to be necessary for OS X and linux based installations. Until I make a PR for this you could change this line manually from within node_modules. Not the perfect solution but hopefully I'll be able to get around to this soon.

mschwenk commented 8 years ago

Yeah, this works for me. Thx :)

mschwenk commented 8 years ago

@tomasbasham is there any progress on fixing this windows related issue?

tomasbasham commented 8 years ago

I took a look at the solution I posted above last night. However applying this fix breaks OS X and possibly linux. So I am kind of back to square one with a solution to this.

johanbove commented 8 years ago

I'm having a similar issue where ember-cli-scss-lint is not outputting anything, even-though I have obvious errors in the scss files. I'm using the "pods" configuration.

Is there a way to debug this?

ember-cli: 2.7.0 node: 5.11.1 os: darwin x64

tomasbasham commented 8 years ago

@johanbove hmmm... I'm not sure if this addon works with the pods configuration as I have never used it myself. The way I tend to debug this is to add console.logs within the addon index.js file. This can be found in node_modules/ember-cli-scss-lint/index.js. This is not really the ideal way to debug this, but there is no other way that I know of. Within there is a lintTree method. It may be worth checking this method is passing the correct directory (the one containing your SCSS files) to the ScssLinter broccoli plugin. I'm going to try take another look at this over the weekend as it seems to be a larger issue than I first realised.

tomasbasham commented 8 years ago

@mschwenk I have rewritten the broccoli plugin that backs this ember addon. Would you be able to try out the tomasbasham/ember-cli-scss-lint#develop branch. It is working on OSX but I don't tend to use Windows.

tomasbasham commented 8 years ago

@johanbove Can you do that same on your setup please