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

License header ignores skip lines when using git history #2316

Closed
4 of 6 tasks
trajano opened this issue Oct 25, 2024 · 1 comment
Closed
4 of 6 tasks

License header ignores skip lines when using git history #2316

trajano opened this issue Oct 25, 2024 · 1 comment

Comments

@trajano
Copy link

trajano commented Oct 25, 2024

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

  • summary of problem

-DspotlessSetLicenseHeaderYearsFromGitHistory=true with maven spotless:apply

<shell>
                  <includes>
                    <include>**/*.sh</include>
                  </includes>
                  <excludes>
                    <exclude>**/node_modules/**</exclude>
                  </excludes>
                  <trimTrailingWhitespace/>
                  <endWithNewline/>
                  <licenseHeader>
                    <content># (c)$YEAR XXX</content>
                    <skipLinesMatching>^#!/.+?$</skipLinesMatching>
                    <delimiter>[\n]|set</delimiter>
                  </licenseHeader>
</shell>

Given an existing file with

#!/bin/sh
# (c) 2024 XXXX
set -e

updating the file with the retroactive dates drops the shebang

# (c) 2000-2024 XXXX
set -e
  • Gradle or Maven version
    maven

  • spotless version
    2.43.0

  • operating system and version
    windows

  • 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.

@nedtwigg
Copy link
Member

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

No branches or pull requests

2 participants