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

Code qa refresh #568

Merged
merged 7 commits into from
Nov 21, 2024
Merged

Code qa refresh #568

merged 7 commits into from
Nov 21, 2024

Conversation

pp-mo
Copy link
Member

@pp-mo pp-mo commented Nov 19, 2024

Replaces #564

Don't understand why this was needed, since the branch location is the same.
Seems like GitHub got confused somehow by my adding a commit + then removing it

@pp-mo pp-mo requested a review from ukmo-ccbunney November 19, 2024 12:03
Copy link
Contributor

@ukmo-ccbunney ukmo-ccbunney left a comment

Choose a reason for hiding this comment

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

As per your other PR, this looks good.
Remember to raise an issue for the ignored numpydoc tests.

Copy link
Contributor

@ukmo-ccbunney ukmo-ccbunney left a comment

Choose a reason for hiding this comment

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

Actually - jsut spotted one thing:

ruff-pre-commit hook is now version 0.7.4, you've got it as 0.7.3

Can you update?

@codecov-commenter
Copy link

codecov-commenter commented Nov 19, 2024

Codecov Report

All modified and coverable lines are covered by tests ✅

Project coverage is 89.60%. Comparing base (9425d19) to head (f8bdc8d).
Report is 33 commits behind head on main.

Additional details and impacted files
@@           Coverage Diff           @@
##             main     #568   +/-   ##
=======================================
  Coverage   89.60%   89.60%           
=======================================
  Files           8        8           
  Lines        2473     2473           
  Branches      420      420           
=======================================
  Hits         2216     2216           
  Misses        159      159           
  Partials       98       98           

☔ View full report in Codecov by Sentry.
📢 Have feedback on the report? Share it here.

@pp-mo
Copy link
Member Author

pp-mo commented Nov 19, 2024

ruff-pre-commit hook is now version 0.7.4, you've got it as 0.7.3

Just added in a re-ordering of the pre-commit hooks to match the current template order.

@ukmo-ccbunney
Copy link
Contributor

ruff-pre-commit hook is now version 0.7.4, you've got it as 0.7.3

Just added in a re-ordering of the pre-commit hooks to match the current template order.

You are still running on 0.7.3 for Ruff though.

@pp-mo
Copy link
Member Author

pp-mo commented Nov 20, 2024

You are still running on 0.7.3 for Ruff though.

Sorry, missed including that somehow!

@ukmo-ccbunney
Copy link
Contributor

I wonder if rather than setting strict=false in your [tools.mypy] section, it would be better to set strict=true and capture all the failing error codes?

For iris-grib, this would require the following ignores in the pyproject.toml:

strict = true 
disable_error_code =  [
    "arg-type",
    "assignment",
    "attr-defined",
    "index",
    "misc",
    "name-defined",
    "no-untyped-call",
    "no-untyped-def",
    "override",
    "type-arg",
    "union-attr",
    "var-annotated",
]

These can then all be added to a new issue documenting the failing mypy tests for iris-grib?

What do you think?

@pp-mo
Copy link
Member Author

pp-mo commented Nov 20, 2024

I wonder if rather than setting strict=false in your [tools.mypy] section, it would be better to set strict=true and capture all the failing error codes?
... What do you think?

Well, here's one way of looking at what that does ...

$ mypy . --no-color-output | grep -oE "\[[^[]*\]*\]$" errs.txt | sort | uniq -c
      9 [arg-type]
      8 [assignment]
    198 [attr-defined]
      5 [index]
     15 [misc]
     12 [name-defined]
   1421 [no-untyped-call]
    964 [no-untyped-def]
      3 [override]
      5 [type-arg]
     27 [union-attr]
     19 [var-annotated]

@pp-mo
Copy link
Member Author

pp-mo commented Nov 20, 2024

I wonder if rather than setting strict=false in your [tools.mypy] section, it would be better to set strict=true and capture all the failing error codes?

Done, I think.
See f8bdc8d

I don't know why the numbers don't seem to add up.
Presumably the settings are not independent so that, if all those checks are turned back "on", other errors emerge which rely on more than one of them being "on"

Copy link
Contributor

@ukmo-ccbunney ukmo-ccbunney left a comment

Choose a reason for hiding this comment

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

OK. I think we're good to go.

@ukmo-ccbunney ukmo-ccbunney merged commit a9d656c into SciTools:main Nov 21, 2024
10 checks passed
@pp-mo
Copy link
Member Author

pp-mo commented Nov 21, 2024

Brilliant, thanks @ukmo-ccbunney !!

To complete this work :

This was referenced Nov 21, 2024
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.

3 participants