Exit Codes
FSH Lint uses specific exit codes to indicate different outcomes.
Exit Code Reference
Section titled “Exit Code Reference”0 - Success
Section titled “0 - Success”No errors found. May contain warnings or hints.
maki lint file.fshecho $? # 01 - Lint Errors
Section titled “1 - Lint Errors”Lint errors were found in the files.
maki lint invalid.fshecho $? # 12 - Invalid Configuration
Section titled “2 - Invalid Configuration”Configuration file is invalid or malformed.
maki lint --config invalid.json *.fshecho $? # 23 - File Not Found
Section titled “3 - File Not Found”Specified files or directories not found.
maki lint nonexistent.fshecho $? # 34 - Invalid Arguments
Section titled “4 - Invalid Arguments”Invalid command-line arguments provided.
maki lint --unknown-flag *.fshecho $? # 45 - Internal Error
Section titled “5 - Internal Error”An internal error occurred.
# Should not happen in normal useecho $? # 5CI/CD Integration
Section titled “CI/CD Integration”Use exit codes in CI/CD pipelines:
GitHub Actions
Section titled “GitHub Actions”- name: Lint FSH files run: | maki lint **/*.fsh if [ $? -eq 1 ]; then echo "Lint errors found" exit 1 fiGitLab CI
Section titled “GitLab CI”lint: script: - maki lint **/*.fsh allow_failure: falseJenkins
Section titled “Jenkins”stage('Lint') { steps { sh ''' maki lint **/*.fsh EXIT_CODE=$? if [ $EXIT_CODE -ne 0 ]; then echo "Linting failed with code $EXIT_CODE" exit $EXIT_CODE fi ''' }}Warning-Only Mode
Section titled “Warning-Only Mode”Treat warnings as errors for stricter CI:
maki lint --severity warn **/*.fshThis will exit with code 1 if any warnings are found.
Ignoring Specific Exit Codes
Section titled “Ignoring Specific Exit Codes”Continue on warnings but fail on errors:
maki lint **/*.fsh || [ $? -eq 0 -o $? -eq 1 ] && echo "OK"