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
File renamed without changes.
8 changes: 4 additions & 4 deletions .github/workflows/lint.yml
Original file line number Diff line number Diff line change
Expand Up @@ -15,15 +15,15 @@ jobs:
if: github.actor != 'copybara-service[bot]'
steps:
- name: Checkout Repository
uses: actions/checkout@v4
uses: actions/checkout@v6
with:
fetch-depth: 0

- name: Setup Python
uses: actions/setup-python@v5
uses: actions/setup-python@v6
with:
# This reads from .python-version (the minimum Python version that Orbax supports).
python-version-file: '.python-version'
# This reads from .github-python-version (the minimum Python version that Orbax supports).
python-version-file: '.github-python-version'
cache: 'pip'

- name: Install Pre-commit and PyType
Expand Down
22 changes: 5 additions & 17 deletions .pre-commit-config.yaml
Original file line number Diff line number Diff line change
@@ -1,20 +1,11 @@
# pre-commit configuration for Orbax.
# Run locally with: pre-commit run --all-files
# Run locally with: pre-commit run --files $(git diff --name-only origin/main)
#
# Tool config lives in the repo-root pyproject.toml ([tool.pyink],
# [tool.isort]) and .pylintrc. The --config / --settings-path arguments
# below force the hooks to read from the root instead of the closest
# subpackage pyproject.toml (checkpoint/, model/, export/).
# Tool config lives in the repo-root pyproject.toml ([tool.isort]) and
# .pylintrc. The --settings-path / --rcfile arguments below force the hooks
# to read from the root instead of the closest subpackage pyproject.toml
#(checkpoint/, model/, export/).
repos:
- repo: https://github.com/google/pyink
rev: '25.12.0'
hooks:
- id: pyink
types_or: [python, jupyter]
files: '\.(py|ipynb)$'
args: [--config=pyproject.toml]
additional_dependencies: ["pyink[jupyter]"]

- repo: https://github.com/pylint-dev/pylint
rev: v4.0.5
hooks:
Expand All @@ -24,7 +15,6 @@ repos:
verbose: true
args:
- --rcfile=.pylintrc
exclude: ^(tests/|.*_test\.py$)

- repo: https://github.com/PyCQA/isort
rev: 6.0.1
Expand All @@ -33,12 +23,10 @@ repos:
name: isort
types: [python]
args: [--settings-path=pyproject.toml]
exclude: ^(tests/|.*_test\.py$)

- repo: https://github.com/google/pytype
rev: '2024.10.11'
hooks:
- id: pytype
name: pytype
args: [-d, import-error, --keep-going, -j, auto]
exclude: ^(tests/|.*_test\.py$)
11 changes: 4 additions & 7 deletions .pylintrc
Original file line number Diff line number Diff line change
Expand Up @@ -37,11 +37,6 @@ extension-pkg-whitelist=

[PARAMETER_DOCUMENTATION]

accept-no-param-doc=yes
accept-no-return-doc=yes
accept-no-yields-doc=yes
accept-no-raise-doc=yes

# Default docstring format.
default-docstring-type=google

Expand Down Expand Up @@ -86,6 +81,7 @@ disable=apply-builtin,
consider-refactoring-into-while-condition,
consider-ternary-expression,
consider-using-any-or-all,
consider-using-assignment-expr,
consider-using-augmented-assign,
consider-using-dict-comprehension,
consider-using-dict-items,
Expand Down Expand Up @@ -125,6 +121,7 @@ disable=apply-builtin,
input-builtin,
intern-builtin,
invalid-str-codec,
isinstance-second-argument-not-valid-type,
locally-disabled,
long-builtin,
long-suffix,
Expand Down Expand Up @@ -269,7 +266,7 @@ method-rgx=(?x)^(?:(?P<exempt>_[a-z0-9_]+__|runTest|setUp|tearDown|setUpTestCase

# Regular expression which should only match function or class names that do
# not require a docstring.
no-docstring-rgx=(__.*__|main|test.*|.*test|.*Test)$
no-docstring-rgx=(__.*__|main|test.*|.*test|.*Test|_.*)$

# Minimum line length for functions/classes that require docstrings, shorter
# ones are exempt.
Expand Down Expand Up @@ -307,7 +304,7 @@ generated-members=
[FORMAT]

# Maximum number of characters on a single line.
max-line-length=80
max-line-length=125

# TODO(https://github.com/PyCQA/pylint/issues/3352): Direct pylint to exempt
# lines made too long by directives to pytype.
Expand Down
1 change: 0 additions & 1 deletion CONTRIBUTING.md
Original file line number Diff line number Diff line change
Expand Up @@ -41,7 +41,6 @@ enforce it, wired together through the

| Tool | Role | Config |
|---|---|---|
| [`pyink`](https://github.com/google/pyink) | Formatter (Black fork with Google defaults) | `[tool.pyink]` in `pyproject.toml` |
| [`pylint`](https://pylint.readthedocs.io/) | Linter | `.pylintrc` |
| [`isort`](https://pycqa.github.io/isort/) | Import order | `[tool.isort]` in `pyproject.toml` |
| [`pytype`](https://github.com/google/pytype) | Static Type Inferece & Verification | `.pre-commit-config.yaml` |
Expand Down
22 changes: 0 additions & 22 deletions pyproject.toml
Original file line number Diff line number Diff line change
Expand Up @@ -3,28 +3,6 @@
# under checkpoint/, model/, and export/. Only formatter/linter settings live
# here so they apply uniformly across the monorepo.

[tool.pyink]
line-length = 80
unstable = false
target-version = []
pyink-indentation = 2
pyink-use-majority-quotes = true
pyink-annotation-pragmas = [
"noqa",
"pylint:",
"type: ignore",
"pytype:",
"mypy:",
"pyright:",
"pyre-",
"@title",
"@param",
"@markdown",
"@tidy",
"@test",
]
pyink-ipynb-indentation = 2

[tool.isort]
profile = "google"
known_third_party = ["orbax"]
Loading