Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
88 changes: 44 additions & 44 deletions .pre-commit-config.yaml
Original file line number Diff line number Diff line change
@@ -1,46 +1,46 @@
# Copyright 2022 VMware, Inc.
# SPDX-License-Identifier: Apache-2

default_language_version:
python: python3

python: python3
repos:
# ----- Local Hooks ----------------------------------------------------------------------------------------------->
- repo: local
hooks:
- id: check-changelog-entries
name: Check Changelog Entries
entry: python .pre-commit-hooks/check_changelog_entries.py
language: system

- repo: local
hooks:
- id: check-copyright-headers
name: Check python modules for appropriate copyright headers
files: ^.*\.py$
exclude: setup\.py
entry: python .pre-commit-hooks/copyright_headers.py
language: system
# <---- Local Hooks ------------------------------------------------------------------------------------------------

- repo: https://github.com/timothycrosley/isort
rev: 5.12.0
hooks:
- id: isort

- repo: https://github.com/psf/black
rev: 22.6.0
hooks:
- id: black

# ----- Code Analysis --------------------------------------------------------------------------------------------->
- repo: https://github.com/pycqa/flake8
rev: '5.0.4'
hooks:
- id: flake8
exclude: ^(\.pre-commit-hooks/.*\.py)$
additional_dependencies:
- flake8-mypy-fork
- flake8-docstrings
- flake8-typing-imports
# <---- Code Analysis ---------------------------------------------------------------------------------------------
- repo: local
hooks:
- id: check-changelog-entries
name: Check Changelog Entries
entry: python .pre-commit-hooks/check_changelog_entries.py
language: system
- repo: local
hooks:
- id: check-copyright-headers
name: Check python modules for appropriate copyright headers
files: ^.*\.py$
exclude: setup\.py
entry: python .pre-commit-hooks/copyright_headers.py
language: system
- repo: https://github.com/timothycrosley/isort
rev: 5.12.0
hooks:
- id: isort
- repo: https://github.com/psf/black
rev: 22.6.0
hooks:
- id: black
- repo: https://github.com/pycqa/flake8
rev: 5.0.4
hooks:
- id: flake8
exclude: ^(\.pre-commit-hooks/.*\.py)$
additional_dependencies:
- flake8-mypy-fork
- flake8-docstrings
- flake8-typing-imports
- repo: https://github.com/pre-commit/mirrors-mypy
rev: v1.11.1
hooks:
- id: mypy
args:
- --strict
- --config-file=pyproject.toml
- relenv/
- tests/
additional_dependencies:
- types-requests
pass_filenames: false
8 changes: 8 additions & 0 deletions pyproject.toml
Original file line number Diff line number Diff line change
Expand Up @@ -21,3 +21,11 @@ ensure_newline_before_comments=true

[tool.pylint]
max-line-length=120

[tool.mypy]
python_version = "3.10"
explicit_package_bases = true
ignore_missing_imports = true
namespace_packages = true
mypy_path = "."
exclude = "relenv/__main__\\.py"
4 changes: 2 additions & 2 deletions relenv/__init__.py
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
# Copyright 2025 Broadcom.
# SPDX-License-Identifier: Apache-2
# Copyright 2022-2025 Broadcom.
# SPDX-License-Identifier: Apache-2.0
from __future__ import annotations

import sys
Expand Down
4 changes: 2 additions & 2 deletions relenv/__main__.py
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
# Copyright 2023-2025 Broadcom.
# SPDX-License-Identifier: Apache-2
# Copyright 2022-2025 Broadcom.
# SPDX-License-Identifier: Apache-2.0
"""
The entrypoint into relenv.
"""
Expand Down
9 changes: 5 additions & 4 deletions relenv/build/__init__.py
Original file line number Diff line number Diff line change
@@ -1,7 +1,8 @@
# Copyright 2022-2025 Broadcom.
# SPDX-License-Identifier: Apache-2
# SPDX-License-Identifier: Apache-2.0
# mypy: ignore-errors
"""
The ``relenv build`` command.
Entry points for the ``relenv build`` CLI command.
"""
from __future__ import annotations

Expand All @@ -10,7 +11,7 @@
import random
import signal
import sys
from types import ModuleType
from types import FrameType, ModuleType

from . import darwin, linux, windows
from .common import CHECK_VERSIONS_SUPPORT, builds
Expand Down Expand Up @@ -200,7 +201,7 @@ def main(args: argparse.Namespace) -> None:
else:
show_ui = True

def signal_handler(signal, frame):
def signal_handler(_signal: int, frame: FrameType | None) -> None:
sys.exit(1)

signal.signal(signal.SIGINT, signal_handler)
Expand Down
Loading
Loading