Skip to content

Commit

Permalink
Replace black and isort with ruff (#558)
Browse files Browse the repository at this point in the history
  • Loading branch information
KapJI committed Sep 9, 2024
1 parent 97a76c8 commit 3b2dc46
Show file tree
Hide file tree
Showing 4 changed files with 10 additions and 95 deletions.
12 changes: 3 additions & 9 deletions .pre-commit-config.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -27,15 +27,9 @@ repos:
files: ^.+\.py$
- repo: local
hooks:
- id: black
name: black
entry: poetry run black
language: system
types: [python]
require_serial: true
- id: isort
name: isort
entry: poetry run isort
- id: ruff-format
name: ruff format
entry: poetry run ruff format
language: system
types: [python]
require_serial: true
Expand Down
12 changes: 6 additions & 6 deletions cgt_calc/main.py
Original file line number Diff line number Diff line change
Expand Up @@ -707,9 +707,9 @@ def calculate_capital_gain(
date_index,
)
if date_index >= tax_year_start_index:
calculation_log[date_index][
f"buy${symbol}"
] = calculation_entries
calculation_log[date_index][f"buy${symbol}"] = (
calculation_entries
)
if date_index in self.disposal_list:
for symbol in self.disposal_list[date_index]:
(
Expand Down Expand Up @@ -755,9 +755,9 @@ def calculate_capital_gain(
assert transaction_capital_gain == round_decimal(
calculated_gain, 2
)
calculation_log[date_index][
f"sell${symbol}"
] = calculation_entries
calculation_log[date_index][f"sell${symbol}"] = (
calculation_entries
)
if transaction_capital_gain > 0:
capital_gain += transaction_capital_gain
else:
Expand Down
73 changes: 1 addition & 72 deletions poetry.lock

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

8 changes: 0 additions & 8 deletions pyproject.toml
Original file line number Diff line number Diff line change
Expand Up @@ -34,9 +34,7 @@ types-requests = "^2.27.7"
yfinance = "^0.2.36"

[tool.poetry.group.dev.dependencies]
black = "^24.1"
codespell = "^2.2.6"
isort = "^5.13.2"
mypy = "^1.8"
pandas-stubs = "^2.2"
pre-commit = "^3.5.0"
Expand All @@ -52,11 +50,6 @@ cgt-calc = 'cgt_calc.main:init'
requires = ["poetry-core>=1.0.0"]
build-backend = "poetry.core.masonry.api"

[tool.isort]
profile = "black"
force_sort_within_sections = true
combine_as_imports = true

[tool.pylint.main]
py-version = "3.9"
load-plugins = [
Expand All @@ -68,7 +61,6 @@ load-plugins = [
max-line-length = 88
jobs = 2


[tool.pylint.messages_control]
# Reasons disabled:
# duplicate-code - unavoidable
Expand Down

0 comments on commit 3b2dc46

Please sign in to comment.