As a developer, I want to utilize linter tools, so that I can improve code quality.
As a developer, I want to start various linters for python and bash files, so that I have immediate feedback on my code quality.
The dockerized dev system 3dsdev (see docker-compose.yml) provides the following tools to improve the code quality:
The developer can apply the tools to *.sh and *.py files using the doit build tool. doit defines tasks for each tool in /3DScanner/scripts/dodo.py. The dev system defines the following bash alias
alias doit="doit -f /3DScanner/scripts/dodo.py"As a result, invoking doit in a directory always refers to the dodo.py file from the scripts directory.
List all tasks:
doit listChange into a directory, which contains *.sh bash scripts. The developer may run shellcheck and shfmt for bash scripts. In each case, doit recursively traverses the directory and all its subdirectories for all *.sh files and runs the tools on each file.
Run shellcheck
doit shellcheckOutputs the analysis results on stdout.
Run shfmtdiff
doit shfmtdiffOutputs the diff how shfmt will change the script.
Run shfmt
doit shfmtReformats the shell script. It changes the files.
Change into a directory, which contains *.py python files. The developer may run isort and black. In each case, doit recursively traverses the directory and all its subdirectories for all *.py files and runs the tools on each file.
Run isortdiff
doit isortdiffOutputs the diff how isort will change the files.
Run isort
doit isortReformats the imports in the python files. It changes the files.
Run blackdiff
doit blackdiffOutputs the diff how black will changes the files.
Run black
doit blackRuns the black code formatter. It changes the files.