MarkusAmshove / Kluent

Fluent Assertion-Library for Kotlin
https://markusamshove.github.io/Kluent/
MIT License
864 stars 65 forks source link

Consistent file and code formatting #206

Closed javatarz closed 2 years ago

javatarz commented 2 years ago

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.

MarkusAmshove commented 2 years ago

Sounds good, especially the editorconfig ๐Ÿ™‚ Since there are only 2 PRs open at the moment which both seem to be merged soon this would be a good time.

You can set everything up and open a PR, but we should merge it after those two PRs to not add additional burdens to them after they've been reviewed ๐Ÿ˜„ We can then introduce those checks and clean up ๐Ÿงน

javatarz commented 2 years ago

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 ๐Ÿ˜„

javatarz commented 2 years ago

207 has added a .editorconfig, fixed the formatting and made the line endings standardized (LF). Pending item in this issue is to break the pipeline if someone violates this formatting.

MarkusAmshove commented 2 years ago

I've added the topic hacktoberfest to the repository, is that enough? There are multiple topics like hacktoberfest2020 hacktoberfest2021 etc :)

javatarz commented 2 years ago

The documentation says that hacktoberfest should be enough for me to get the contribution but I didn't. Might be because my PR was merged before the tag was available and they have cached it. Can you add hacktoberfest-accepted to #207 itself? Hoping that might work.

javatarz commented 2 years ago

Their website has now been updated, my PR has been accepted! Thanks so much @MarkusAmshove! <3

MarkusAmshove commented 2 years ago

Added with #207 ๐Ÿฅณ