-
Notifications
You must be signed in to change notification settings - Fork 50
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
contribution guidelines #159
base: master
Are you sure you want to change the base?
contribution guidelines #159
Conversation
through trial and error i settled on the there is a the default formatter settings for edit: i meant the package target not publish |
Love the initiative, thanks for your help. Just laying in on a few points:
|
I use IntelliJ IDEA for Java projects, and all my settings are stored In my global settings.
As for the Java formatting the main points I would include are
As for other rules I use most of the ones built into IntelliJ and the SonarLint plugin. Kotlin - I'd rather have normal Java instead |
for a bit of context, I technically only started using Java last month for this project. the last time I used it was like a decade ago and even then not that much. I spend essentially all my time with C++ lets start with the Java version whether or not to upgrade the used Java version is something that should probably be discussed separately for this I was mostly interested in adding a bit of information on why exactly an old Java version is needed to support old Minecraft versions but best I found was this comment about specific spigot versions |
Java IDEs that come to mind are
all of them can be used for free for code formatting we could use the however, in testing there are still some differences between formatting with IntelliJ and VSCode when using a style defined with an eclipse xml see here whether or not the difference can be eliminated requires some more investigation |
Another thing you could add is testing requirements for testing their changes should be tested against the latest normally used Java version (17 currently) and on the latest release of Minecraft for each platform (when multi-platform support is added) java 17 and paper 1.20.4 is how I'm currently testing my changes |
ok, before this auto formatting stuff is driving me insane I will settle on a good enough solution: https://github.com/revelc/formatter-maven-plugin configured to automatically run on compile my other attempts with other IDE plugins always resulted in differences between the IDEs that I could not work out the maven plugin approach ensures 'consistent' formatting between IDEs and can also be used to validate formatting during CI runs one thing I noticed was that all the formatters are keeping custom line breaks, if it does not conflict with other format rules also, newer version of the plugin require jdk versions above 8 see here let me know if this approach is acceptable |
If formatting is going to be a huge pain to do automatically then just a list of formatting rules should suffice. Worse case we may have to fix some of it ourselves before or after merging the PR. |
well, it was only a pain to find something that works across IDEs (I hope that I just did something wrong, doesnt seem like the thing that should be complicated). as for the jdk requirement, that is only for the developers, so that the formatter plugin can run. |
# resolved conflicts: README.md
for the style guide there are two options, writing a new one or using an existing one from the ones I looked at I liked the (old?)twitter one here |
to continue with this i need a few decisions from you on the remaining points
|
formattingI'm fine with it being manual. style guideEither option is fine but we may want to take an existing one and modify it to fit our needs as that would be easier than making our own from scratch. java version
kotliinWith everything being so far in pure Java I'd rather keep it that way. AuthenticatorIt should but I don't have anything to put there as I focus on the plugin |
i used the (old?)twitter styleguide as a base (as mentionend earlier) at this point you would need to read through the whole thing (styleguide.md) to take note of anything that needs to be changed, added or removed some things that might warrent attention:
i just realized, should i have left the comments as a review? |
100-column limitNo column limit is enforced. For me, it depends on the context and surrounding code as to how long I'll let a line run be-explicit-about-operator-precedenceWhen using more than 2-3 operators in a statement you should add clarifying parenthesis, so that it's clear what you mean. Especially when combining import-orderingImport order doesn't matter, most IDEs will auto-add imports for you. Some will also reorder them like IntelliJ does when you run Optimize Imports. As long as they are present and contain no duplicate or unnecessary imports it should be fine. clean-up-with-finallyYes, it should. TodosFor bugs or known edge cases, issues should be preferred time-dependenceno equivalent in this project that I can think of writing-testable-codeOnce we have a lot more platform-independent code (maybe after the platform-agnostic rewrite), that's when we should consider adding tests. recommended-readingSince they both are paid, I'd remove them. I've read through the whole guide and I've got no other comments or notes at this time |
this resolves #158 by adding a CONTRIBUTING.md file that briefly explains how to contribute to the project
currently only a draft as it is unfinished