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

TIED-46: Apply code QA tools (black, isort), fix/ignore flake8 errors #330

Merged
merged 6 commits into from
Feb 23, 2023

Conversation

danipran
Copy link
Contributor

Mass applied black/isort code formatting. Fixed the flake8 errors manually.

Regarding C901 errors (too complex); tried to split some of the low-hanging fruits. Added # noqa: C901 for parts that weren't clear-cut cases.

The "low-hanging fruits" (might wanna check these more carefully):
865f4b1
77791fb

Errors being:
./metarecord/exporter/jhs.py:96:10: N806 variable 'ToimenpideTiedot' in function should be lowercase
./metarecord/exporter/jhs.py:112:10: N806 variable 'ToimenpideTiedot' in function should be lowercase
./metarecord/exporter/jhs.py:142:5: C901 'JHSExporter._handle_classification' is too complex (12)
Following errors:

./metarecord/views/admin.py:21:38: B006 Do not use mutable data structures for argument defaults.  They are created during function definition time. All calls to the function reuse this one instance of that data structure, persisting changes between them.
./metarecord/importer/tos.py:104:10: N806 variable 'HEADER_ROW' in function should be lowercase
./metarecord/importer/tos.py:105:10: N806 variable 'VALUE_ROW' in function should be lowercase
Copy link
Contributor

@voneiden voneiden left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Seems good, tests pass. Skipped over the black and isort commits.

Due to flake8 error:
./metarecord/views/function.py:86:5: C901 'FunctionListSerializer._create_new_version' is too complex (12)
TOSImporter._process_data
TOSImporter.import_attributes
get_attribute_json_schema

Errors:
./metarecord/importer/tos.py:322:5: C901 'TOSImporter._process_data' is too complex (21)
./metarecord/importer/tos.py:431:5: C901 'TOSImporter.import_attributes' is too complex (15)
./metarecord/models/structural_element.py:214:1: C901 'get_attribute_json_schema' is too complex (16)
@danipran danipran force-pushed the TIED-46-apply-code-qa branch from d2b78b8 to 188b7cd Compare February 23, 2023 07:24
@danipran danipran merged commit 0b7a68b into develop Feb 23, 2023
@danipran danipran deleted the TIED-46-apply-code-qa branch February 23, 2023 07:30
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants