Skip to content

Commit 83cb28c

Browse files
authored
Merge pull request #274 from jsakv/update-makefile
Replace makefile commands with ruff
2 parents 2169bf0 + 4337625 commit 83cb28c

File tree

5 files changed

+15
-14
lines changed

5 files changed

+15
-14
lines changed

Diff for: Makefile

+5-6
Original file line numberDiff line numberDiff line change
@@ -5,16 +5,15 @@ init:
55

66
lint:
77
pip install causalpy[lint]
8-
isort .
9-
black .
8+
ruff check --fix .
9+
ruff format .
1010

1111
check_lint:
1212
pip install causalpy[lint]
13-
flake8 .
14-
isort --check-only .
15-
black --diff --check --fast .
13+
ruff check .
14+
ruff format --diff --check .
1615
nbqa black --check .
17-
nbqa isort --check-only .
16+
nbqa ruff .
1817
interrogate .
1918

2019
doctest:

Diff for: causalpy/__init__.py

+1-4
Original file line numberDiff line numberDiff line change
@@ -1,9 +1,6 @@
11
import arviz as az
22

3-
from causalpy import pymc_experiments
4-
from causalpy import pymc_models
5-
from causalpy import skl_experiments
6-
from causalpy import skl_models
3+
from causalpy import pymc_experiments, pymc_models, skl_experiments, skl_models
74
from causalpy.version import __version__
85

96
from .data import load_data

Diff for: causalpy/pymc_experiments.py

+2-2
Original file line numberDiff line numberDiff line change
@@ -11,7 +11,7 @@
1111
1212
"""
1313

14-
import warnings
14+
import warnings # noqa: I001
1515
from typing import Union
1616

1717
import arviz as az
@@ -23,7 +23,7 @@
2323
from patsy import build_design_matrices, dmatrices
2424
from sklearn.linear_model import LinearRegression as sk_lin_reg
2525

26-
from causalpy.custom_exceptions import BadIndexException # NOQA
26+
from causalpy.custom_exceptions import BadIndexException
2727
from causalpy.custom_exceptions import DataException, FormulaException
2828
from causalpy.plot_utils import plot_xY
2929
from causalpy.utils import _is_variable_dummy_coded

Diff for: causalpy/tests/test_input_validation.py

+2-2
Original file line numberDiff line numberDiff line change
@@ -1,11 +1,11 @@
11
"""Input validation tests"""
22

3-
import numpy as np
3+
import numpy as np # noqa: I001
44
import pandas as pd
55
import pytest
66

77
import causalpy as cp
8-
from causalpy.custom_exceptions import BadIndexException # NOQA
8+
from causalpy.custom_exceptions import BadIndexException
99
from causalpy.custom_exceptions import DataException, FormulaException
1010

1111
sample_kwargs = {"tune": 20, "draws": 20, "chains": 2, "cores": 2}

Diff for: pyproject.toml

+5
Original file line numberDiff line numberDiff line change
@@ -112,3 +112,8 @@ color = true
112112
omit-covered-files = false
113113
generate-badge = "docs/source/_static/"
114114
badge-format = "svg"
115+
116+
[tool.ruff.lint]
117+
extend-select = [
118+
"I", # isort
119+
]

0 commit comments

Comments
 (0)