-
Notifications
You must be signed in to change notification settings - Fork 1
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Configure SCSS linter #23
Comments
I can adjust the style guide for SCSS, but I have questions about which rules do you prefer. I wanted to tell them from https://github.com/metanorma/metanorma-ogc/blob/7100b9c0c2ce203d798de36ef106787558e928de/lib/isodoc/ogc/html/ogc.scss, but there are few style inconsistencies there, possibly legacy ones, hence it was impossible. Alternatively, SCSS style checker can be easily disabled project-wide or organization-wide by adding following to respective scss:
enabled: false But given the fact that there are formatting inconsistencies in e.g. https://github.com/metanorma/metanorma-ogc/blob/7100b9c0c2ce203d798de36ef106787558e928de/lib/isodoc/ogc/html/ogc.scss, perhaps it should stay on. Anyway, here are things I need to know if we're going to use this linter. The list seems long, but questions are simple and answers easy to make, hopefully. It is all entirely up to you and your aesthetic and practical preferences. For any of these we may adopt particular style or disable respective checks. 1. Class namingI guess CamelCase, right? Are there any exceptions, for example there: https://github.com/metanorma/metanorma-ogc/blob/7100b9c0c2ce203d798de36ef106787558e928de/lib/isodoc/ogc/html/ogc.scss#L646-L649? And what about naming convention for mixins? 2. IndentationTabs or spaces? How many of them? 3. Where to put opening and closing curly brackets?.coverpage_docstage
{text-align:center;
font-size:30.0pt;
color:#2e81c2;} vs .coverpage_docstage {
text-align:center;
font-size:30.0pt;
color:#2e81c2;
} vs any combination of these? 4. Should colon be followed with a white space?margin-right: 36.0pt; vs margin-right:36.0pt; 5. MetricsHound warns if there are more than 10 properties set within a rule. Does this limit make any sense for you? It is violated many times, e.g. here: https://github.com/metanorma/metanorma-ogc/blob/7100b9c0c2ce203d798de36ef106787558e928de/lib/isodoc/ogc/html/ogc.scss#L211-L234. If the answer is "yes, with exception of this project", then perhaps we can think of some overrides. 6. Avoiding fractional part in measurementsHound says:
Do you agree? QualifyingElement: Avoid qualifying class selectors with an element. 7. Class selectors with element nameHound says:
This is about selectors like this one:
Given the fact that you use it quite extensively, should I turned if off?
8. Inline color literalsAt line https://github.com/metanorma/metanorma-ogc/blob/7100b9c0c2ce203d798de36ef106787558e928de/lib/isodoc/ogc/html/ogc.scss#L666 Hound says:
Do you agree? 9. Leading zeroesHound says:
Do you agree? 10. Spacing between rulesHound says:
Do you agree? 11. URL formatHound says:
Do you agree? |
@opoudjis Any opinion on that, or should I use my own favourite settings? ;) The above post seems long, nevertheless there's not much thinking in it. Especially that "disable this check" is also a good answer sometimes. |
Ping @abunashir @strogonoff thoughts? |
I have zero opinion on CSS. @strogonoff OTOH has definite opinions, and I defer to him. |
Agree. Ping @strogonoff |
Investigate code style issues in metanorma/metanorma-ogc#70, and prepare some good style book for SASS.
The text was updated successfully, but these errors were encountered: