FazBrowse GitHub Viewer | Trending |
URL:
| Home
Tools: [Download Repo ZIP]   [Original HTTPS Page]

ci: run checks in ci pipeline by exkson · Pull Request #33 · ceph/ceph-devstack · GitHub

Repository navigation

Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension .py  (3) .toml  (1) .yaml  (1) .yml  (1) All 4 file types selected
Only manifest files
Viewed files
Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Unified
Split
Hide whitespace
Diff view
Unified
Split
Hide whitespace
12 changes: 12 additions & 0 deletions .github/workflows/ci.yml
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters. Learn more about bidirectional Unicode characters
Original file line number Diff line number Diff line change
Expand Up @@ -6,9 +6,21 @@ on:
workflow_dispatch:

jobs:
lint:
name: Check code style
runs-on: ubuntu-24.04
steps:
- uses: actions/checkout@v2
- name: Install precommit
run: pip install pre-commit
- name: Check lint
run: pre-commit run ruff-check --all-files
- name: Check format
run: pre-commit run ruff-format --all-files
test:
name: CI on python${{ matrix.python }} via ${{ matrix.os }}
runs-on: ${{ matrix.os }}
needs: lint
strategy:
matrix:
include:
Expand Down
15 changes: 4 additions & 11 deletions .pre-commit-config.yaml
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters. Learn more about bidirectional Unicode characters
Original file line number Diff line number Diff line change
Expand Up @@ -7,18 +7,11 @@ repos:
- id: check-yaml
- id: end-of-file-fixer
- id: trailing-whitespace
- repo: https://github.com/psf/black
rev: 24.4.2
- repo: https://github.com/astral-sh/ruff-pre-commit
rev: v0.12.11
hooks:
- id: black
- repo: https://github.com/pycqa/flake8
rev: 7.0.0
hooks:
- id: flake8
additional_dependencies:
- flake8-bugbear
- flake8-comprehensions
- flake8-simplify
- id: ruff-check
- id: ruff-format
- repo: https://github.com/pre-commit/mirrors-mypy
rev: v1.10.0
hooks:
Expand Down
2 changes: 1 addition & 1 deletion ceph_devstack/cli.py
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters. Learn more about bidirectional Unicode characters
Original file line number Diff line number Diff line change
Expand Up @@ -9,7 +9,7 @@
from ceph_devstack.resources.ceph import CephDevStack


def main():
def main(): # noqa: C901
args = parse_args(sys.argv[1:])
config.load(args.config_file)
if args.verbose:
Expand Down
4 changes: 1 addition & 3 deletions ceph_devstack/host.py
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters. Learn more about bidirectional Unicode characters
Original file line number Diff line number Diff line change
Expand Up @@ -99,9 +99,7 @@ async def check_selinux_bool(self, name: str):
proc = await host.arun(["getsebool", name])
assert proc.stdout is not None
out = await proc.stdout.read()
if out.decode().strip() != f"{name} --> on":
return False
return True
return out.decode().strip() != f"{name} --> on"

async def get_sysctl_value(self, name: str) -> int:
proc = await host.arun(["sysctl", "-b", name])
Expand Down
4 changes: 2 additions & 2 deletions ceph_devstack/resources/ceph/utils.py
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters. Learn more about bidirectional Unicode characters
Original file line number Diff line number Diff line change
Expand Up @@ -29,8 +29,8 @@ def get_most_recent_run(runs: list[str]) -> str:
)
)
return run_name
except StopIteration:
raise FileNotFoundError
except StopIteration as e:
raise FileNotFoundError from e


def get_job_id(jobs: list[str]):
Expand Down
2 changes: 2 additions & 0 deletions ruff.toml
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters. Learn more about bidirectional Unicode characters
Original file line number Diff line number Diff line change
@@ -0,0 +1,2 @@
[lint]
extend-select = ["B", "C", "SIM"]

Back | FazBrowse Home | New Git URL