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

Add maven shell script formatting support via shfmt #1998

Conversation

tcrawford-figure
Copy link
Contributor

@tcrawford-figure tcrawford-figure commented Jan 15, 2024

This adds Maven support for shfmt and addresses #1567. This is a follow up to #1994. Closes #1567 #1776


import com.diffplug.spotless.maven.MavenIntegrationHarness;

@Disabled // Disabled due to GHA not having shfmt
Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Please let me know if I missed some detail that enables these types of formatters (ones that need to shell out) to run in GitHub action workflows. I'd be happy to add whatever is needed to get this to run in GHA.

Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I replaced @Disabled with @ShfmtTest. If you run gradlew test these tests will not run. They only run when you run ./gradlew testShfmt to run them.

If you want them to run on CI, you should add them with the npm test

- name: test npm
if: matrix.kind == 'npm'
run: ./gradlew testNpm

  • change it to ./gradlew testNpm testShfmt

The only tricky part is getting shfmt onto the CI runner. Not that hard though. Feel free to open a PR for it and mess around.

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Perfect! Thank you for the clarification.

@tcrawford-figure tcrawford-figure changed the title Add maven shell script formattings support via shfmt Add maven shell script formatting support via shfmt Jan 15, 2024
@tcrawford-figure tcrawford-figure marked this pull request as ready for review January 15, 2024 16:22
@Goooler Goooler requested a review from nedtwigg January 16, 2024 02:24
@nedtwigg nedtwigg merged commit 409902d into diffplug:main Jan 17, 2024
13 checks passed
@tcrawford-figure tcrawford-figure deleted the tylercrawford/issue-1567/support-sh-bash-maven branch January 17, 2024 13:46
@nedtwigg
Copy link
Member

Published in plugin-maven 2.43.0.

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 this pull request may close these issues.

Add shfmt for sh and bash scripts
3 participants