StrategiesΒΆ
git-lint has a couple of phases in which it develops its strategy for what to run:
Load the configuration file. a. On the command line? b. In the base directory as .git-lint? c. In the base directory as .git-lint/config? d. In the user’s home directory as .git-lint? e. In the user’s home directroy as .git-lint/config?
Prune configuration with
-o
or-e
optionsDetermine which files to lint. a. Workspace or staging?
- If staging, record all stashed timestamps for restoration
- From this list:
- All changed files
-b
- All changed files in the current directory and down (default)
- All files in the current directory and down.
-a
- All files in the repository
-a -b
- All changed files
Add files from command line, if any.
Filter based on match criteria in configuration file.
For each file, run the appropriate linter. a. If in delta mode
-d
, only show differences that correspond to user changes. b. Capture failure output and failure status.Reduce failure status to pass/fail
Print resulting messages and exit with failure status (for pre-commit).
If staging, unstage and touch-up files to restore timestamps.