From 513fe320c3c5b11cafbab29ee4667d49f5747ba0 Mon Sep 17 00:00:00 2001
From: Ahmed Ilyas <ahmed.ilyas@hu-berlin.de>
Date: Fri, 22 Dec 2023 15:12:22 +0000
Subject: [PATCH] ci error on format failure

---
 .gitlab-ci.yml                       | 2 +-
 nomad/app/v1/routers/auth.py         | 2 +-
 nomad/app/v1/routers/uploads.py      | 2 +-
 nomad/app/v1/routers/users.py        | 2 +-
 nomad/metainfo/metainfo.py           | 2 +-
 nomad/search.py                      | 2 +-
 tests/app/v1/routers/test_uploads.py | 2 +-
 tests/conftest.py                    | 2 +-
 tests/normalizing/test_system.py     | 2 +-
 tests/processing/test_data.py        | 2 +-
 10 files changed, 10 insertions(+), 10 deletions(-)

diff --git a/.gitlab-ci.yml b/.gitlab-ci.yml
index b2e9087107..205858b3b7 100644
--- a/.gitlab-ci.yml
+++ b/.gitlab-ci.yml
@@ -89,7 +89,7 @@ python linting:
     - cd /app
   script:
     - ruff nomad tests
-    - ruff format nomad tests
+    - ruff format nomad tests --check
     - ruff nomad tests --output-format gitlab > $CI_PROJECT_DIR/gl-code-quality-report.json
     - mypy nomad tests
   rules:
diff --git a/nomad/app/v1/routers/auth.py b/nomad/app/v1/routers/auth.py
index 5e0beff167..c69cad0a16 100644
--- a/nomad/app/v1/routers/auth.py
+++ b/nomad/app/v1/routers/auth.py
@@ -409,7 +409,7 @@ async def get_token_via_query(username: str, password: str):
     response_model=SignatureToken,
 )
 async def get_signature_token(
-    user: Union[User, None] = Depends(create_user_dependency(required=True))
+    user: Union[User, None] = Depends(create_user_dependency(required=True)),
 ):
     """
     Generates and returns a signature token for the authenticated user. Authentication
diff --git a/nomad/app/v1/routers/uploads.py b/nomad/app/v1/routers/uploads.py
index 14da5933b2..568b7dcfeb 100644
--- a/nomad/app/v1/routers/uploads.py
+++ b/nomad/app/v1/routers/uploads.py
@@ -660,7 +660,7 @@ and publish your data."""
     response_model_exclude_none=True,
 )
 async def get_command_examples(
-    user: User = Depends(create_user_dependency(required=True))
+    user: User = Depends(create_user_dependency(required=True)),
 ):
     """Get url and example command for shell based uploads."""
     token = generate_upload_token(user)
diff --git a/nomad/app/v1/routers/users.py b/nomad/app/v1/routers/users.py
index 6d60b829f8..a0451fcdbb 100644
--- a/nomad/app/v1/routers/users.py
+++ b/nomad/app/v1/routers/users.py
@@ -68,7 +68,7 @@ class Users(BaseModel):
     response_model=User,
 )
 async def read_users_me(
-    current_user: User = Depends(create_user_dependency(required=True))
+    current_user: User = Depends(create_user_dependency(required=True)),
 ):
     current_user_dict: dict = current_user.m_to_dict(
         with_out_meta=True, include_derived=True
diff --git a/nomad/metainfo/metainfo.py b/nomad/metainfo/metainfo.py
index 67ba5cc7b9..97ffde81b1 100644
--- a/nomad/metainfo/metainfo.py
+++ b/nomad/metainfo/metainfo.py
@@ -2864,7 +2864,7 @@ class MSection(
             yield self
 
     def m_traverse(
-        self
+        self,
     ) -> Generator[Tuple[Any, Any, int, List[Union[str, int]]], None, None]:
         """
         Performs a depth-first traversal and yield tuples of section, property
diff --git a/nomad/search.py b/nomad/search.py
index 2733dada82..9e03d2a210 100644
--- a/nomad/search.py
+++ b/nomad/search.py
@@ -1590,7 +1590,7 @@ def _es_to_api_aggregation(
 
 
 def _specific_agg(
-    agg: Aggregation
+    agg: Aggregation,
 ) -> Union[
     TermsAggregation,
     AutoDateHistogramAggregation,
diff --git a/tests/app/v1/routers/test_uploads.py b/tests/app/v1/routers/test_uploads.py
index baecfe217d..e8cfd1d6f5 100644
--- a/tests/app/v1/routers/test_uploads.py
+++ b/tests/app/v1/routers/test_uploads.py
@@ -438,7 +438,7 @@ def block_until_completed(client, upload_id: str, user_auth):
 
 
 def get_upload_entries_metadata(
-    entries: List[Dict[str, Any]]
+    entries: List[Dict[str, Any]],
 ) -> Iterable[EntryMetadata]:
     """
     Create a iterable of :class:`EntryMetadata` from a API upload json record, plus a
diff --git a/tests/conftest.py b/tests/conftest.py
index dc48e02b63..c1ce1a9e50 100644
--- a/tests/conftest.py
+++ b/tests/conftest.py
@@ -839,7 +839,7 @@ def published(
 @pytest.mark.timeout(config.tests.default_timeout)
 @pytest.fixture(scope='function')
 def published_wo_user_metadata(
-    non_empty_processed: processing.Upload
+    non_empty_processed: processing.Upload,
 ) -> processing.Upload:
     """
     Provides a processed upload. Upload was uploaded with test_user.
diff --git a/tests/normalizing/test_system.py b/tests/normalizing/test_system.py
index 2f296c1f73..02917ae5c7 100644
--- a/tests/normalizing/test_system.py
+++ b/tests/normalizing/test_system.py
@@ -360,7 +360,7 @@ def test_representative_systems(entry, request):
 
 
 def test_reduced_chemical_formula():
-    'Ensure we get the right reduced chemical formula for glucose atom labels'
+    "Ensure we get the right reduced chemical formula for glucose atom labels"
     archive = parse_file(glucose_atom_labels)
     archive = run_normalize(archive)
     expected_red_chem_formula = 'C6H12O6'
diff --git a/tests/processing/test_data.py b/tests/processing/test_data.py
index 1be228edaa..07d99098a5 100644
--- a/tests/processing/test_data.py
+++ b/tests/processing/test_data.py
@@ -124,7 +124,7 @@ def mongo_forall(mongo_function):
 
 @pytest.fixture
 def uploaded_id_with_warning(
-    raw_files_function
+    raw_files_function,
 ) -> Generator[Tuple[str, str], None, None]:
     example_file = 'tests/data/proc/examples_with_warning_template.zip'
     example_upload_id = os.path.basename(example_file).replace('.zip', '')
-- 
GitLab