-
Notifications
You must be signed in to change notification settings - Fork 282
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
.editorconfig and .gitattributes to centralize formatting #3766
Conversation
Signed-off-by: Prabhas Kurapati <[email protected]>
Signed-off-by: Prabhas Kurapati <[email protected]>
@peternied @scrawfor99 @cwperks I wasn't too sure what these files should contain so to start I copied over the editorconfig from the OpenSearch repository and used a java template online for the gitattributes file. I assume these files are comprehensive since the formats of the OpenSearch repository and the opensearch-security repository are the same/similar. Let me know if there's anything I need to include, ty! |
Codecov Report
Additional details and impacted files@@ Coverage Diff @@
## main #3766 +/- ##
==========================================
- Coverage 65.24% 65.24% -0.01%
==========================================
Files 297 297
Lines 21129 21132 +3
Branches 3451 3452 +1
==========================================
+ Hits 13786 13787 +1
- Misses 5643 5646 +3
+ Partials 1700 1699 -1
|
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.
ty @prabhask5 . QQ, how will this be different than checkstyle formatting that is already in place? Can we also ensure that checkstyle formatting and the format provided here are in sync to avoid checkstyle failures.
|
||
# Common build-tool wrapper scripts ('.cmd' versions are handled by 'Common.gitattributes') | ||
mvnw text eol=lf | ||
gradlew text eol=lf |
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.
nit: new line
*.tagx text | ||
*.xml text | ||
|
||
# These files are binary and should be left untouched |
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.
do you expect any such binary files to ever be checked into the repository? if not i'd leave them away
*.war binary | ||
*.jks binary | ||
|
||
# Common build-tool wrapper scripts ('.cmd' versions are handled by 'Common.gitattributes') |
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.
what is Common.gitattributes
?
@@ -0,0 +1,38 @@ | |||
# Java sources |
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.
are these settings actually needed? i'd have expected them to be the default (text
and the correct diff
setting for these common languages). i certainly never had the need to specify them
|
||
# Common build-tool wrapper scripts ('.cmd' versions are handled by 'Common.gitattributes') | ||
mvnw text eol=lf | ||
gradlew text eol=lf |
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.
shouldn't you also have an entry to flag *.bat
or at least gradlew.bat
as text eol=crlf
?
Closing this for inaction. Please open a new PR if you choose to pursue this change further. |
Description
Added .editorconfig and .gitattributes to centralize formatting and git committing
Category (Enhancement, New feature, Bug fix, Test fix, Refactoring, Maintenance, Documentation)
Enhancement
Why these changes are required?
These files are in the main opensearch repository, and it's useful to have these files to have an additional formatting/git commit source of truth
What is the old behavior before changes and new behavior after changes?
N/A
Issues Resolved
Is this a backport? If so, please add backport PR # and/or commits #
No
Testing
N/A
Check List
By submitting this pull request, I confirm that my contribution is made under the terms of the Apache 2.0 license.
For more information on following Developer Certificate of Origin and signing off your commits, please check here.