File tree Expand file tree Collapse file tree
Expand file tree Collapse file tree Original file line number Diff line number Diff line change 5858 - name : Install Xee
5959 run : |
6060 pip install -e .[tests]
61+ - name : Lint with isort
62+ run : |
63+ isort --check .
6164 - name : Lint with pyink
6265 run : |
63- echo "Lint check temporarily disabled"
64- # pyink --check .
66+ pyink --check .
Original file line number Diff line number Diff line change 1+ repos :
2+ - repo : https://github.com/pre-commit/pre-commit-hooks
3+ rev : v4.6.0
4+ hooks :
5+ - id : trailing-whitespace
6+ - id : end-of-file-fixer
7+ - id : check-yaml
8+ - id : check-added-large-files
9+
10+ - repo : https://github.com/pycqa/isort
11+ rev : 5.13.2
12+ hooks :
13+ - id : isort
14+ name : isort (python)
15+
16+ - repo : https://github.com/google/pyink
17+ rev : v24.4.0
18+ hooks :
19+ - id : pyink
20+ types_or : [python, pyi]
Original file line number Diff line number Diff line change @@ -59,6 +59,31 @@ pixi run -e docs docs-check
5959` docs-build ` builds the HTML docs, while ` docs-check ` runs a stricter Sphinx
6060build with warnings treated as errors.
6161
62+ ### Code style & formatting
63+
64+ We use ` pyink ` to format Python code (with 2-space indent) and ` isort ` to sort
65+ imports to match Google standards. To automate this and ensure your changes
66+ pass CI lint checks:
67+
68+ 1 . ** Install pre-commit** (if not already installed):
69+ ``` bash
70+ pip install pre-commit
71+ ```
72+ 2. ** Install the git hooks** in the repository:
73+ ` ` ` bash
74+ pre-commit install
75+ ` ` `
76+
77+ Once installed, ` isort` and ` pyink` will automatically run on and format
78+ any files you modify whenever you run ` git commit` .
79+
80+ If you prefer to run them manually without committing, you can use:
81+ ` ` ` bash
82+ pixi run -e tests isort --check .
83+ pixi run -e tests pyink --check .
84+ ` ` `
85+ (Or specify individual files to check instead of ` .` ).
86+
6287# ## Running tests
6388
6489The Xee integration tests only pass on Xee branches (no forks). Please run the
Original file line number Diff line number Diff line change @@ -38,6 +38,7 @@ tests = [
3838 " absl-py" ,
3939 " pytest" ,
4040 " pyink" ,
41+ " isort" ,
4142 " rasterio" ,
4243 " rioxarray" ,
4344 " typing_extensions" ,
@@ -72,6 +73,12 @@ preview = true
7273pyink-indentation = 2
7374pyink-use-majority-quotes = true
7475
76+ [tool .isort ]
77+ profile = " google"
78+ use_parentheses = true
79+ known_first_party = [" xee" ]
80+ multi_line_output = 3
81+
7582[tool .setuptools ]
7683packages = [" xee" ]
7784
You can’t perform that action at this time.
0 commit comments