-
Notifications
You must be signed in to change notification settings - Fork 344
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
Make Sass formatting consistent #1013
Conversation
Tip: check "Hide whitespace" when viewing the diff on Github to filter out all indentation-related changes. |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Hmm. I like that this is a step towards cleaning stuff up, but I'm unsure about the use of single quotes; my personal preference being double quotes. Curious about others' thoughts and a consensus.
I like double quotes too. Definitely a bikeshed, but we should pick one and standardize. |
I actually prefer double quotes too, I just chose single to be consistent. Does anyone have complaints about 2-space indentation? I personally prefer 4, but in this case I don't feel strongly in either direction. |
I prefer 2-space indentation for web stuff (fine with 4-space in stuff like Rust) and it's what the default formatter for a lot of the web dev stuff prefers I think. (To the point I feel like I'm constantly having to fight with tooling to keep the 4-space currently in place.) Mainly because html can get far off the page with 4-space, and maybe ditto for complex Sass since it relies on more indentation. |
I personally would skip any discussion about single/double quotes (or similar code formatting stuff) unless we're willing to add tooling (probably not worth it). Without tooling it will eventually just loose consistency again. :-) But, indentation consistency is something we can (probably[0]) achieve easily by just adding an In this PR, I would:
0: I'm quite sure that |
Helix (the primary editor I use) doesn't yet; has open PR for a year now: helix-editor/helix#1777 |
Yeah, I'd be down for a simple linter for these files, but don't feel strongly. I'll leave that decision to the folks with web dev skills. |
Ok, nevermind 😅 If Btw, I was checking what's the most used indentation, and noticed that a lot of changes (and inconsistencies) were introduced in the new book PR (from 4 spaces, to 2 spaces). I personally wouldn't allow arbitrary indentation changes in PRs (looks like some IDE configuration messed few files?). With a linter, at least these huge indentation changes wouldn't happen. For the record, I don't mind 2/4 spaces, single/double quotes… what I just mean is that formatting should be ideally automated, or if that's not possible then linted/enforced. Every other option is fragile. |
Looks like "super-liner" can be configured to enforce |
That's the aforementioned fighting to keep the 4-space indentation. Whenever I write / save a file it will auto format it unless I remember to turn that off every time I open a file. Sorry. |
That can work; at least as a start. |
I switched the Sass files to use double quotes. Additionally, I added a |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
LGTM. I'd be interested in a follow-up PR that does similar things to HTML files since they also suffer from similar indentation issues.
Auto merge may not work; the CI is acting weird with |
Do we need to reverse the name change of the CI job or something in order for CI to work again? This is weird. |
A setting needs to be changed in the repository settings to update which jobs are required. @alice-i-cecile, could you manually merge this? |
I've swapped the |
Part of #975.
This is a PR that formats every single
scss
file to use single quotes and an indentation of 2 spaces. It was done using VSCode's default formatter + find-and-replace. I chose single quotes and 2 spaces because they were the most frequently used style, but I'd be happy to discuss alternatives.This will probably end up introducing a lot of merge conflicts with old PRs, due to how large the changes are.
If a consensus is reached on how Sass files should be formatted, perhaps we can automate checking them using Github Actions in a future PR.