Add scss-lint#976
Conversation
There was a problem hiding this comment.
Our styleguide technically states that selectors less the 5 characters can be on one line, I'm not sure if we can configure the linter for this though.
There was a problem hiding this comment.
Hmm, just looked into it, unfortunately scss-lint doesn't offer this config option. How deep should I shave this yak? I could open a PR there too to add an option...
There was a problem hiding this comment.
But at the very least we should add this to shortcomings on https://pages.18f.gov/frontend/css-coding-styleguide/#shortcomings
There was a problem hiding this comment.
@msecret can you remind me what was the convention with mixed short and long selectors?
There was a problem hiding this comment.
Done, 18F/frontend#90. We should also think about changing the convention in the styleguide.
There was a problem hiding this comment.
@msecret sweet, should I revert this change and disable the SingleLinePerSelector linter, or...?
There was a problem hiding this comment.
@nickjs lets keep it for now, I'd prefer to have all selectors on new lines then none.
|
@nickjs, just to check; is the linting also being run on the files in |
|
@msecret No, sorry, to be clear there are still a tonnnn of linter warnings all across the repo. I just concentrated on |
|
Would it be possible to have Also, @nickjs, there are two big issues landing in the next release. These issues are #975 and #974. The latter issue will refactor a lot of the project and separate code from the site and the actual library. The former issue is one I'll be working on, and I'd like to have these changes integrated into that PR. For now we can leave this PR open to discuss this more, but eventually we can work in tandem to get these changes in once those two issues are closer to being resolved. |
|
@rogeruiz Just pushed a change to the scss-lint config to only run on Because of the Jekyll front matter thing I mentioned above, you still need to manually lint So, has any work started on either of those issues? Super excited especially for #974, but if not, I'd recommend merging this now. It adds scss-lint without any side effects since it's not integrated into the automated release process. It will be a lot easier for you later on to just add the existing scss-lint to the build mechanism than it would be to add a whole new tool. Plus, if code is eventually going to get refactored, this PR will eventually just be one big merge conflict, so better to merge it in now, no? I'm not gonna be mad if |
Our guidelines say that each selector should be on a new line unless it's less then 5 characters. This cannot currently be enforced with scss-lint. See uswds/uswds#976 (comment) for reference.
|
I'd be fine adding this now, it's a good start. We could also set the config to lint |
|
I can commit to cleaning up at least 100 warnings if we merge this ;) |
|
Good idea, let's merge this in. Should we include any documentation on this On Mon, Feb 1, 2016 at 3:52 PM, Marco Segreto notifications@github.com
Roger Steve Ruiz |
|
@msecret already added the config option to lint @rogeruiz just updated the README with linting instructions. Good call. Totally up to you guys if you want to enable Hound, though still probably good to do a pass at removing as many warnings as possible first. |
4aad7e1 to
5280055
Compare
|
@maya thanks, fixed. |
|
This is awesome work! I'd like us to include this too. Can you clarify what file(s) we have to remove frontmatter from in order to run scss-lint? As a side note, we didn't spend a lot of time refactoring the styleguide.scss bc it wasn't part of our distributed code, but thanks for the improvements! |
|
@maya actually I think the only files I can find that have it that we would care about would be I figured, and I figured the code could change at any point, so I didn't spend too much time on it aside from getting it to (mostly) lint (the exception being the SelectorDepth and NestingDepth warnings). |
|
|
|
So I think we should commit this change as is, ensuring that assets/_scss is linted. From here we'll add HoundCI at some point to move out codebase closer to consistency. @nickjs, if you'd like to take a crack at fixing a bunch of the errors, we'd be very thankful. Maybe that can go in another PR |
|
Hey @nickjs. This looks great! Thanks for taking the time to add Thanks again! 🚀 🎸 |
|
@nickjs now that this is merged, we're gonna hold you to those 💯 warnings. Just kidding 😉 Thanks again for the awesome work! ⚡ |
@maya @mbland
Things
.scss-lint.ymlconfig filestyleguide.scss$color-blackIssues
styleguide.scss. This would require refactoring a bunch of the code to be less nestedscss-lint, you need to remove the--- ---from the top of the scss file. See the issue here: front matter in scss is causing grief with scss-lint task jekyll/jekyll#3408Notes