executable_has_shebang
Every file with +x set must begin with #!. Catches plain text files accidentally marked executable.
Options
Section titled "Options"This rule takes no kind-specific options.
Plus the common paths, level, id, when, scope_filter, and expect_matches fields. This table is generated from the JSON Schema; option types and defaults are authoritative.
Example
Section titled "Example"An executable script missing its shebang
Section titled "An executable script missing its shebang"The rule fires on this repository:
- README.md✓
- scripts/
- scripts/run(executable)
✗ error exec-shebang
executable file has no shebang (#!)
# demoecho hiWith this .alint.yml:
version: 1rules: - id: exec-shebang kind: executable_has_shebang paths: "scripts/**" level: erroralint check reports:
--- scripts/run ---------------------------------------------------------------- x error exec-shebang executable file has no shebang (#!)
Summary (1 violation): x 1 error 0 passing * 1 failingAn executable script that has its shebang
Section titled "An executable script that has its shebang"This repository is compliant:
- README.md✓
- scripts/
- scripts/hello.sh(executable)✓
# demo#!/bin/shecho hiWith this .alint.yml:
version: 1rules: - id: exec-shebang kind: executable_has_shebang paths: "scripts/**" level: erroralint check reports:
v All 1 rule(s) passed.