Skip to content
Merged
Show file tree
Hide file tree
Changes from 10 commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
10 changes: 5 additions & 5 deletions .github/workflows/ci-cd.yml
Original file line number Diff line number Diff line change
Expand Up @@ -26,7 +26,7 @@ jobs:
uses: prefix-dev/setup-pixi@v0.8.1
with:
environments: ${{ matrix.env }}
pixi-version: v0.33.0
pixi-version: v0.39.0
cache: true
locked: false # wont be the same because of the tag

Expand Down Expand Up @@ -84,7 +84,7 @@ jobs:
uses: prefix-dev/setup-pixi@v0.8.1
with:
environments: ${{ env.PIXI_ENV }}
pixi-version: v0.33.0
pixi-version: v0.39.0
cache: true
locked: false

Expand Down Expand Up @@ -139,7 +139,7 @@ jobs:
RUNNER_DEBUG: true
with:
environments: ${{ env.PIXI_ENV }}
pixi-version: v0.33.0
pixi-version: v0.39.0
cache: true
locked: false
# cache-key: pixi-ENV_${{ env.PIXI_ENV }}-
Expand Down Expand Up @@ -184,7 +184,7 @@ jobs:
uses: prefix-dev/setup-pixi@v0.8.1
with:
environments: ${{ env.PIXI_ENV }}
pixi-version: v0.33.0
pixi-version: v0.39.0
cache: true
locked: false # wont be the same because of the tag

Expand Down Expand Up @@ -215,7 +215,7 @@ jobs:
# uses: prefix-dev/setup-pixi@v0.8.1
# with:
# environments: ${{ env.PIXI_ENV }}
# pixi-version: v0.33.0
# pixi-version: v0.39.0
# cache: true
# locked: false # wont be the same because of the tag

Expand Down
155 changes: 120 additions & 35 deletions config/ruff.toml
Original file line number Diff line number Diff line change
@@ -1,53 +1,103 @@


target-version = "py39"
output-format = "full"
line-length = 99
fix = true
include = [
# "src/readii/loaders.py",
# "src/readii/feature_extraction.py"
]


# extend-exclude is used to exclude directories from the flake8 checks
extend-exclude = [
"docs/*",
"tests/*",
".pixi/",
]
"src/readii/image_processing.py",
"src/readii/metadata.py",
"src/readii/negative_controls.py",
"src/readii/pipeline.py",]

# Same as Black.
line-length = 100

extend-include = []

include = [
"src/readii/loaders.py"
]

[lint]
# Enable Pyflakes (`F`) and a subset of the pycodestyle (`E`) codes by default.
# Unlike Flake8, Ruff doesn't enable pycodestyle warnings (`W`) or
# McCabe complexity (`C901`) by default.

select = [
"E",
###########################################################################
# TYPE ANNOTATIONS
# Ensure all functions have type annotations
# https://docs.astral.sh/ruff/rules/#flake8-annotations-ann
"ANN",
# Use type hinting consistently
# https://docs.astral.sh/ruff/rules/#flake8-type-checking-tch
"TCH",

###########################################################################
# IMPORTS
# Sort imports naturally
# https://docs.astral.sh/ruff/rules/#isort-i
"I",
# Follow import conventions
# https://docs.astral.sh/ruff/rules/#flake8-import-conventions-icn
"ICN",
# Clean up and organize imports
# https://docs.astral.sh/ruff/rules/#flake8-tidy-imports-tid
"TID",

###########################################################################
# CODE QUALITY
# Detect possible bugs, like unused variables or exception handling issues
# https://docs.astral.sh/ruff/rules/#flake8-bugbear-b
"B",
# Avoid using Python builtins incorrectly
# https://docs.astral.sh/ruff/rules/#flake8-builtins-a
"A",
# Enforce correct usage of commas in lists, tuples, etc.
# https://docs.astral.sh/ruff/rules/#flake8-commas-com
"COM",
# Prevent use of debugging code, like breakpoints
# https://docs.astral.sh/ruff/rules/#flake8-debugger-t10
"T10",
# Disallow print statements
# https://docs.astral.sh/ruff/rules/#flake8-print-t20
"T20",
# Provide clear and explanatory error messages
# https://docs.astral.sh/ruff/rules/#flake8-errmsg-em
"EM",

###########################################################################
# STANDARDS & STYLE
# Prefer pathlib for path manipulation
# https://docs.astral.sh/ruff/rules/#flake8-use-pathlib-pth
"PTH",
# Adhere to Pylint conventions
# https://docs.astral.sh/ruff/rules/#pylint-pl
"PL",
# Simplify code to reduce complexity
# https://docs.astral.sh/ruff/rules/#flake8-simplify-sim
"SIM",
# errors like undefined names and unused imports without enforcing style rules.
# https://docs.astral.sh/ruff/rules/#pyflakes-f
"F",
"W", # flake8
"C", # mccabe
"I", # isort
"D", # pydocstyle
# "N", # pep8-naming
"ANN", # flake8-annotations
"BLE", # flake8-blind-except
"B", # flake8-bugbear
"A", # flake8-builtins
# "G", # flake8-logging-format
"ERA", # eradicate
"RUF", # Ruff-specific rules
"TCH", # flake8-type-checking
]
ignore = ["ANN101"]


[lint.per-file-ignores]
"tests/*" = ["S101"]

# Pydocstyle
# https://docs.astral.sh/ruff/rules/#pydocstyle-d
# "D",
]

[lint.mccabe]
max-complexity = 10

ignore = [
# allow self to not need type annotations
"ANN101",
# Allow too many arguments for functions
"PLR0913",
# Public Module Docstrings
"D100",
# Ignored because https://docs.astral.sh/ruff/formatter/#conflicting-lint-rules
"COM812", # https://docs.astral.sh/ruff/rules/missing-trailing-comma/#missing-trailing-comma-com812
"D206",
]

[lint.isort]
known-first-party = ["readii"]
Expand All @@ -56,12 +106,47 @@ combine-as-imports = true
lines-after-imports = 1
relative-imports-order = "closest-to-furthest"

[lint.mccabe]
max-complexity = 10


[lint.per-file-ignores]
"tests/*" = ["S101"]


[lint.pydocstyle]
convention = "numpy"



[format]

quote-style = "double"
indent-style = "tab"
docstring-code-format = true
docstring-code-line-length = 20
docstring-code-line-length = 20


# [lint] # commented for now, will iterate on this later
# select = [
# "E",
# "F",
# "W", # flake8
# "C", # mccabe
# "I", # isort
# "D", # pydocstyle
# # "N", # pep8-naming
# "ANN", # flake8-annotations
# "BLE", # flake8-blind-except
# "B", # flake8-bugbear
# "A", # flake8-builtins
# # "G", # flake8-logging-format
# "ERA", # eradicate
# "RUF", # Ruff-specific rules
# "TCH", # flake8-type-checking
# ]
# ignore = ["ANN101"]

# Readii uses a lot of camelcase so ignoring pep-8 conventions.
# https://docs.astral.sh/ruff/rules/#pep8-naming-n
# "N",
Loading
Loading