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.

Consistent file and code formatting

See original GitHub issue

Challenges

File formatting

A lot of our code files do not end with a new line like the unix standard requests.

Code formatting

I have noticed inconsistencies such as opening braces being on the same line vs different lines.

Suggested fixes

File formatting

Would it make sense to add an .editorconfig file to this project to consistently format files across most popular IDEs? I’m thinking that the following rules will probably be minimally disruptive

root = true

[*]
end_of_line = lf
insert_final_newline = true
indent_style = space
indent_size = 4

Code formatting

Use the IntelliJ formatter across the project to start off. Check for formatting linters to fail PRs if they are inconsistently formatted and have tooling locally that integrates with gradle so people can get early feedback


@MarkusAmshove: What are your thoughts on this? I can turn around a PR pretty quickly if you like this idea. Please let me know.

Issue Analytics

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

github_iconTop GitHub Comments

1reaction
javatarzcommented, Oct 27, 2021

Sounds like a good plan. I’ll start the setup process. I happen to know both of the contributors and I’ve spoken to them about what’s missing on their PRs. Hopefully, we should have them merged soon.

I’ll keep my PR ready while they are getting theirs merged 😄

0reactions
MarkusAmshovecommented, Oct 31, 2021

Added with #207 🥳

Read more comments on GitHub >

github_iconTop Results From Across the Web

How to Write Better Code: The 3 Levels of Code Consistency
At the next level, and here we assume there to be code from other developers or third parties, consistency means to follow the...
Read more >
Tools for Consistent JavaScript Code Style - Bits and Pieces
Maintaining a consistent code style is not always easy. ... Making sure all files conform to the project's standards can be tedious and...
Read more >
Enforcing a consistent Coding Style across projects and ...
Coding with style is hard. Especially because it is a very personal and opinionated thing – as always when it comes to style....
Read more >
How to enforce a consistent coding style in your projects
#Linters / Roslyn Analyzers. Another useful tool to ensure a consistent coding style is to use a linter. A linter is a tool...
Read more >
Use A Consistent Code Layout · Java for small teams - ncrcoe
Use a Consistent Code Layout Within Each Project. Summary. Agree and enforce a standard code formatting scheme within each codebase.
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