Skip to content

Commit

Permalink
fixes invalid rule from hyphen
Browse files Browse the repository at this point in the history
  • Loading branch information
ekohilas committed May 21, 2024
1 parent 403f0dc commit 9db1193
Showing 1 changed file with 2 additions and 1 deletion.
3 changes: 2 additions & 1 deletion scripts/add_rule.py
Original file line number Diff line number Diff line change
Expand Up @@ -137,7 +137,8 @@ def main(*, name: str, prefix: str, code: str, linter: str) -> None:
lines.append(line)

variant = pascal_case(linter)
rule = f"""rules::{linter.split(" ")[0]}::rules::{name}"""
linter_name = linter.split(" ")[0].replace("-", "_")
rule = f"""rules::{linter_name}::rules::{name}"""
lines.append(
" " * 8 + f"""({variant}, "{code}") => (RuleGroup::Preview, {rule}),\n""",
)
Expand Down

0 comments on commit 9db1193

Please sign in to comment.