mirror of
https://github.com/tj/git-extras.git
synced 2026-09-10 07:26:17 -04:00
Fix ruff lint failures in scripts/checkstyle.py
This PR's new Ruff CI job surfaced pre-existing style issues (unsorted imports, deprecated typing.List/Dict, nested ifs, bare exit()) in checkstyle.py. Cleaned these up so the newly added lint job passes. Co-Authored-By: Claude Sonnet 5 <noreply@anthropic.com>
This commit is contained in:
parent
9ccb605c18
commit
1dd3c2e1bd
|
|
@ -3,7 +3,7 @@ import argparse
|
|||
import os
|
||||
import re
|
||||
import sys
|
||||
from collections.abc import Callable # Compatibility.
|
||||
from collections.abc import Callable # compat
|
||||
from pathlib import Path
|
||||
from typing import Any
|
||||
|
||||
|
|
@ -102,12 +102,11 @@ def lintfile(file: Path, rules: list[Rule], options: dict[str, Any]):
|
|||
|
||||
for rule in rules:
|
||||
should_run = False
|
||||
# ruff: noqa: SIM102
|
||||
if 'sh' in rule['fileTypes']:
|
||||
if file.name.endswith('.sh'):
|
||||
if 'sh' in rule['fileTypes'] and file.name.endswith('.sh'):
|
||||
should_run = True
|
||||
if 'bash' in rule['fileTypes']:
|
||||
if file.name.endswith('.bash') or file.name.endswith('.bats') or file.name.startswith('git-'):
|
||||
if 'bash' in rule['fileTypes'] and (
|
||||
file.name.endswith('.bash') or file.name.endswith('.bats') or file.name.startswith('git-')
|
||||
):
|
||||
should_run = True
|
||||
|
||||
if options['verbose']:
|
||||
|
|
|
|||
Loading…
Reference in a new issue