diff --git a/.gitlab-ci.yml b/.gitlab-ci.yml index b2e9087107bf976086ff6c24250f73dc58cc2d10..205858b3b7349bd6b9a78f5bdb1032041ca93bdb 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 5e0beff1675d914819228c3daeed82988f1b9aa1..c69cad0a168ddb6ec9398f49455f3995ca3af4a5 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 14da5933b25ea7cd72bb4c687e6b104650b43b0c..568b7dcfeb50f6a148dbadff641983397d576c1e 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 6d60b829f85e73404a8dff7849b5e0823589b5f3..a0451fcdbbeee076232dcb9d22cbd5b98fa0aeda 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 67ba5cc7b9c09c817a5f6d779136c8554a381d75..97ffde81b14901019fdb2648663945fb31506851 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 2733dada820ab878fbcc2c66355ceb4bda010425..9e03d2a2101f5fe3f49f069d52d77bbf500e200f 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 baecfe217d9f193cf0bbcf121fbfff06fd73ad95..e8cfd1d6f546f723f6102b4a356e8c417083a01d 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 dc48e02b6323ddc1f9f2356755d2a82f85d86296..c1ce1a9e50a148a6c283cc2cabab7e69ee57e6a0 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 2f296c1f7324643819d7c2fc9443874c6c3cfbb5..02917ae5c7b64c072ecbbe22a1321bea380444e1 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 1be228edaa47ca8aa5cf623165edfbda033766f8..07d99098a59f25b6f815d8c7f7bc8a9a0726901a 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', '')