Skip to content

Commit 17a1925

Browse files
Replace Flake8 with Ruff for linting in CI and update contribution guidelines
1 parent 13435e5 commit 17a1925

File tree

3 files changed

+8
-15
lines changed

3 files changed

+8
-15
lines changed

.github/workflows/python.yml

Lines changed: 4 additions & 11 deletions
Original file line numberDiff line numberDiff line change
@@ -33,17 +33,10 @@ jobs:
3333
uses: actions/setup-python@v4
3434
with:
3535
python-version: '3.12'
36-
# flake8 version should be same as the version in requirements/test.txt
37-
# to avoid lint errors on CI
38-
- name: pip install flak8
39-
run: pip install flake8>=4.1.0
40-
- name: Lint with flake8
41-
run: |
42-
flake8
43-
# stop the build if there are Python syntax errors or undefined names
44-
flake8 . --count --select=E9,F63,F7,F82 --show-source --statistics
45-
# exit-zero treats all errors as warnings. The GitHub editor is 127 chars wide
46-
flake8 . --count --exit-zero --max-complexity=10 --max-line-length=127 --statistics
36+
- name: Install Ruff
37+
run: pip install ruff>=0.15.0
38+
- name: Lint with Ruff
39+
run: ruff check .
4740

4841
integration_tests:
4942
uses: optimizely/python-sdk/.github/workflows/integration_test.yml@master

CONTRIBUTING.md

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -15,7 +15,7 @@ Development process
1515
2. Please follow the [commit message guidelines](https://github.com/angular/angular/blob/master/CONTRIBUTING.md#-commit-message-guidelines)
1616
for each commit message.
1717
3. Make sure to add tests!
18-
4. Run `flake8` to ensure there are no lint errors.
18+
4. Run `ruff check .` to ensure there are no lint errors.
1919
5. `git push` your changes to GitHub.
2020
6. Open a PR from your fork into the master branch of the original
2121
repo.
@@ -34,12 +34,12 @@ Pull request acceptance criteria
3434
- Tests are located in `/tests` with one file per class.
3535
- Please don't change the `__version__`. We'll take care of bumping
3636
the version when we next release.
37-
- Lint your code with Flake8 before submitting.
37+
- Lint your code with Ruff before submitting.
3838

3939
Style
4040
-----
4141

42-
We enforce Flake8 rules.
42+
We enforce Ruff linting rules (Flake8-equivalent: pycodestyle + Pyflakes).
4343

4444
License
4545
-------

requirements/test.txt

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,5 @@
11
coverage
2-
flake8 >= 4.0.1
2+
ruff >= 0.15.0
33
funcsigs >= 0.4
44
pytest >= 6.2.0
55
pytest-cov

0 commit comments

Comments
 (0)