ipfs-shipyard/py-ipfs-http-client

Text editor sanity

dokterbob opened this issue · 1 comments

I am not going be subtle about this. Please Convert your tabs to spaces. Remove trailing whitespace.

It is really a royal pain in the behind to have to manually fix whitespace differences in GIT and it is making in needlessly annoying for people to contribute.

The code here is quite nice, it is a real pity that these basic standards such as tabs vs. spaces and trailing newlines are not adhered to.

My suggestions:

  1. Automatically convert tabs to spaces recursively, e.g. with https://gist.github.com/antivanov/59e00f6129725e9b4404
  2. Similarly, remove trailing whitespace https://gist.github.com/dpaluy/3690668 or https://git-scm.com/docs/git-stripspace
  3. Add an editorconfig to make sure these standards are automatically adhered to. https://editorconfig.org/
  4. Never worry about this again. Ever.

Thanks! :D

General notes about tabs: IMHO tabs are quite superior in that they make it possible to choose a suitable amount of indentation based on individual and context-specific needs: It's very convenient for me to use 2 spaces-per-tab in the diff viewer when merging while using 3 or 4 spaces-per-tab for regular editing. For JavaScript I know that its common to use 2 spaces-per-tab there and its just to easy for me to lose track of indentation levels when quickly reading over longer sections of source code – had they just used tabs, that would have been a non-issue. Glad Python at least went with 4 spaces-per-tab instead.
(All the practical things aside, tabs are also the semantically right thing to use for indentation.)

It is really a royal pain in the behind to have to manually fix whitespace differences in GIT

Running tox -e codestyle should tell you about before commit, but it's not that easy to find I suppose.

Add an editorconfig to make sure these standards are automatically adhered to. https://editorconfig.org/

The repo also has an EditorConfig already, so your editor should have figured it out automatically. 😉

I'll think about the trailing whitespace thing though… (It's convenient for me but not overly so and I get why it would piss many people off.)