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

Python script checkers #8

Merged
merged 10 commits into from
Nov 28, 2023
Merged

Python script checkers #8

merged 10 commits into from
Nov 28, 2023

Conversation

lpascal-ledger
Copy link
Contributor

@lpascal-ledger lpascal-ledger commented Nov 8, 2023

If this code is to last (and I think so), we better have some checks on it.
I've cleaned mostly aesthetic issues highlighted by the checks, however there remains:

  • copy-paste issues (functions like merge_json, run_cmd, git_setup)
  • dead code? (all the create_app_list/app_load_params_utils.py file)
  • type issues
    • in particular, nearly every dictionary access in build_and_tests are performed through dict.get, meaning all the related variable could be None, which clearly is not the case given how they are manipulated. I was under the impression that the parsed JSON was under our control, and so that we could trust its content and drop these dict.get for classic dict[index] access, but I'm not sure.
    • similar issue in create_app_list.app_load_params_check
    • there is something fishy in create_app_list/main.py:61: variant_json is a list, while merge_json accept dictionnaries. Not sure if it works (it seems to 🤷 ).

@sgliner-ledger
Copy link
Contributor

Do you want to merge this into develop or in your branch ? 🤔

@lpascal-ledger
Copy link
Contributor Author

I wanted to check if the PR would update to develop once the other branch is merged into develop.
If I back the branch into develop immediately, the commits of #7 would be displayed here.

Base automatically changed from lp/more_doc to develop November 13, 2023 16:28
@sgliner-ledger
Copy link
Contributor

Alright :) However I think we should fix all the checks before merging into develop. How do you want to proceed ?

@lpascal-ledger
Copy link
Contributor Author

lpascal-ledger commented Nov 13, 2023

As you wish really. I could change things still but as I'm not clear on the odds and ends, I could just break the code thinking I'm fixing it.
What do you think of current mypy output? Is there obvious fixers or does it require to change the code deeply?

@lpascal-ledger lpascal-ledger force-pushed the lp/basic_python_checks branch 2 times, most recently from a68781c to f8f556d Compare November 20, 2023 16:16
@lpascal-ledger
Copy link
Contributor Author

Here, less errors.
2 issues remains with mypy, but these are on you as I don't get how it works: merge_json is called with a list instead of a dict twice.

@lpascal-ledger lpascal-ledger force-pushed the lp/basic_python_checks branch 6 times, most recently from f804f2d to dc8c2b3 Compare November 21, 2023 14:20
@sgliner-ledger sgliner-ledger merged commit ce3aa38 into develop Nov 28, 2023
110 of 113 checks passed
@lpascal-ledger lpascal-ledger deleted the lp/basic_python_checks branch March 11, 2024 14:56
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