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

Trailing whitespace #3

Closed
githubnemo opened this issue Jul 9, 2013 · 8 comments
Closed

Trailing whitespace #3

githubnemo opened this issue Jul 9, 2013 · 8 comments

Comments

@githubnemo
Copy link

Trailing whitespace are a real issue in this project. Nearly every file contains
trailing whitespace, which make it almost impossible to use git add -p
or just view a diff if your editor is configured to strip whitespace automatically.

This project should follow the example of the the Linux code guidelines
and everybody working on this project should use an editor which strips
trailing whitespaces to reduce noise in git and possibly other CVS in the future.

@sness
Copy link
Member

sness commented Jul 9, 2013

Agreed. Trailing whitespaces is also not allowed in the Google C++ Style Guide : http://google-styleguide.googlecode.com/svn/trunk/cppguide.xml

@jleben
Copy link
Contributor

jleben commented Jul 9, 2013

I am ready to go and fix whitespace issue in all the files. This means:

  • consistent indentation style (tab vs. space)
  • no trailing whitespace
  • an empty line at end of file (a line break at end of file)

Since indentation style is also largely inconsistent, I would propose to make it a rule to use space-based indentation. What is your opinion about that?

@sness
Copy link
Member

sness commented Jul 9, 2013

I would prefer space-based indentation. The Google C++ Style guide uses 2 spaces per indentation level, which I think is better than the 4 used by the Linux Kernel code guidelines.

@jleben
Copy link
Contributor

jleben commented Jul 9, 2013

I prefer 4 spaces: screens nowadays are big, and it's easier to read with larger indentation.
But I won't insist the indentation size, as long as there are spaces instead of tabs.

@sness
Copy link
Member

sness commented Jul 9, 2013

4 spaces makes it hard to keep the lines to 80 columns, which I got used to at Google, and is in the Google C++ Style Guide. But this is a religious war and I don't care either, as long as it's consistent.

@jleben
Copy link
Contributor

jleben commented Jul 9, 2013

What about 3? :)

@gtzan
Copy link
Member

gtzan commented Jul 10, 2013

Hi everyone,
a while ago (a couple of years) we had a similar discussion. In the
past
I had always used the default C++ identation mode in Emacs which follows
the GNU coding style guide which is similar to the Linux Kernel (two
spaces).
At the time I was outvoted by developers preferring tabs which one can
customize
to different amounts of spacing depending on your preferences.

I don't have a strong opinion about 4 versus 2 spaces. If I had to choose
I would go for 2. The one rule that I have a strong opinion is that I
prefer:

foo
{
}

to

foo {
}

On 13-07-09 11:09 AM, Jakob Leben wrote:

I am ready to go and fix whitespace issue in all the files. This means:

  • consistent indentation style (tab vs. space)
  • no trailing whitespace
  • an empty line at end of file (a line break at end of file)

Since indentation style is also largely inconsistent, I would propose
to make it a rule to use space-based indentation. What is your opinion
about that?


Reply to this email directly or view it on GitHub
#3 (comment) Bug
from
https://github.com/notifications/beacon/gl3SCDak_9zg4RKSxOWhGz2nFJIQLp6_MmYDfiVU36ECfzZIngDZVQaTR6iQ4M0P.gif

This message has been scanned for viruses and
dangerous content by MailScanner http://www.mailscanner.info/, and is
believed to be clean.

This message has been scanned for viruses and
dangerous content by MailScanner, and is
believed to be clean.

@githubnemo githubnemo mentioned this issue Jul 11, 2013
@jleben
Copy link
Contributor

jleben commented Aug 11, 2013

Whitespace has been fixed.

@jleben jleben closed this as completed Aug 11, 2013
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

4 participants