Skip to content
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

Clang-format style parameter is not used correctly #1267

Closed
4 of 6 tasks
bh-tt opened this issue Aug 1, 2022 · 2 comments · Fixed by #1268
Closed
4 of 6 tasks

Clang-format style parameter is not used correctly #1267

bh-tt opened this issue Aug 1, 2022 · 2 comments · Fixed by #1268

Comments

@bh-tt
Copy link
Contributor

bh-tt commented Aug 1, 2022

If you are submitting a bug, please include the following:

  • summary of problem
  • gradle or maven version
  • spotless version
  • operating system and version
  • copy-paste your full Spotless configuration block(s), and a link to a public git repo that reproduces the problem if possible
  • copy-paste the full content of any console errors emitted by gradlew spotless[Apply/Check] --stacktrace

If you're just submitting a feature request or question, no need for the above.

Summary

Since gradle plugin version 6.9.0 running clang-format (version 11.0.1-2, style chromium, no other configuration) formats files very differently.

Gradle version: 7.4.2
spotless version: gradle 6.9.0, likely affects maven 2.24.0 as well
OS: Linux 5.10.0-16-amd64 amd64, debian 11

Problem is likely some array mangling in #1257 (which I authored). The array created may have equal size to the list instead of being 1 larger as per the docs. Then the next line replaces the --style=<style> parameter with the filename.

I'll do some debugging to find if that is actually the cause and try to push a PR this week.

@bh-tt
Copy link
Contributor Author

bh-tt commented Aug 2, 2022

Found it: the runner.exec call uses the args field instead of the processArgs variable. Should be an easy fix.

@nedtwigg
Copy link
Member

Fixed in plugin-gradle 6.9.1 and plugin-maven 2.24.1.

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 a pull request may close this issue.

2 participants