diffplug / diffplug/spotless

Shebang Removal While Adding Copyright Header in Shell Scripts

Open
#2,270 3 comments 0 reactions 0 assignees View on GitHub
bug-unconfirmed
Dominant language
Java
Stars
5.6k
Forks
559
Avg merge
1d 13h
Merged PRs (30d)
34

Description

- [ ] summary of problem
I’m working on a project with shell scripts and trying to add a copyright header that includes the year range from the Git history using the setLicenseHeaderYearsFromGitHistory property.

The issue I’m facing is that the shebang (#!/bin/bash, etc.) is getting removed from the script files in the process. It seems there's something wrong with the code flow
image

- [ ] Gradle or Maven version - Maven 3.8.8
- [ ] spotless version - 2.43.0
- [ ] operating system and version - MacOS 14
- [ ] copy-paste your full Spotless configuration block(s), and a link to a public git repo that reproduces the problem if possible
```xml

com.diffplug.spotless
spotless-maven-plugin
2.43.0

true

false



src/main/java/**/*.java
src/test/java/**/*.java





package




**/*.sh





## Start
#\!/bin/sh


```
- [ ] copy-paste the full content of any console errors emitted by `gradlew spotless[Apply/Check] --stacktrace` - maven plugin

Thanks in advance

Contributor guide

Open the contributing guide

Assessment

This issue has not been assessed yet.

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.