Skip to content

[POC] editorconfig-maven-plugin: implement IDE agnostic configuration #2321

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

Closed
wants to merge 2 commits into from

Conversation

Pankraz76
Copy link
Contributor

@Pankraz76 Pankraz76 commented May 11, 2025

rival/addition to

assuming maven project dont require spiked line endings like PMD and Check to pass build.

items:

violates insert_final_newline = true

[ERROR] .editorconfig@56,22: Insert lf - violates insert_final_newline = true, reported by org.ec4j.linters.TextLinter
[ERROR] .gitignore@19,7: Insert lf - violates insert_final_newline = true, reported by org.ec4j.linters.TextLinter
[ERROR] .mvn/readme.txt@1,98: Insert lf - violates insert_final_newline = true, reported by org.ec4j.linters.TextLinter
[ERROR] src/graph/ReactorGraph.java@268,2: Insert lf - violates insert_final_newline = true, reported by org.ec4j.linters.TextLinter
[ERROR] src/mdo/common.vm@33,2: Insert lf - violates insert_final_newline = true, reported by org.ec4j.linters.TextLinter
image image

ref:

@Pankraz76 Pankraz76 changed the title [POC] Editorconfig maven plugin [POC] Editorconfig maven plugin: implement IDE agnostic configuration with editorconfig.org May 11, 2025
@Pankraz76 Pankraz76 force-pushed the editorconfig-maven-plugin branch from 17771cd to ff92b84 Compare May 11, 2025 18:50
@Pankraz76 Pankraz76 marked this pull request as ready for review May 11, 2025 18:56
@Pankraz76 Pankraz76 changed the title [POC] Editorconfig maven plugin: implement IDE agnostic configuration with editorconfig.org [POC] editorconfig-maven-plugin: implement IDE agnostic configuration May 11, 2025
.editorconfig Outdated
Comment on lines 17 to 33
root = true

[*]
charset = utf-8
end_of_line = lf
indent_style = space
insert_final_newline = true

[*.java]
ij_continuation_indent_size = 4
ij_java_class_count_to_use_import_on_demand = 999
ij_java_names_count_to_use_import_on_demand = 999
indent_size = 4
max_line_length = 120

[*.xml]
max_line_length = 160
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Which one is not covered by spotless or checkstyle ... do we really need next tool

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

See spiked line endings. So might be yes.

Besides the broken repository file endings, wildcard imports are not covered: therefor breaking the build.

#2300 (comment)

image

[*.java]
ij_continuation_indent_size = 4
ij_java_class_count_to_use_import_on_demand = 999
ij_java_names_count_to_use_import_on_demand = 999
Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

maybe only the imports, as everything else is covered by spot.

Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

imports with asterix are forbidden be checkstyle

Copy link
Contributor Author

@Pankraz76 Pankraz76 May 12, 2025

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

yes but they will still happen. We need out of the box solution follow convention over config. ATM we have to config by hand this is the automat for whole world.

Copy link
Contributor Author

@Pankraz76 Pankraz76 May 12, 2025

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

intellij default is using * when having more then 5 imports. https://en.wikipedia.org/wiki/Convention_over_configuration
we have broken the contract therefore need to fix up again.

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.


[*]
charset = utf-8
end_of_line = lf
Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

could merge without this. Try activating, then you see much files broken. preventing more. ATM dev setup seems broken, as not configured properly: https://dev.to/kevinshu/git-and-normalization-of-line-endings-228j

Suggested change
end_of_line = lf
#end_of_line = lf

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

need rewrite recipe for this

other stuff comes from spot and is kind of DRY only import count is real benefit.
@Pankraz76
Copy link
Contributor Author

#2322

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants