Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

[pre-commit.ci] pre-commit autoupdate #243

Merged
merged 3 commits into from
Jul 4, 2024
Merged
Show file tree
Hide file tree
Changes from all 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
2 changes: 1 addition & 1 deletion .github/workflows/auto-merge.yml
Original file line number Diff line number Diff line change
Expand Up @@ -10,7 +10,7 @@ permissions:
jobs:
auto-merge:
runs-on: ubuntu-latest
if: ${{ github.actor == 'dependabot[bot]' || github.actor == 'pre-commit-ci[bot]' }}
if: ${{ github.event.pull_request.user.login == 'dependabot[bot]' || github.event.pull_request.user.login == 'pre-commit-ci[bot]' }}
steps:
- name: Enable auto-merge for Dependabot PRs
run: |
Expand Down
4 changes: 2 additions & 2 deletions .pre-commit-config.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -9,12 +9,12 @@ repos:
hooks:
- id: black
- repo: https://github.com/astral-sh/ruff-pre-commit
rev: 'v0.4.10'
rev: 'v0.5.0'
hooks:
- id: ruff
args: [--fix, --exit-non-zero-on-fix]
- repo: https://github.com/pre-commit/mirrors-mypy
rev: "v1.10.0"
rev: "v1.10.1"
hooks:
- id: mypy
- repo: https://github.com/igorshubovych/markdownlint-cli
Expand Down
23 changes: 16 additions & 7 deletions pyproject.toml
Original file line number Diff line number Diff line change
Expand Up @@ -54,11 +54,20 @@ disallow_untyped_defs = false
[tool.pytest.ini_options]
addopts = "-v --mypy -p no:warnings --cov=datahub --cov-report=html --doctest-modules --ignore=datahub/__main__.py"

[tool.ruff]
select = ["D", "E", "F", "I"] # pydocstyle, pycodestyle, Pyflakes, isort

[tool.ruff.per-file-ignores]
"tests/*" = ["D100", "D104"]
[tool.ruff.lint]
select = [
"D", # pydocstyle
"E", # pycodestyle
"F", # Pyflakes
"I", # isort
"UP", # pyupgrade
"RUF", # ruff
]
ignore = ["RUF012"] # Typing on mutable class attributes
pydocstyle.convention = "google"

[tool.ruff.pydocstyle]
convention = "google"
[tool.ruff.lint.per-file-ignores]
"tests/*" = [
"D100", # Missing docstring in public module
"D104", # Missing docstring in public package
]
2 changes: 1 addition & 1 deletion tests/conftest.py
Original file line number Diff line number Diff line change
Expand Up @@ -55,7 +55,7 @@ def dsr_data_path(tmp_path):
# Otherwise, create and write data to the file
with h5py.File(file_path, "w") as h5file:
for field in list(DSRModel.__fields__.values()):
if field.annotation == str:
if field.annotation is str:
h5file[field.alias] = "Name or Warning"
else:
shape = field.field_info.extra["shape"]
Expand Down
3 changes: 1 addition & 2 deletions tests/test_opal.py
Original file line number Diff line number Diff line change
Expand Up @@ -16,8 +16,7 @@ def test_create_opal_frame():
assert np.issubdtype(df["Time"].dtype, np.datetime64)

# Checks that all other data types are int or float
dtypes = df.dtypes
assert ((dtypes.drop("Time") == int) | (dtypes.drop("Time") == float)).all()
assert all(np.issubdtype(dtype, np.number) for dtype in df.dtypes.drop("Time"))


def test_append_opal_data(opal_data):
Expand Down
Loading