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

Fix exits and pre-commit config #301

Merged
merged 2 commits into from
Jan 10, 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 .pre-commit-config.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -18,7 +18,7 @@ repos:
types-tabulate,
]
- repo: https://github.com/pre-commit/mirrors-prettier
rev: "3.0.3"
rev: "v4.0.0-alpha.8"
hooks:
- id: prettier
- repo: https://github.com/editorconfig-checker/editorconfig-checker.python
Expand Down
2 changes: 1 addition & 1 deletion scripts/novaseq_run_recipe_generator.py
Original file line number Diff line number Diff line change
Expand Up @@ -104,7 +104,7 @@ def main(lims, args):
with open(f"{log_id}_{fc_name}_Error.log", "w") as f:
f.write("\n".join(log))
sys.stderr.write("Errors were met, check the log.")
sys.exit(1)
sys.exit(2)


if __name__ == "__main__":
Expand Down
2 changes: 1 addition & 1 deletion scripts/ont_calc_volumes.py
Original file line number Diff line number Diff line change
Expand Up @@ -165,6 +165,6 @@ def main(lims, args):
lims.check_version()
try:
main(lims, args)
except BaseException as e:
except Exception as e:
sys.stderr.write(str(e))
sys.exit(2)
6 changes: 3 additions & 3 deletions scripts/ont_generate_samplesheet.py
Original file line number Diff line number Diff line change
Expand Up @@ -104,7 +104,7 @@ def main(lims, args):

except AssertionError as e:
sys.stderr.write(str(e))
sys.exit()
sys.exit(2)


def minknow_samplesheet_default(currentStep):
Expand Down Expand Up @@ -510,6 +510,6 @@ def get_kit_string(currentStep):
lims.check_version()
try:
main(lims, args)
except BaseException as e:
except Exception as e:
sys.stderr.write(str(e))
sys.exit()
sys.exit(2)
2 changes: 1 addition & 1 deletion scripts/ont_pool.py
Original file line number Diff line number Diff line change
Expand Up @@ -143,7 +143,7 @@ def main(lims, args):
lims.request_session.delete(f.uri)
lims.upload_new_file(out, log_filename)

except BaseException as e:
except Exception as e:
sys.stderr.write(str(e))
sys.exit(2)

Expand Down
2 changes: 1 addition & 1 deletion scripts/ont_suggest_ports.py
Original file line number Diff line number Diff line change
Expand Up @@ -84,7 +84,7 @@ def main(lims, args):

except AssertionError as e:
sys.stderr.write(str(e))
sys.exit(1)
sys.exit(2)


if __name__ == "__main__":
Expand Down
2 changes: 1 addition & 1 deletion scripts/ont_update_amount.py
Original file line number Diff line number Diff line change
Expand Up @@ -113,7 +113,7 @@ def main(lims, args):
lims.request_session.delete(f.uri)
lims.upload_new_file(out, log_filename)

except BaseException as e:
except Exception as e:
sys.stderr.write(str(e))
sys.exit(2)

Expand Down
10 changes: 5 additions & 5 deletions scripts/parse_ba_results.py
Original file line number Diff line number Diff line change
Expand Up @@ -14,9 +14,9 @@
from epp_utils import udf_tools
from scilifelab_epps.epp import get_well_number

DESC = """This script parses the Agilent BioAnalyzer XML report.
DESC = """This script parses the Agilent BioAnalyzer XML report.

It is written to replace the current Illumina-supplied sfdcript consisting of compiled
It is written to replace the current Illumina-supplied sfdcript consisting of compiled
Java which does not as of 2023-08-25 populate the measurement UDFs of interest.
"""

Expand Down Expand Up @@ -164,13 +164,13 @@ def main(lims, args):

if any("ERROR" in entry for entry in log):
sys.stderr.write("Some samples were skipped, please check the Log file")
sys.exit(1)
sys.exit(2)

if any("WARNING" in entry for entry in log):
sys.stderr.write(
"Some samples generated warnings, please check the Log file"
)
sys.exit(1)
sys.exit(2)


def get_ba_output_file(currentStep, log):
Expand Down Expand Up @@ -201,6 +201,6 @@ def get_ba_output_file(currentStep, log):
lims.check_version()
try:
main(lims, args)
except BaseException as e:
except Exception as e:
sys.stderr.write(str(e))
sys.exit(2)
2 changes: 1 addition & 1 deletion scripts/samplesheet_generator.py
Original file line number Diff line number Diff line change
Expand Up @@ -850,7 +850,7 @@ def main(lims, args):
f.write("\n".join(log))

sys.stderr.write("Errors were met, check the log.")
sys.exit(1)
sys.exit(2)

else:
print(content)
Expand Down
2 changes: 2 additions & 0 deletions scripts/tecan_parser.py
Original file line number Diff line number Diff line change
@@ -1,3 +1,5 @@
#!/usr/bin/env python

import csv
import re
import sys
Expand Down
2 changes: 1 addition & 1 deletion scripts/write_notes_to_couchdb.py
Original file line number Diff line number Diff line change
Expand Up @@ -28,7 +28,7 @@ def write_note_to_couch(pid, timestamp, note, lims):
),
note["email"],
)
sys.exit(1)
sys.exit(2)

url_string = "https://{}:{}@{}".format(
config["statusdb"].get("username"),
Expand Down