diff --git a/.pre-commit-config.yaml b/.pre-commit-config.yaml index ff1ce904..09aaac50 100644 --- a/.pre-commit-config.yaml +++ b/.pre-commit-config.yaml @@ -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 diff --git a/scripts/novaseq_run_recipe_generator.py b/scripts/novaseq_run_recipe_generator.py index 0e69554f..b3ba45df 100644 --- a/scripts/novaseq_run_recipe_generator.py +++ b/scripts/novaseq_run_recipe_generator.py @@ -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__": diff --git a/scripts/ont_calc_volumes.py b/scripts/ont_calc_volumes.py index a6a79c00..c1f7c9bc 100644 --- a/scripts/ont_calc_volumes.py +++ b/scripts/ont_calc_volumes.py @@ -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) diff --git a/scripts/ont_generate_samplesheet.py b/scripts/ont_generate_samplesheet.py index 6b4e10c9..56167a24 100644 --- a/scripts/ont_generate_samplesheet.py +++ b/scripts/ont_generate_samplesheet.py @@ -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): @@ -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) diff --git a/scripts/ont_pool.py b/scripts/ont_pool.py index c8167fcb..fd067f4d 100644 --- a/scripts/ont_pool.py +++ b/scripts/ont_pool.py @@ -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) diff --git a/scripts/ont_suggest_ports.py b/scripts/ont_suggest_ports.py index 5425177a..e3448c32 100644 --- a/scripts/ont_suggest_ports.py +++ b/scripts/ont_suggest_ports.py @@ -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__": diff --git a/scripts/ont_update_amount.py b/scripts/ont_update_amount.py index 73bc7987..174e4f3c 100644 --- a/scripts/ont_update_amount.py +++ b/scripts/ont_update_amount.py @@ -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) diff --git a/scripts/parse_ba_results.py b/scripts/parse_ba_results.py index 085eac17..6f8cff34 100644 --- a/scripts/parse_ba_results.py +++ b/scripts/parse_ba_results.py @@ -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. """ @@ -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): @@ -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) diff --git a/scripts/samplesheet_generator.py b/scripts/samplesheet_generator.py index b5024181..337f3ca0 100644 --- a/scripts/samplesheet_generator.py +++ b/scripts/samplesheet_generator.py @@ -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) diff --git a/scripts/tecan_parser.py b/scripts/tecan_parser.py index 83eb9fa0..d186400d 100644 --- a/scripts/tecan_parser.py +++ b/scripts/tecan_parser.py @@ -1,3 +1,5 @@ +#!/usr/bin/env python + import csv import re import sys diff --git a/scripts/write_notes_to_couchdb.py b/scripts/write_notes_to_couchdb.py index d6c2218c..a9a44260 100644 --- a/scripts/write_notes_to_couchdb.py +++ b/scripts/write_notes_to_couchdb.py @@ -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"),