feat: add shfmt pre-commit hooks for bash script formatting - #311
Open
Patrick-Ehimen wants to merge 1 commit into
Open
feat: add shfmt pre-commit hooks for bash script formatting#311Patrick-Ehimen wants to merge 1 commit into
Patrick-Ehimen wants to merge 1 commit into
Conversation
Implements automatic bash script formatting using shfmt with 2-space indentation to maintain consistency across the codebase. Bash scripts are now formatted on commit via lint-staged and can be manually formatted using justfile recipes (bash-check, bash-write). Resolves sablier-labs#246
andreivladbrg
left a comment
Contributor
There was a problem hiding this comment.
thanks for the PR @Patrick-Ehimen
currently, the implementation does not add the pre-commit hook that the issue is referring to
please see here what we are referring to: https://github.com/sablier-labs/lockup/blob/main/.husky/pre-commit
Author
i will take a look at it before eod |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Summary
Implements automatic bash script formatting using shfmt to maintain consistency across the codebase. This PR adds pre-commit hooks that automatically format bash scripts on commit, and provides justfile recipes for manual formatting.
Changes
Added shfmt to lint-staged configuration (
.lintstagedrc.js)*.shfiles on commit with 2-space indentation-sflag to simplify code structureAdded justfile recipes (
justfile)bash-check(alias:bashc) - Check bash script formatting without modifyingbash-write(alias:bashw) - Format bash scriptsfull-checkandfull-writerecipesUpdated documentation (
CONTRIBUTING.md)just full-checkverifiesFormatted existing bash scripts with 2-space indentation
scripts/bash/deploy-programs.sh- Reformatted with consistent 2-space indentationscripts/bash/prepare-artifacts.sh- Added final newlineTest Plan
bash -nsyntax check on both scripts - both validbash-check,bash-write) - work correctlyResolves
Closes #246