-
Notifications
You must be signed in to change notification settings - Fork 394
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
define the spaces/tabs policies and create checks. #1315
Comments
@mvshmakov what bothers me here is that we already have
in the https://github.com/iterative/dvc.org/blob/master/.prettierrc and we do run it on a pre-commit hook that is installed when you run I think the only place we allow spaces are code blocks. And probably prettier ignores them (and rightfully so). It feels there is some overlap between your editor settings and our |
@shcheklein I guess I have found the issue. I use Visual Studio Code with custom config, which you can see here: https://pastebin.com/qEjpgKsV. It has a section We also can force this rule this way if it is necessary: prettier/prettier#5019 (comment). |
I think both VSC and Prettier let tabs in code blocks alone. There's 53 instances of this in content/docs right now. If there's a way to enforce tab->space with Prettier then I would support the no-tab policy. Otherwise I vote actually to use tabs in sample output. Maybe I'm not getting why that is a problem? |
@jorgeorpinel I think it's already enforced in our settings? ( |
OK, so my point is if Prettier and IDEs ignore tabs in code blocks (which makes sense) trying to enforce this will be difficult and for starters I don't see why it's desirable. If anything having tabs in sample output is in a way more realistic, as that's what |
I generally prefer to create an .editorconfig file. Since Prettier also uses this file, that allows |
Thanks @noahbrenner but I think still Prettier and IDEs will ignore tabls in Markdown code blocks, regardless of how the policy is configured. |
@jorgeorpinel That makes sense. It wouldn't fix existing codeblocks, but I'd expect that an |
I'm guessing we are OK to close this since there have been no other comments in a long time, but lmk if you have additional thoughts please. Thanks! |
There is a mixture of tabs/spaces in the repo. It would be better if there is only one unified standard for all of the codebase/documentation. In addition, it is a good practice to introduce some CI/pre-commit checks considering this convention.
The issue was revealed in this PR: #1305
The text was updated successfully, but these errors were encountered: