Skip to content

Commit

Permalink
Use ruff toml in CI
Browse files Browse the repository at this point in the history
  • Loading branch information
andreasjansson committed Aug 28, 2024
1 parent 24ac430 commit 3034aa2
Show file tree
Hide file tree
Showing 3 changed files with 6 additions and 4 deletions.
4 changes: 2 additions & 2 deletions .github/workflows/ci.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -24,11 +24,11 @@ jobs:
- name: Run ruff linter
run: |
ruff check --exclude=ai-toolkit/ --exclude=LLaVA/ --ignore=E402
ruff check
- name: Run ruff formatter
run: |
ruff format --diff --exclude=ai-toolkit/ --exclude=LLaVA/
ruff format --diff
unit-test:
runs-on: ubuntu-latest
Expand Down
4 changes: 3 additions & 1 deletion predict.py
Original file line number Diff line number Diff line change
Expand Up @@ -61,7 +61,9 @@ def setup(self) -> None: # pyright: ignore
self.safety_checker = StableDiffusionSafetyChecker.from_pretrained(
SAFETY_CACHE_PATH, torch_dtype=torch.float16
).to("cuda") # pyright: ignore
self.feature_extractor = cast(CLIPImageProcessor, CLIPImageProcessor.from_pretrained(FEATURE_EXTRACTOR))
self.feature_extractor = cast(
CLIPImageProcessor, CLIPImageProcessor.from_pretrained(FEATURE_EXTRACTOR)
)

print("Loading Flux dev pipeline")
if not FLUX_DEV_PATH.exists():
Expand Down
2 changes: 1 addition & 1 deletion ruff.toml
Original file line number Diff line number Diff line change
Expand Up @@ -42,7 +42,7 @@ target-version = "py38"
# Unlike Flake8, Ruff doesn't enable pycodestyle warnings (`W`) or
# McCabe complexity (`C901`) by default.
select = ["E4", "E7", "E9", "F", "W", "I", "N", "UP", "A", "ICN", "PT", "Q", "RSE", "RET", "SLF", "SLOT", "SIM", "TID", "TCH", "ARG", "PTH", "ERA", "FLY"]
ignore = ["E402", "F403", "F405", "PT011", "SIM117", "SIM102", "ERA001", "RSE102"]
ignore = ["E402", "F403", "F405", "PT011", "SIM117", "SIM102", "ERA001", "RSE102", "I001"]

# Allow fix for all enabled rules (when `--fix`) is provided.
fixable = ["ALL"]
Expand Down

0 comments on commit 3034aa2

Please sign in to comment.