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

Update and run pre-commit hooks #218

Closed
wants to merge 1 commit into from
Closed
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
8 changes: 4 additions & 4 deletions .pre-commit-config.yaml
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
repos:
# Syntax validation and some basic sanity checks
- repo: https://github.com/pre-commit/pre-commit-hooks
rev: v4.0.1
rev: v4.6.0
hooks:
- id: check-merge-conflict
- id: check-ast
Expand All @@ -11,7 +11,7 @@ repos:

# Automatically sort imports
- repo: https://github.com/PyCQA/isort
rev: 5.12.0
rev: 5.13.2
hooks:
- id: isort
args: [
Expand All @@ -28,14 +28,14 @@ repos:

# Automatic source code formatting
- repo: https://github.com/psf/black
rev: 22.3.0
rev: 24.8.0
hooks:
- id: black
args: [--safe, --quiet]

# Linting
- repo: https://github.com/PyCQA/flake8
rev: 4.0.1
rev: 7.1.1
hooks:
- id: flake8
additional_dependencies: ['flake8-comprehensions==3.8.0']
4 changes: 3 additions & 1 deletion src/ispyb/xmltools.py
Original file line number Diff line number Diff line change
Expand Up @@ -68,7 +68,9 @@ def __init__(self, parent_element):
currentValue = self[element.tag]
currentValue.append(aDict)
self.update({element.tag: currentValue})
except Exception: # the first of its kind, an empty list must be created
except (
Exception
): # the first of its kind, an empty list must be created
self.update(
{element.tag: [aDict]}
) # aDict is written in [], i.e. it will be a list
Expand Down
6 changes: 3 additions & 3 deletions tests/test_mxacquisition.py
Original file line number Diff line number Diff line change
Expand Up @@ -175,9 +175,9 @@ def test_mxacquisition_methods(testdb):

params = mxacquisition.get_data_collection_file_attachment_params()
params["parentid"] = id1
params[
"file_full_path"
] = "/dls/mx/data/mx12345/mx12345-6/processed/xia2_run/result.json"
params["file_full_path"] = (
"/dls/mx/data/mx12345/mx12345-6/processed/xia2_run/result.json"
)
params["file_type"] = "log"
dcfa_id = mxacquisition.upsert_data_collection_file_attachment(
list(params.values())
Expand Down
1 change: 1 addition & 0 deletions tests/test_xtalimaging.py
Original file line number Diff line number Diff line change
@@ -1,5 +1,6 @@
import time


def test_xtal_imaging(testdb):
testdb.set_role("ispyb_import")
xtalimaging = testdb.xtal_imaging
Expand Down