User tests: Successful: Unsuccessful:
Thanks to @C-Lodder this is another attempt at getting the scss linter to play with the hound
Status | New | ⇒ | Pending |
Labels |
Added:
?
|
Category | ⇒ | Unit Tests |
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:
?
|
Let's give it a go. Thanks
any way to test and see if it is running? does hound have logs?
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
If you're on macOS, you should have Ruby pre-installed.
ROOT/Gemfile
and update the version of scss_lint to 0.59.0
gem install scss_lint
scss-lint administrator/templates/atum/**/*.scss
Or you can use a JS linter? Up to you
Make a change to your other PR and it should work.
I don't think you have to merge it hound should run on PR changes
@brianteeman I can't see unless you trigger the build again
Just saw. Not sure why it's not working. The whole PR should fail. Can you try merging 4.0-dev into your branch?
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
Fair enough. It's probably best to lint it all locally then, and once fixed, future PR's can be done by Hound
Yeah - thats what I am going to do
@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?
sorry I cant help you - thats a mac thing
@infograf768 You need to update Ruby 2.4+ or install scss_lint 0.57.1
if you can't update Ruby
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
@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
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";
Definitely not correct then. It's probably not reading your scss-lint.yml
file
Did you run it from the root directory?
yes
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
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
Could also rename the file from scss-lint.yml
to .scss-lint.yml
. The dot prefix may be better suited.
@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
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
@rdeutz I am guessing you have to merge it to see if it works?