Skip to content

Commit

Permalink
fix linted warnings
Browse files Browse the repository at this point in the history
  • Loading branch information
m-fila committed Sep 27, 2024
1 parent 5c7e1a0 commit e1bc290
Show file tree
Hide file tree
Showing 4 changed files with 9 additions and 8 deletions.
4 changes: 2 additions & 2 deletions python/edm4hep/__init__.py
Original file line number Diff line number Diff line change
Expand Up @@ -24,9 +24,9 @@
res = ROOT.gInterpreter.LoadFile("edm4hep/Constants.h")
if res != 0:
raise RuntimeError("Failed to load Constants.h")
from ROOT import edm4hep
from ROOT import edm4hep # noqa: E402

from podio.pythonizations import load_pythonizations
from podio.pythonizations import load_pythonizations # noqa: E402

load_pythonizations("edm4hep")

Expand Down
10 changes: 6 additions & 4 deletions scripts/updateReadmeLinks.py
Original file line number Diff line number Diff line change
Expand Up @@ -25,9 +25,10 @@ def check_readme_links():
new_readme_content = ""

links_are_ok = True
for readme_line in readme_content:
for readme_content_line in readme_content:
readme_line = readme_content_line
edm4hep_objects = re.findall(
"\[(.*?)\]\(https:\/\/github.com\/key4hep\/EDM4hep\/blob\/main\/edm4hep\.yaml#L(\d+?)\)",
r"\[(.*?)\]\(https:\/\/github.com\/key4hep\/EDM4hep\/blob\/main\/edm4hep\.yaml#L(\d+?)\)",
readme_line,
)
if edm4hep_objects:
Expand All @@ -41,7 +42,8 @@ def check_readme_links():
]
if len(edm4hep_yaml_line_numbers_with_match) != 1:
print(
f"Error: failed to replace line number for {edm4hep_object}, either no or several matches were found in edm4hep.yaml with the regex '{regex}'"
f"Error: failed to replace line number for {edm4hep_object}, either no "
f"or several matches were found in edm4hep.yaml with the regex '{regex}'"
)
sys.exit(1)
if edm4hep_yaml_line_numbers_with_match[0] != original_line_number:
Expand All @@ -51,7 +53,7 @@ def check_readme_links():
f"[{edm4hep_object}](https://github.com/key4hep/EDM4hep/blob/main/edm4hep.yaml#L{edm4hep_yaml_line_numbers_with_match[0]})",
)
print(
f"{edm4hep_object} is wrongly linked (line {original_line_number} --> {edm4hep_yaml_line_numbers_with_match[0]})"
f"{edm4hep_object} is wrongly linked (line {original_line_number} --> {edm4hep_yaml_line_numbers_with_match[0]})" # noqa: E501
)
new_readme_content += readme_line
return links_are_ok, new_readme_content
Expand Down
2 changes: 1 addition & 1 deletion test/conftest.py
Original file line number Diff line number Diff line change
Expand Up @@ -14,5 +14,5 @@ def pytest_addoption(parser):
def pytest_configure(config):
"""This is a slighty hacky solution to make the pytest configuration
available in test modules outside of fixtures"""
global options
global options # noqa: PLW0603
options = config.option
1 change: 0 additions & 1 deletion test/utils/test_kinematics.py
Original file line number Diff line number Diff line change
@@ -1,7 +1,6 @@
#!/usr/bin/env python3

import unittest
import cppyy

import edm4hep

Expand Down

0 comments on commit e1bc290

Please sign in to comment.