question-mark
Stuck on an issue?

Lightrun Answers was designed to reduce the constant googling that comes with debugging 3rd party libraries. It collects links to all the places you might be looking at while hunting down a tough bug.

And, if you’re still stuck at the end, we’re happy to hop on a call to see how we can help out.

About coding style

See original GitHub issue

I read .github/CONTRIBUTING.md and https://github.com/graphhopper/graphhopper/issues/770, and it states that the line width is required to be 100 chars.

However, this requirement is largely violated in the current code base.

I run CheckStyle with LineLength as 100 and there are 1056 violations It seems that 120-char is more accepted. (running CheckStyle with LineLength as 120 reduces #violations to 353).

A more general question is "shall we use CheckStyle or something alike to enforce the code style as a part of integration testing? Relying on the description in CONTRIBUTING.md seems not very effective.

btw, I see the use of CheckStyle being commented out in the current pom.xml. Is there a reason that we intentionally try to avoid CheckStyle?

Thanks!

Issue Analytics

  • State:closed
  • Created 6 years ago
  • Comments:7 (6 by maintainers)

github_iconTop GitHub Comments

1reaction
easbarcommented, Sep 16, 2017

I added a basic checkstyle & findbugs configuration here: https://github.com/ammagamma/graphhopper/tree/issue_1109 Right now there are 361 checkstyle violations (it only checks for the line length to be 120 at the moment). Findbugs finds 5 bugs with severity 7 or lower (lower means more severe) and for demonstration I configured findbugs-exclude.xml to exclude some of them. Rules can be excluded by rule type or only for certain classes/methods etc. Both tools are configured so they run in the maven integration-test phase and fail the build if there are any violations. Right now we can make mvn install run successfully for example if we adjust the line length limit to 500 (yes there are some very long lines) and if we set the maxRank configuration of the findbugs maven plugin to 4 (which means it only checks for the ‘scariest’ bugs). To use more strict settings some of the current code needs to be adjusted…

0reactions
karussellcommented, Apr 9, 2018

This is now integrated although I don’t find the checkstyle plugin too useful at the moment. Have not adapted the contributing guide, so over time we should migrate to the 100 columns but accept more like 120 for now.

Closing here.

Read more comments on GitHub >

github_iconTop Results From Across the Web

Why Coding Style Matters - Smashing Magazine
Coding style is how your code looks, plain and simple. ... Coding style is extremely personal and everyone has their own preferred style....
Read more >
Coding Style - The Modern JavaScript Tutorial
A style guide contains general rules about “how to write” code, e.g. which quotes to use, how many spaces to indent, the maximal...
Read more >
Programming Style – Programming Fundamentals
Programming style is a set of rules or guidelines used when writing the source code for a computer program. Following a particular programming...
Read more >
Coding Standards and Guidelines - GeeksforGeeks
A coding standard gives a uniform appearance to the codes written by different engineers. · It improves readability, and maintainability of the ...
Read more >
Computer Programming/Coding Style - Wikibooks
“Programming style” primarily refers to low-level conventions, such as formatting or choice of language constructs (such as goto or return ), but can...
Read more >

github_iconTop Related Medium Post

No results found

github_iconTop Related StackOverflow Question

No results found

github_iconTroubleshoot Live Code

Lightrun enables developers to add logs, metrics and snapshots to live code - no restarts or redeploys required.
Start Free

github_iconTop Related Reddit Thread

No results found

github_iconTop Related Hackernoon Post

No results found

github_iconTop Related Tweet

No results found

github_iconTop Related Dev.to Post

No results found

github_iconTop Related Hashnode Post

No results found