Skip to content
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

Consistent tab indentation for all source files #2121

Merged
merged 2 commits into from
Dec 8, 2015

Conversation

nanoant
Copy link
Contributor

@nanoant nanoant commented Dec 7, 2015

This is hygiene PR. I have changed semi-automatically indent in all .less and .tmpl files to use tabs, same as for .go files. Also I have indented all .tmpl files consistently:

  1. Indents both HTML containers such as <div>, <p> and Go HTML template blocks such as {{if}} {{with}}
  2. Cleans all trailing white-space
  3. Adds trailing last line-break to each file

This change only changes indention not content, so git blame -w ... still works well (where -w means ignore whitespace).

This may help Gogs opening for more contributors.

This does not change any content and generated gogs.css is still the same.
@unknwon
Copy link
Member

unknwon commented Dec 7, 2015

Hi, thanks your work!

But the diff is too large and GitHub does not allow me to review it and I've spotted some incorrections.

And .go files are not needed for this process as you should always use gofmt.

So why don't we separate it into two steps (PRs), first .less files and them .tmpl files?

@unknwon unknwon added the status: needs feedback Tell me more about it label Dec 7, 2015
@unknwon unknwon added this to the 0.8.0 milestone Dec 7, 2015
@nanoant
Copy link
Contributor Author

nanoant commented Dec 7, 2015

But the diff is too large and GitHub does not allow me to review it and I've spotted some incorrections.

Click on 2 individual commits, 1st for .less, 2nd for .tmpl.

And .go files are not needed for this process as you should always use gofmt.

I didn't touch .go files.

So why don't we separate it into two steps (PRs), first .less files and them .tmpl files?

Both are separated into 2 commits, so changes are independent.

@unknwon
Copy link
Member

unknwon commented Dec 7, 2015

OK... Just to make sure that everything is changed to 1 tab?

@nanoant
Copy link
Contributor Author

nanoant commented Dec 7, 2015

OK... Just to make sure that everything is changed to 1 tab?

Yes, single indent == 1 tab for all .less & .tmpl files.

(I simply followed Go indent that uses tabs, also .editorconfig file suggest that tabs should be used exclusively.)

@nanoant nanoant force-pushed the patch/less-n-template-indent branch 3 times, most recently from 6612c5d to f447f4c Compare December 7, 2015 23:49
This commit improves templates readability, since all of them use consistent
indent with all template command blocks indented too.

1. Indents both HTML containers such as <div>, <p> and Go HTML template blocks
   such as {{if}} {{with}}

2. Cleans all trailing white-space

3. Adds trailing last line-break to each file
@nanoant nanoant force-pushed the patch/less-n-template-indent branch from f447f4c to da2585c Compare December 7, 2015 23:57
@unknwon
Copy link
Member

unknwon commented Dec 8, 2015

Thank you very much!

unknwon added a commit that referenced this pull request Dec 8, 2015
Consistent tab indentation for all source files
@unknwon unknwon merged commit 14080dd into gogs:master Dec 8, 2015
@unknwon unknwon removed the status: needs feedback Tell me more about it label Dec 8, 2015
@github-actions github-actions bot locked as resolved and limited conversation to collaborators Apr 5, 2022
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants