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.

Create code style guide/settings

See original GitHub issue

Maybe there already is, but I did not find anything in the GitHub Wiki, the Eclipse Wiki, the CONTRIBUTING.md file or the README.md file.

What are the requirements for code style when submitting changes? And were do I find those?

Maybe it would also be nice to have an Eclipse code formatter settings file, so that I can be applied automatically on each save.

Issue Analytics

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

github_iconTop GitHub Comments

1reaction
amitjoycommented, Jul 15, 2016

According to the Eclipse Code Style as provided in Eclipse IDE, I excerpted few important factors which would be great if followed.

  • Add ‘this’ qualifier to unqualified field accesses
  • Add ‘this’ qualifier to unqualified method accesses
  • Convert control statement bodies to block
  • Convert ‘for’ loops to enhanced ‘for’ loops
  • Add final modifier to private fields
  • Add final modifier to method parameters
  • Add final modifier to local variables
  • Use lambda where possible (Not possible as of now)
  • Put expressions in parentheses
  • Remove unused imports
  • Remove unused local variables
  • Add missing ‘@Override’ annotations
  • Add missing ‘@Override’ annotations to implementations of interface methods
  • Add missing ‘@Deprecated’ annotations
  • Remove unnecessary casts
  • Remove unnecessary ‘$NON-NLS$’ tags
  • Sort all members
  • Remove trailing white spaces on all lines
  • Correct indentation
  • Remove redundant type arguments
  • Add file header
0reactions
MMaierocommented, Oct 1, 2016

I’ve proceeded to the formatting and cleanup operations. During this step I’ve had to slightly modify the formatter to increase the readability of enums. In particular, in ‘enum’ declaration -> constants, I’ve set:

  • Line wrapping to all elements, every element on a new line
  • Force split
  • Default indentation

Due to these changes I’ve submitted the modifications as a PR #584 waiting for feedback and approval to perform the merge.

Read more comments on GitHub >

github_iconTop Results From Across the Web

How to Create a Programming Style Guide | PullRequest Blog
A programming style guide is an guide of programming conventions, style, and best practices that helps a team write code in a consistent ......
Read more >
Google Style Guides | styleguide
Every major open-source project has its own style guide: a set of conventions (sometimes arbitrary) about how to write code for that project....
Read more >
Code-style rule options - .NET - Microsoft Learn
Select Tools > Options > Text Editor > [C# or Basic] > Code Style > General, and then click Generate .editorconfig file from...
Read more >
Code style schemes | IntelliJ IDEA Documentation - JetBrains
Press Ctrl+Alt+S to open the IDE settings and select Editor | Code Style. To configure a scheme for new projects, go to File...
Read more >
Code Style Guidelines - WebKit
All implementation files must #include the primary header second, just after config.h . So for example, Node.cpp should include Node.h first, before other...
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