Skip to content

Commit b42a523

Browse files
lint: prevent CLI flags with underscores (#601)
This is a follow up of 6a49086, with the intention of preventing new flags from being introduced which violate our now unified style. Signed-off-by: Spencer Schrock <sschrock@google.com>
1 parent 6a49086 commit b42a523

1 file changed

Lines changed: 17 additions & 0 deletions

File tree

.github/workflows/lint.yml

Lines changed: 17 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -100,3 +100,20 @@ jobs:
100100
run: hatch fmt --check
101101
env:
102102
RUFF_OUTPUT_FORMAT: github
103+
104+
cli-flag-lint:
105+
runs-on: ubuntu-latest
106+
name: CLI Lint
107+
permissions:
108+
contents: read
109+
steps:
110+
- name: Check out source repository
111+
uses: actions/checkout@8e8c483db84b4bee98b60c0593521ed34d9990e8 # v6.0.1
112+
with:
113+
persist-credentials: false
114+
- name: Check for CLI flags with underscores
115+
run: |
116+
if grep --recursive --line-number --extended-regexp --include="*.py" '"--[a-zA-Z0-9-]+_[a-zA-Z0-9-]+' src; then
117+
echo "::error::Found CLI flags with underscores. Please use dashes."
118+
exit 1
119+
fi

0 commit comments

Comments
 (0)