cothority icon indicating copy to clipboard operation
cothority copied to clipboard

Add line-length check to Travis

Open ineiti opened this issue 5 years ago • 4 comments

Respecting the line-length in the code (80 characters) should be done in a travis-check.

ineiti avatar Sep 21 '19 13:09 ineiti

Also, could this be something like 110-130 ? 80 is from the old days .. or is it better for the emacs guys ?

Gilthoniel avatar Sep 23 '19 08:09 Gilthoniel

Also, could this be something like 110-130 ? 80 is from the old days .. or is it better for the emacs guys ?

At the end this is matter of taste, but I find 80 chars to have several (but arguable) benefits:

  • Makes the code easier to read without needing to move your eyes horizontally
  • Helps keeping a code simple and better reveals code smells (if your function needs 3 lines for its arguments declaration then maybe it should be refactored)
  • Allows to keep multiple files opened side-by-side on the same window
  • Is a well established standard

but yes, 80 chars feels sometimes frustrating, Python eventually took me on this one...

nkcr avatar Sep 23 '19 09:09 nkcr

I think the limit originally was Bryan's (strong) suggestion ;)

I would never call for a revolution, of course...

ineiti avatar Sep 23 '19 15:09 ineiti

What about adding a code-quality check like https://www.codacy.com ?

nkcr avatar Oct 24 '19 09:10 nkcr