Skip to content

Commit

Permalink
Merge pull request #243 from ImperialCollegeLondon/pre-commit-ci-upda…
Browse files Browse the repository at this point in the history
…te-config

[pre-commit.ci] pre-commit autoupdate
  • Loading branch information
github-actions[bot] authored Jul 4, 2024
2 parents 2729d9f + b036326 commit 8570002
Show file tree
Hide file tree
Showing 5 changed files with 21 additions and 13 deletions.
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

0 comments on commit 8570002

Please sign in to comment.