Skip to content

Commit

Permalink
CI: Use ruff instead of black and flake8
Browse files Browse the repository at this point in the history
* Start using ruff instead of black and flake8 for code formatting
* Pull in the updates from ruff
* Update the .yamllint file to stop fighting with prettier

Signed-off-by: Andrew Grimberg <[email protected]>
Change-Id: I7292ac576e5f177dac0fb4691ec316cc73d054e8
  • Loading branch information
tykeal committed Jun 4, 2024
1 parent 058282a commit abca239
Show file tree
Hide file tree
Showing 5 changed files with 14 additions and 9 deletions.
16 changes: 7 additions & 9 deletions .pre-commit-config.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -29,16 +29,14 @@ repos:
- id: prettier
stages: [commit]

- repo: https://github.com/ambv/black
rev: 23.3.0
- repo: https://github.com/astral-sh/ruff-pre-commit
rev: f42857794802b6a77b0e66f08803575aa80d3c8f # frozen: v0.4.7
hooks:
- id: black

- repo: https://github.com/PyCQA/flake8
rev: 6.1.0
hooks:
- id: flake8
args: ["--max-line-length=88"]
- id: ruff
files: ^.+\.py$
args: [--fix, --exit-non-zero-on-fix]
- id: ruff-format
files: ^.+\.py$

- repo: https://github.com/pycqa/bandit
rev: 1.7.5
Expand Down
4 changes: 4 additions & 0 deletions .yamllint.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -5,3 +5,7 @@ rules:
max-end: 1
line-length:
max: 120
comments:
# prettier forces 1 space comment separator
min-spaces-from-content: 1
level: error
1 change: 1 addition & 0 deletions docs_conf/__init__.py
Original file line number Diff line number Diff line change
Expand Up @@ -13,5 +13,6 @@
Configure sphinx-doc through an YAML file.
"""

__author__ = "Linux Foundation Releng"
__summary__ = "Linux Foundation DocsConf"
1 change: 1 addition & 0 deletions setup.py
Original file line number Diff line number Diff line change
@@ -1,4 +1,5 @@
"""Setup for Docs Configuration."""

from setuptools import setup


Expand Down
1 change: 1 addition & 0 deletions tests/test_simple.py
Original file line number Diff line number Diff line change
Expand Up @@ -10,6 +10,7 @@
# http://www.eclipse.org/legal/epl-v10.html
##############################################################################
"""Docs Conf Tests."""

import importlib
import os
import pytest
Expand Down

0 comments on commit abca239

Please sign in to comment.