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

Add linting for python code #34

Merged
merged 4 commits into from
Sep 19, 2023

Conversation

xylar
Copy link

@xylar xylar commented Sep 19, 2023

New linting for all file types includes:

  • checking for trailing whitespace
  • checking for correct end-of-file

New linting for python code includes:

  • sorting imports
  • using f-strings to format strings
  • following PEP8 code style (with flake8)
  • variable type checking with mypy

The conf.py file in the doc directory has been linted using these new tools.

Documentation has been added on linting.

Issues with trailing whitespace and incorrect end-of-file formatting have been fixed in many, many files.

Checklist

  • Documentation:
    • Developer's Guide has been updated
    • Documentation has been built locally and changes look as expected

This includes:
* checking for trailing whitespace
* checking for correct end-of-file
* sorting imports
* using f-strings to format strings
* following PEP8 code style (with flake8)
* variable type checking with mypy
@xylar xylar added documentation Improvements or additions to documentation linting and CI labels Sep 19, 2023
@xylar xylar requested a review from philipwjones September 19, 2023 12:59
Copy link

@philipwjones philipwjones left a comment

Choose a reason for hiding this comment

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

Looks good, thanks for adding this @xylar Clearly needed based on all the changes as a resulting of linting.

@philipwjones philipwjones merged commit f085ec4 into E3SM-Project:develop Sep 19, 2023
@xylar xylar deleted the omega/add-python-linting branch September 19, 2023 17:50
@xylar
Copy link
Author

xylar commented Sep 19, 2023

Thanks @philipwjones. I'd like to turn on the remaining C++ linting but it seems to want to actually build the code with cmake, which is a lot more complicated than I realized that workflow was going to be. Perhaps we can chat about that at some point soon, but I'll first need to take some time to even see if I can get it working on some machine or other.

amametjanov pushed a commit that referenced this pull request Dec 5, 2023
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
documentation Improvements or additions to documentation linting and CI
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants