? ? Pending

User tests: Successful: Unsuccessful:

avatar brianteeman
brianteeman
24 Feb 2020

Thanks to @C-Lodder this is another attempt at getting the scss linter to play with the hound

avatar brianteeman brianteeman - open - 24 Feb 2020
avatar brianteeman brianteeman - change - 24 Feb 2020
Status New Pending
avatar brianteeman
brianteeman - comment - 24 Feb 2020

@rdeutz I am guessing you have to merge it to see if it works?

avatar brianteeman brianteeman - change - 24 Feb 2020
Labels Added: ?
avatar C-Lodder
C-Lodder - comment - 24 Feb 2020

@brianteeman sorry, forgot to mention, maybe also do this:

scss:
  enabled: true

in the hound.yml

avatar joomla-cms-bot joomla-cms-bot - change - 24 Feb 2020
Category Unit Tests
avatar wilsonge wilsonge - close - 24 Feb 2020
avatar wilsonge wilsonge - merge - 24 Feb 2020
avatar wilsonge wilsonge - change - 24 Feb 2020
Status Pending Fixed in Code Base
Closed_Date 0000-00-00 00:00:00 2020-02-24 22:52:13
Closed_By wilsonge
Labels Added: ?
avatar wilsonge
wilsonge - comment - 24 Feb 2020

Let's give it a go. Thanks

avatar brianteeman
brianteeman - comment - 24 Feb 2020

any way to test and see if it is running? does hound have logs?

avatar wilsonge
wilsonge - comment - 24 Feb 2020

Not that I'm aware of. Best way to test is create a pull request now with bad code style from 4.0-dev and see if hound says yay/nay

avatar C-Lodder
C-Lodder - comment - 24 Feb 2020

If you're on macOS, you should have Ruby pre-installed.

  1. Open ROOT/Gemfile and update the version of scss_lint to 0.59.0
  2. Run gem install scss_lint
  3. Run scss-lint administrator/templates/atum/**/*.scss

Or you can use a JS linter? Up to you

avatar brianteeman
brianteeman - comment - 24 Feb 2020

@C-Lodder its running locally - i want to see it run on the servers here ;)

avatar C-Lodder
C-Lodder - comment - 24 Feb 2020

Make a change to your other PR and it should work.

avatar rdeutz
rdeutz - comment - 24 Feb 2020

I don't think you have to merge it hound should run on PR changes

avatar brianteeman
brianteeman - comment - 24 Feb 2020

Ddi that and it is now running BUT only on changed lines - maybe thats all it can do?

(@rdeutz it needed to be merged for hound to know it had to run ;) )

avatar C-Lodder
C-Lodder - comment - 24 Feb 2020

@brianteeman I can't see unless you trigger the build again

avatar brianteeman
brianteeman - comment - 24 Feb 2020

i just did it #28064

avatar C-Lodder
C-Lodder - comment - 24 Feb 2020

Just saw. Not sure why it's not working. The whole PR should fail. Can you try merging 4.0-dev into your branch?

avatar brianteeman
brianteeman - comment - 24 Feb 2020

not now - will have to do it tomorrow - that might be the problem though as PR #28070 worked as intended

avatar brianteeman
brianteeman - comment - 25 Feb 2020

The problem is not a problem it is a limitation of hound.

The hound is now finally checking scss
What the hound does is to ONLY check the changed lines
So any existing errors are not reported because hound doesnt look at them

avatar C-Lodder
C-Lodder - comment - 25 Feb 2020

Fair enough. It's probably best to lint it all locally then, and once fixed, future PR's can be done by Hound

avatar brianteeman
brianteeman - comment - 25 Feb 2020

Yeah - thats what I am going to do

avatar infograf768
infograf768 - comment - 25 Feb 2020

@C-Lodder
Looks like I have issue installing scss_lint
Log error is

package configuration for libffi is not found
"xcrun clang -o conftest -I/Applications/Xcode.app/Contents/Developer/Platforms/MacOSX.platform/Developer/SDKs/MacOSX10.13.sdk/System/Library/Frameworks/Ruby.framework/Versions/2.3/usr/include/ruby-2.3.0/universal-darwin16 -I/Applications/Xcode.app/Contents/Developer/Platforms/MacOSX.platform/Developer/SDKs/MacOSX10.13.sdk/System/Library/Frameworks/Ruby.framework/Versions/2.3/usr/include/ruby-2.3.0/ruby/backward -I/Applications/Xcode.app/Contents/Developer/Platforms/MacOSX.platform/Developer/SDKs/MacOSX10.13.sdk/System/Library/Frameworks/Ruby.framework/Versions/2.3/usr/include/ruby-2.3.0 -I. -D_XOPEN_SOURCE -D_DARWIN_C_SOURCE -D_DARWIN_UNLIMITED_SELECT -D_REENTRANT    -g -Os -pipe -DHAVE_GCC_ATOMIC_BUILTINS -iwithsysroot /usr/local/libressl/include conftest.c  -L. -L/System/Library/Frameworks/Ruby.framework/Versions/2.3/usr/lib -L.             -L /Applications/Xcode.app/Contents/Developer/Platforms/MacOSX.platform/Developer/SDKs/MacOSX10.12.Internal.sdk/usr/local/libressl/lib -L/Applications/Xcode.app/Contents/Developer/Platforms/MacOSX.platform/Developer/SDKs/MacOSX10.12.Internal.sdk/usr/local/lib   -arch x86_64 -arch i386   -lruby.2.3.0  -lpthread -ldl -lobjc "
In file included from conftest.c:1:
In file included from /Applications/Xcode.app/Contents/Developer/Platforms/MacOSX.platform/Developer/SDKs/MacOSX10.13.sdk/System/Library/Frameworks/Ruby.framework/Versions/2.3/usr/include/ruby-2.3.0/ruby.h:33:
/Applications/Xcode.app/Contents/Developer/Platforms/MacOSX.platform/Developer/SDKs/MacOSX10.13.sdk/System/Library/Frameworks/Ruby.framework/Versions/2.3/usr/include/ruby-2.3.0/ruby/ruby.h:24:10: fatal error: 'ruby/config.h' file not found
#include "ruby/config.h"
         ^~~~~~~~~~~~~~~
1 error generated.
checked program was:
/* begin */
1: #include "ruby.h"
2: 
3: int main(int argc, char **argv)
4: {
5:   return 0;
6: }
/* end */

Any idea?

avatar brianteeman
brianteeman - comment - 25 Feb 2020

sorry I cant help you - thats a mac thing

avatar C-Lodder
C-Lodder - comment - 25 Feb 2020

@infograf768 You need to update Ruby 2.4+ or install scss_lint 0.57.1 if you can't update Ruby

avatar infograf768
infograf768 - comment - 25 Feb 2020

OK. It worked with ruby 2.4.9p362 (2019-10-02 revision 67824) [x86_64-darwin16]

We get a lot of stuff like

ImportantRule: !important should not be used

IdSelector: Avoid using id selectors
administrator/templates/atum/scss/template-rtl.scss:251:1 [W] SelectorFormat: Selector `jform_old_url` should be written in lowercase with hyphens
administrator/templates/atum/scss/template-rtl.scss:251:1 [W] SelectorFormat: Selector `new_url` should be written in lowercase with hyphens
administrator/templates/atum/scss/template-rtl.scss:258:1 [W] SelectorFormat: Selector `jform_dbprefix` should be written in lowercase with hyphens

] SelectorDepth: Selector should have depth of applicability no greater than 3, but was 4
administrator/templates/atum/scss/template-rtl.scss:132:7 [W] NestingDepth: Nesting should be no greater than 3, but was 4

which we can't obviously change.

Properties order can be modified as suggested as well as Prefer single quoted strings

So it is useful locally for what is absolutely necessary (E) before proposing a PR

avatar C-Lodder
C-Lodder - comment - 25 Feb 2020

@infograf768 You can modify the rules, but don't modify them just for the sake of it. Things like the use of !important and nesting level can and should be addressed in several areas.

I'm not sure where you're seeing that the linter is expecting single quotes, but this isn't true. The linter expects double quotes: https://github.com/joomla/joomla-cms/blob/4.0-dev/scss-lint.yml#L399

avatar infograf768
infograf768 - comment - 25 Feb 2020

Just used Terminal on current 4.0-dev.

single quotes example:

administrator/templates/atum/scss/template.scss:5:9 [W] StringQuotes: Prefer single quoted strings

for

@import "variables";
avatar C-Lodder
C-Lodder - comment - 25 Feb 2020

Definitely not correct then. It's probably not reading your scss-lint.yml file
Did you run it from the root directory?

avatar infograf768
infograf768 - comment - 25 Feb 2020

yes

avatar C-Lodder
C-Lodder - comment - 25 Feb 2020

Did you fetch the latest scss-lint.yml (code in this PR) before trying to run the linter?

If so, then try this instead:

scss-lint -c scss-lint.yml administrator/templates/atum/**/*.scss
avatar brianteeman
brianteeman - comment - 25 Feb 2020

I was getting the same issue before about double quotes - there was a clash on my local machine with rulesets because the vscode extension I was using couldnt find the scss-lint.yml file as it was looking for .scss-lint.yml

Now I have removed that extension I get the correct ruleset

avatar C-Lodder
C-Lodder - comment - 25 Feb 2020

Could also rename the file from scss-lint.yml to .scss-lint.yml. The dot prefix may be better suited.

avatar infograf768
infograf768 - comment - 25 Feb 2020

@C-Lodder
that code scss-lint -c scss-lint.yml administrator/templates/atum/**/*.scss gives now

administrator/templates/atum/scss/_variables.scss:60:48 [W] StringQuotes: Prefer double-quoted strings
administrator/templates/atum/scss/_variables.scss:61:48 [W] StringQuotes: Prefer double-quoted strings
administrator/templates/atum/scss/_variables.scss:62:48 [W] StringQuotes: Prefer double-quoted strings
administrator/templates/atum/scss/_variables.scss:63:48 [W] StringQuotes: Prefer double-quoted strings
administrator/templates/atum/scss/_variables.scss:95:60 [W] LeadingZero: `0.16` should be written without a leading zero as `.16`
administrator/templates/atum/scss/_variables.scss:95:91 [W] LeadingZero: `0.23` should be written without a leading zero as `.23`
administrator/templates/atum/scss/_variables.scss:98:74 [W] StringQuotes: Prefer double-quoted strings
administrator/templates/atum/scss/template-rtl.scss:187:1 [W] IdSelector: Avoid using id selectors
administrator/templates/atum/scss/template-rtl.scss:227:3 [W] PropertySortOrder: Properties should be ordered margin-right, margin-left, border-right, border-left
administrator/templates/atum/scss/template-rtl.scss:251:1 [W] IdSelector: Avoid using id selectors
administrator/templates/atum/scss/template-rtl.scss:251:1 [W] IdSelector: Avoid using id selectors
administrator/templates/atum/scss/template-rtl.scss:251:1 [W] IdSelector: Avoid using id selectors
administrator/templates/atum/scss/template-rtl.scss:258:1 [W] IdSelector: Avoid using id selectors
administrator/templates/atum/scss/template-rtl.scss:259:3 [W] PropertySortOrder: Properties should be ordered text-align, direction

so

  success-border:                  theme-color('success'),

gives
administrator/templates/atum/scss/_variables.scss:60:48 [W] StringQuotes: Prefer double-quoted strings

avatar C-Lodder
C-Lodder - comment - 25 Feb 2020

Correct

Probably should be scss-lint -c scss-lint.yml administrator/templates/atum/scss/**/*.scss. My bad. But at least it's now working for you

Add a Comment

Login with GitHub to post a comment