-
Notifications
You must be signed in to change notification settings - Fork 312
Encode contributing.md style guide to .editorconfig
#9515
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
base: master
Are you sure you want to change the base?
Conversation
ij_java_block_comment_add_space = false | ||
ij_java_block_comment_at_first_column = false | ||
ij_java_line_comment_add_space = true | ||
ij_java_line_comment_add_space_on_reformat = false | ||
ij_java_line_comment_at_first_column = false |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
note: Personal take on this, I think comments should be indented by default to the correct context, instead of being at the beginning of the line.
E.g. this
@TaskAction
instrument() {
workQueue().submit(InstrumentAction.class, parameters -> {
-// parameters.buildStartedTime.set(this.invocationDetails.buildStartedTime)
-// parameters.pluginClassPath.from(this.pluginClassPath)
-// parameters.plugins.set(this.plugins)
+ // parameters.buildStartedTime.set(this.invocationDetails.buildStartedTime)
+ // parameters.pluginClassPath.from(this.pluginClassPath)
+ // parameters.plugins.set(this.plugins)
parameters.instrumentingClassPath.setFrom(this.instrumentingClassPath)
parameters.sourceDirectory.set(this.sourceDirectory.asFile)
parameters.targetDirectory.set(this.targetDirectory.asFile)
})
}
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
❔ question: spotless enforces us to move the //
near to the code while the editor puts it at the start of line by default.
Will the editor put it in the right place with this config?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
📝 notes: My preference is having the comment at the start of the line so it really stands out and I find it easier to read during code review... But that's not the project spotless configuration 😢
indent_style=space | ||
indent_size=2 |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
indent_style=space | ||
indent_size=2 | ||
continuation_indent_size=4 | ||
ij_java_class_count_to_use_import_on_demand = 99 |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
note: Using 99
everywhere as some directives in other languages don't go over 100
.editorconfig
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Looking good. Thanks for the improvement!
I haven't tried myself but I guess those settings match the spotless config and do not introduce formatting changes when we ask the editor to reformat, right?
ij_java_block_comment_add_space = false | ||
ij_java_block_comment_at_first_column = false | ||
ij_java_line_comment_add_space = true | ||
ij_java_line_comment_add_space_on_reformat = false | ||
ij_java_line_comment_at_first_column = false |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
❔ question: spotless enforces us to move the //
near to the code while the editor puts it at the start of line by default.
Will the editor put it in the right place with this config?
What Does This Do
The contributing guide describes a few rules to set on each new checkout or after a
git clean -fdx
. Writing those rules in the.editorconfig
should make the IDE aware of them by default without having to configure anything.Those are IJ specific (leveraging IJ
.editorconfig
integration), as I don't think other IDE / text editors support these.Motivation
Ease of setup.
Additional Notes
Contributor Checklist
type:
and (comp:
orinst:
) labels in addition to any usefull labelsclose
,fix
or any linking keywords when referencing an issue.Use
solves
instead, and assign the PR milestone to the issueJira ticket: [PROJ-IDENT]