git setting of line endings are not fetched from gitconfig file in git home folder
Nobody has claimed this yet.
Assessment
- Difficulty
- 3/5
- Estimated time
- 1-2 days
- Newbie friendliness
- 35/100
- Issue type
- Bug
- Clarity
- Needs clarification
- Activity status
- Stale
- Domain
- build-system
Research direction
Reproduce the issue on Windows 11 with Gradle 8.11 and Spotless 6.25 using the configuration shown, comparing C:\Program Files\Git\etc\gitconfig with $HOME/.gitconfig. Check the Kotlin, Groovy, shell, JSON, YAML, Markdown, and text format targets; done means core.autocrlf from the Git home configuration is honored and files retain the expected LF endings.
Written by the indexing model from the issue text.
Description
- summary of problem
My C:\Program Files\Git\etc\gitconfig file has a [core] autocrlf = input setting but this parameter is not defined in $HOME/.gitconfig.
kotlin, kotlinGradle, groovy, shell, json, yaml, format("markdown"), format("text") has a problem with LF line ending and fixes to CRLF. Java is not effected.
If [core] autocrlf = input set in $HOME/.gitconfig, spotless works well. - Gradle or Maven version
Gradle 8.11 - spotless version
6.25 - operating system and version
Win 11 - copy-paste your full Spotless configuration block(s), and a link to a public git repo that reproduces the problem if possible
spotless { java { target("**/*.java") targetExclude(defaultExcludes) googleJavaFormat(libs["google-java-format"].version) .reflowLongStrings() .formatJavadoc(true) targetExclude(defaultExcludes) } kotlin { target("**/*.kt") targetExclude(defaultExcludes) ktfmt(libs["ktfmt"].version).googleStyle() } kotlinGradle { ktfmt(libs["ktfmt"].version).googleStyle() targetExclude(defaultExcludes) } groovy { target("**/*.groovy", "Jenkinsfile", "**/Jenkinsfile.*") targetExclude(defaultExcludes) trimTrailingWhitespace() endWithNewline() } shell { target("**/*.sh", "src/main/sh/**/*") targetExclude(defaultExcludes) localPrettier(libs["prettier"], libs["prettier-sh"]) .config( mapOf( "plugins" to listOf("prettier-plugin-sh"), "parser" to "sh", *prettierDefaults ) ) trimTrailingWhitespace() endWithNewline() } json { target("**/*.json", "**/*.json5") targetExclude(defaultExcludes) localPrettier(libs["prettier"]) .config(mapOf(*prettierDefaults)) } yaml { target("**/*.yaml", "**/*.yml") targetExclude(defaultExcludes) localPrettier(libs["prettier"]) .config(mapOf(*prettierDefaults)) } format("markdown") { target("**/*.md") targetExclude(defaultExcludes) localPrettier(libs["prettier"]) .config(mapOf(*prettierDefaults)) } format("text") { target( "**/.gitattributes", "**/.gitignore", "**/.npmrc", "**/.sdkmanrc", "**/*.properties", "Dockerfile", "**/*.txt", "**/*.config" ) targetExclude(defaultExcludes) trimTrailingWhitespace() endWithNewline() indentWithSpaces(2) } }
- Dominant language
- Java
- Stars
- 5.7k
- Forks
- 560
- Avg merge
- 1d 13h
- Merged PRs (30d)
- 43
Contributor guide
First steps
- Read the whole issue, then the project's contributing guide.
- Comment on the issue to say you are picking it up — it saves two people doing the same work.
- Fork the repository and make your change on a branch.
- Open a pull request that references the issue number.
More from diffplug/spotless
-
Difficulty 5/5 Over a week Newbie friendliness 15/100
-
Difficulty 5/5 Over a week Newbie friendliness 35/100
-
Difficulty 3/5 1-2 days Newbie friendliness 66/100
-
Difficulty 3/5 1-2 days Newbie friendliness 68/100
-
Difficulty 4/5 3-5 days Newbie friendliness 52/100
All issues in diffplug/spotless
Similar issues
-
Difficulty 2/5 1-3 hours Newbie friendliness 65/100
-
Difficulty 1/5 Under an hour Newbie friendliness 88/100
checkstyle/test-configs#263 ·
-
bug
Difficulty 1/5 Under an hour Newbie friendliness 90/100
apache/cloudstack#14222 ·
-
[BUG]茶杯方块在取茶时会引发崩溃 Open
Difficulty 2/5 1-3 hours Newbie friendliness 88/100
-
1.0.0-alpha2 Type/Improvement
Difficulty 2/5 1-3 hours Newbie friendliness 68/100
wso2/dpdp-accelerator#272 ·