-
-
Notifications
You must be signed in to change notification settings - Fork 5.5k
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
Enforce tab indentation in templates #15289
Conversation
f6850d6
to
f4865a7
Compare
Note, the checker module is actually https://github.com/editorconfig-checker/editorconfig-checker.javascript which is a JS wrapper around the golang tool, for ease of installation using npm. |
This adds editorconfig-checker [1] to lint the template files so they conform the editorconfig files. I fixed all current identation issues using the fix mode of eclint [2] and some manual corrections. We can extend this linting to other files later, for now I'd like this PR to focus on HTML template files only. [1] https://github.com/editorconfig-checker/editorconfig-checker [2] https://github.com/jedmao/eclint
Rebased Diff is best viewed with whitespace disabled: https://github.com/go-gitea/gitea/pull/15289/files?diff=unified&w=1 |
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.
I'd like to have this for sooo long :D - thanks
@silverwind one thing missing: templates/repo/issue/milestones.tmpl:
17: Wrong indentation type(spaces instead of tabs) |
And it swiftly caught a rebase error of mine, fixed. |
this hopefully let us prevent issues like: #14719, ... |
It does only lint the intendation, imbalanced tags are still possible and I'm looking for a linter that can detect these. Maybe https://github.com/ember-template-lint/ember-template-lint. |
@silverwind what command did you use for auto-fix the templates, I'll need this to resolve conflicts in other pulls :) |
Be aware it does not fix all cases. Also see https://github.com/jedmao/eclint#cli |
This adds editorconfig-checker [1] to lint the template files so they conform the editorconfig files. I fixed all current identation issues using the fix mode of eclint [2] and some manual corrections.
We can extend this linting to other files later, for now I'd like this PR to focus on HTML template files only.
[1] https://github.com/editorconfig-checker/editorconfig-checker
[2] https://github.com/jedmao/eclint