Skip to content

Make shell scripts more robust by following advice from the Shellcheck linter.

License

Notifications You must be signed in to change notification settings

Tahler/shellfix

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

41 Commits
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

Shellfix

Make shell scripts more robust by following advice from the Shellcheck linter.

Automatically fixes:

Running

  1. Install Shellcheck.
  2. Run find . -name '*.sh' | xargs /path/to/main.py.

Implementation

This program uses a naive approach of rewriting the file for each rule.

It does, however, take advantage of the fact that rules can appear in cascading fashion. For example, with the expression x=$(ls), SC2034 suggests exporting the variable. However, after the fix (now export x=$(ls)), on a second run it'll suggest declaring and assigning separately SC2155. Fixing rules iteratively in the same respective order avoids this issue.

About

Make shell scripts more robust by following advice from the Shellcheck linter.

Topics

Resources

License

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published

Languages