Skip to content

Commit

Permalink
[fix] lock 'isort' and 'black' matching versions for pre-commit-confi…
Browse files Browse the repository at this point in the history
…g.yaml and CI check (#2115)

* Update .pre-commit-config.yaml

* Update ci.yml

* Update CONTRIBUTING.md

* Update ci.yml

* Update ci.yml

* test failure in pipelines

* Update ci.yml

* Update ci.yml

* Update ci.yml

* Update ci.yml

* Update ci.yml

* Update ci.yml

* Update ci.yml
  • Loading branch information
icfaust authored Oct 17, 2024
1 parent 2dd89cd commit 6099c0d
Show file tree
Hide file tree
Showing 3 changed files with 10 additions and 5 deletions.
9 changes: 7 additions & 2 deletions .ci/pipeline/ci.yml
Original file line number Diff line number Diff line change
Expand Up @@ -48,13 +48,18 @@ jobs:
pool:
vmImage: 'ubuntu-22.04'
steps:
- script: |
echo "##vso[task.setvariable variable=ISORT_VERSION]$(grep -zoP '(?<=isort\n rev: ).*' .pre-commit-config.yaml)"
echo "##vso[task.setvariable variable=BLACK_VERSION]$(grep -zoP '(?<=black\n rev: ).*' .pre-commit-config.yaml)"
echo "##vso[task.setvariable variable=PYTHON_LINT_VERSION]$(grep -oP -m 1 '(?<=python).*' .pre-commit-config.yaml)"
displayName: 'Collect lint versions'
- task: UsePythonVersion@0
inputs:
versionSpec: '3.9'
versionSpec: $(PYTHON_LINT_VERSION)
addToPath: true
- script: |
python -m pip install --upgrade pip setuptools
pip install isort black[jupyter]==24.1.1
pip install isort==${ISORT_VERSION} black[jupyter]==${BLACK_VERSION}
isort --profile black --check . && black --check .
displayName: 'Linting'
- job: LinuxCondaEnv
Expand Down
4 changes: 2 additions & 2 deletions .pre-commit-config.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -16,12 +16,12 @@

repos:
- repo: https://github.com/psf/black
rev: 23.7.0
rev: 24.1.1
hooks:
- id: black
language_version: python3.10
- repo: https://github.com/PyCQA/isort
rev: 5.12.0
rev: 5.13.2
hooks:
- id: isort
language_version: python3.10
2 changes: 1 addition & 1 deletion CONTRIBUTING.md
Original file line number Diff line number Diff line change
Expand Up @@ -47,7 +47,7 @@ Continuous Integration (CI) testing is enabled for the repository. Your pull req

## Code Style

We use [black](https://black.readthedocs.io/en/stable/) and [isort](https://pycqa.github.io/isort/) formatters for Python* code. The line length is 90 characters; use default options otherwise. You can find the linter configuration in [.pyproject.toml](https://github.com/intel/scikit-learn-intelex/blob/main/pyproject.toml).
We use [black](https://black.readthedocs.io/en/stable/) version 24.1.1 and [isort](https://pycqa.github.io/isort/) version 5.13.2 formatters for Python* code. The line length is 90 characters; use default options otherwise. You can find the linter configuration in [.pyproject.toml](https://github.com/intel/scikit-learn-intelex/blob/main/pyproject.toml).

A GitHub* Action verifies if your changes comply with the output of the auto-formatting tools.

Expand Down

0 comments on commit 6099c0d

Please sign in to comment.