Skip to content

Commit

Permalink
Remove flake8 and isort in favor of Ruff
Browse files Browse the repository at this point in the history
In conda#490, Ruff was added to try it out. Ruff could theoretically replace
isort and flake8. This commit removes them and removes compatibility
hacks in case we decide we do want to drop isort and flake8.
  • Loading branch information
mfisher87 committed Aug 30, 2023
1 parent de32227 commit bf64163
Show file tree
Hide file tree
Showing 4 changed files with 3 additions and 40 deletions.
10 changes: 0 additions & 10 deletions .flake8

This file was deleted.

12 changes: 0 additions & 12 deletions .pre-commit-config.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -24,18 +24,6 @@ repos:
- id: ruff
args: ["--fix"]

# Ruff should catch (and mostly fix) everything that flake8 and isort do; if
# either of these checks fails, can Ruff's config be updated to catch the same?
- repo: https://github.com/pycqa/flake8
rev: 6.1.0
hooks:
- id: flake8
- repo: https://github.com/pycqa/isort
rev: 5.12.0
hooks:
- id: isort
args: ["--profile", "black", "--filter-files"]

- repo: https://github.com/pre-commit/mirrors-mypy
rev: v1.5.1
hooks:
Expand Down
7 changes: 3 additions & 4 deletions conda_lock/lockfile/v2prelim/models.py
Original file line number Diff line number Diff line change
@@ -1,6 +1,3 @@
# isort: skip_file
# TODO: Remove the isort skip comment above if/when isort is no longer used. This skip
# exists because isort and ruff disagree about how to sort the imports in this file.
from collections import defaultdict
from typing import ClassVar, Dict, List, Optional

Expand All @@ -10,10 +7,12 @@
GitMeta,
HashModel,
InputMeta,
LockMeta,
MetadataOption,
TimeMeta,
)
from conda_lock.lockfile.v1.models import LockedDependency as LockedDependencyV1
from conda_lock.lockfile.v1.models import Lockfile as LockfileV1
from conda_lock.lockfile.v1.models import LockMeta, MetadataOption, TimeMeta
from conda_lock.models import StrictModel


Expand Down
14 changes: 0 additions & 14 deletions pyproject.toml
Original file line number Diff line number Diff line change
Expand Up @@ -108,18 +108,6 @@ exclude = [
"tests",
]

[tool.isort]
# NOTE: Can ruff replace isort? See `tool.ruff.isort`, these two configs should
# be kept in sync until we pick one.
atomic = true
force_grid_wrap = 0
include_trailing_comma = true
lines_after_imports = 2
lines_between_types = 1
multi_line_output = 3
use_parentheses = true
known_first_party = "attr"

[tool.pytest.ini_options]
addopts = "-vrsx -n auto"
flake8-max-line-length = 105
Expand Down Expand Up @@ -199,8 +187,6 @@ select = [
max-complexity = 18

[tool.ruff.isort]
# NOTE: Can ruff replace isort? See `tool.isort`, these two configs should be
# kept in sync until we pick one.
lines-after-imports = 2
lines-between-types = 1
known-first-party = ["attr"]

0 comments on commit bf64163

Please sign in to comment.