From f6edf6aecdb6397156cff93d27323a94a135c39d Mon Sep 17 00:00:00 2001 From: "dependabot[bot]" <49699333+dependabot[bot]@users.noreply.github.com> Date: Wed, 14 Oct 2026 16:05:57 +0000 Subject: [PATCH 1/2] chore(deps): bump super-linter/super-linter from 8.7.0 to 9.0.0 Bumps [super-linter/super-linter](https://github.com/super-linter/super-linter) from 8.7.0 to 9.0.0. - [Release notes](https://github.com/super-linter/super-linter/releases) - [Changelog](https://github.com/super-linter/super-linter/blob/main/CHANGELOG.md) - [Commits](https://github.com/super-linter/super-linter/compare/4ce20838b8ab83717e78138c5b3a1407148e0918...2da136927bd4a73596db63044b504547c62cb854) --- updated-dependencies: - dependency-name: super-linter/super-linter dependency-version: 9.0.0 dependency-type: direct:production update-type: version-update:semver-major ... Signed-off-by: dependabot[bot] --- .github/workflows/super-linter.yaml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/.github/workflows/super-linter.yaml b/.github/workflows/super-linter.yaml index ad12004..477e73e 100644 --- a/.github/workflows/super-linter.yaml +++ b/.github/workflows/super-linter.yaml @@ -41,7 +41,7 @@ jobs: - name: Install dependencies run: uv sync --frozen - name: Lint Code Base - uses: super-linter/super-linter@4ce20838b8ab83717e78138c5b3a1407148e0918 # v8.7.0 + uses: super-linter/super-linter@2da136927bd4a73596db63044b504547c62cb854 # v9.0.0 env: DEFAULT_BRANCH: main GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }} From cd16ba6c523c3686245a5e9a801f34c7462ca3bb Mon Sep 17 00:00:00 2001 From: jmeridth Date: Wed, 14 Oct 2026 12:11:50 -0500 Subject: [PATCH 2/2] fix(lint): satisfy hadolint 2.15 and ruff 0.16 from super-linter v9 ## What/Why super-linter v9 ships ruff 0.16.8 and hadolint 2.15.1, which flag 6 ruff and 1 hadolint violation. This fixes them and teaches isort our first-party modules so it agrees with ruff on import order. ## Proof it works ruff 0.16.8 with the super-linter v9 template config reproduces all 6 errors on the old code and passes on this commit. hadolint 2.15.1 passes. make lint (flake8, isort, pylint 10.00, mypy, black) passes. make test: 73 passed, 100% coverage. ## Risk Low. Import reordering, lint suppressions, and behavior-preserving rewrites. The healthcheck now uses exec form, which is fine because it uses no shell features. ## AI role Generated by Claude Opus 5.5, following the same fix in github-community-projects/evergreen#635. Human review pending. ## Review focus - get_usernames_from_codeowners: `not ignore_teams or "/" not in handle` replaces the if/elif and keeps the same behavior - markdown_writer joins the PR URLs into one write() call instead of writelines(), because the tests only check write() calls Signed-off-by: jmeridth --- .github/linters/.isort.cfg | 1 + Dockerfile | 2 +- cleanowners.py | 11 +++++------ markdown_writer.py | 3 +-- test_cleanowners.py | 3 ++- 5 files changed, 10 insertions(+), 10 deletions(-) diff --git a/.github/linters/.isort.cfg b/.github/linters/.isort.cfg index f238bf7..a443079 100644 --- a/.github/linters/.isort.cfg +++ b/.github/linters/.isort.cfg @@ -1,2 +1,3 @@ [settings] profile = black +known_first_party = auth,cleanowners,env,markdown_writer diff --git a/Dockerfile b/Dockerfile index aa61bf6..dc980d1 100644 --- a/Dockerfile +++ b/Dockerfile @@ -16,7 +16,7 @@ RUN uv sync --frozen --no-dev --no-editable \ # Add a simple healthcheck to satisfy container scanners HEALTHCHECK --interval=30s --timeout=10s --start-period=10s --retries=3 \ - CMD python3 -c "import os,sys; sys.exit(0 if os.path.exists('/action/workspace/cleanowners.py') else 1)" + CMD ["python3", "-c", "import os,sys; sys.exit(0 if os.path.exists('/action/workspace/cleanowners.py') else 1)"] ENV PYTHONUNBUFFERED=1 ENV UV_LINK_MODE=copy diff --git a/cleanowners.py b/cleanowners.py index 815e23c..d3e9ee1 100644 --- a/cleanowners.py +++ b/cleanowners.py @@ -4,9 +4,10 @@ import re import uuid +from github import GithubException, UnknownObjectException + import auth import env -from github import GithubException, UnknownObjectException from markdown_writer import write_step_summary, write_to_markdown @@ -252,7 +253,7 @@ def main(): # pragma: no cover f" Check write permissions." ) continue - except Exception as e: # pylint: disable=broad-exception-caught + except Exception as e: # noqa: BLE001 # pylint: disable=broad-exception-caught error_message = str(e) print(f"Error: {error_message}") finally: @@ -361,9 +362,7 @@ def get_usernames_from_codeowners(codeowners_file_contents, ignore_teams=True): handle = handle.split()[0] # Identify team handles by the presence of a slash. # Ignore teams because non-org members cannot be in a team. - if ignore_teams and "/" not in handle: - usernames.append(handle) - elif not ignore_teams: + if not ignore_teams or "/" not in handle: usernames.append(handle) return usernames @@ -398,7 +397,7 @@ def commit_changes( default_branch = repo.default_branch default_branch_commit = repo.get_git_ref(f"heads/{default_branch}").object.sha front_matter = "refs/heads/" - branch_name = f"codeowners-{str(uuid.uuid4())}" + branch_name = f"codeowners-{uuid.uuid4()!s}" repo.create_git_ref(front_matter + branch_name, default_branch_commit) if create_new: repo.create_file( diff --git a/markdown_writer.py b/markdown_writer.py index be9d904..56a6d12 100644 --- a/markdown_writer.py +++ b/markdown_writer.py @@ -94,8 +94,7 @@ def write_step_summary( _write_repos_missing_codeowners(file, repos_missing_codeowners, warning_suffix) if pull_request_urls: file.write("## Pull Requests Created :link:\n") - for url in pull_request_urls: - file.write(f"- {url}\n") + file.write("".join(f"- {url}\n" for url in pull_request_urls)) file.write("\n") if error: file.write(f"## Error :x:\n\n{error}\n") diff --git a/test_cleanowners.py b/test_cleanowners.py index 2510741..2101811 100644 --- a/test_cleanowners.py +++ b/test_cleanowners.py @@ -5,6 +5,8 @@ from io import StringIO from unittest.mock import MagicMock, patch +from github import UnknownObjectException + from cleanowners import ( build_default_codeowners, cleanup_whitespace, @@ -16,7 +18,6 @@ print_stats, remove_username_from_content, ) -from github import UnknownObjectException class TestCommitChanges(unittest.TestCase):