Skip to content
Open
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
The table of contents is too big for display.
Diff view
Diff view
  •  
  •  
  •  
6 changes: 3 additions & 3 deletions .github/workflows/CPUTests.yml
Original file line number Diff line number Diff line change
Expand Up @@ -44,13 +44,13 @@ jobs:
- name: Install Dependencies
run: |
python3 -m pip install --upgrade pip
python3 -m pip install pylint pyink pytype==2024.2.27
python3 -m pip install pylint ruff pytype==2024.2.27
- name: Typecheck the code with pytype
run: |
pytype --jobs auto --disable 'import-error,late-directive,wrong-arg-types,module-attr,unsupported-operands' src/MaxText/ || true
- name: pylint
run: |
pylint --disable=R0401,R0917,W0201,W0613 --ignore-patterns='.pytype,.*pyi$' benchmarks end_to_end src tests
- name: pyink
- name: ruff
run: |
pyink --pyink-indentation=2 --line-length=122 --check .
ruff --config pyproject.toml format --check
24 changes: 18 additions & 6 deletions .pre-commit-config.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -9,7 +9,7 @@ repos:
args:
- '-w'
- '--skip="*.txt,pylintrc,.*,src/MaxText/assets/*"'
- '-L ND,nd,sems,TE,ROUGE,rouge,astroid'
- '-L ND,nd,sems,TE,ROUGE,rouge,astroid,ags'
- '.'
additional_dependencies:
- tomli
Expand Down Expand Up @@ -44,11 +44,23 @@ repos:
# - '--keep-going'
# - 'src/MaxText/'

- repo: https://github.com/google/pyink
rev: 24.10.1
# - repo: https://github.com/google/pyink
# rev: 24.10.1
# hooks:
# - id: pyink
# args:
# - '--pyink-indentation=2'
# - '--line-length=122'
# - '--check'

- repo: https://github.com/astral-sh/ruff-pre-commit
rev: v0.14.0
hooks:
- id: pyink
# Run the linter.
# - id: ruff-check
# Run the formatter.
- id: ruff-format
args:
- '--pyink-indentation=2'
- '--line-length=122'
- '--config'
- 'pyproject.toml'
- '--check'
24 changes: 16 additions & 8 deletions .pre-commit-hooks.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -6,14 +6,14 @@
exclude: '^\.[^/]*(cache|assets|uv|venv)/.*'
types: [ text ]

- id: pyink
name: pyink
description: Run pyink Python code formatter.
entry: pyink
language: python
types:
- python
- text
#- id: pyink
# name: pyink
# description: Run pyink Python code formatter.
# entry: pyink
# language: python
# types:
# - python
# - text

# - id: pytype
# name: Pytype
Expand All @@ -38,3 +38,11 @@
# - toml
# files: '^pyproject\.toml$'
# entry: validate-pyproject

- id: ruff-format
name: ruff-format
description: uses `ruff` to prettify code
types:
- python
entry: ruff-format
language: system
Loading
Loading