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 flynt package to linter for updating format strings #74

Merged
merged 1 commit into from
Jul 5, 2023

Conversation

altheaden
Copy link
Collaborator

@altheaden altheaden commented May 31, 2023

Flynt is a package that automatically converts older-style formatting strings to f-strings. I've added this to pre-commit so that any incoming changes will use f-strings by default.

Checklist

  • Developer's Guide has been updated
  • API documentation in the Developer's Guide (api.md) has any new or modified class, method and/or functions listed
  • Documentation has been built locally and changes look as expected

@altheaden
Copy link
Collaborator Author

This is a draft PR because we are waiting on Flynt being added to conda-forge. @xylar and I made a merge request there, and it's waiting for review. This PR depends on those changes being accepted.

@altheaden altheaden requested a review from xylar May 31, 2023 03:04
@altheaden altheaden added the in progress This PR is not ready for review or merging label May 31, 2023
@altheaden altheaden removed the request for review from xylar May 31, 2023 03:05
Copy link
Collaborator

@xylar xylar left a comment

Choose a reason for hiding this comment

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

Looks great! Just waiting on:
conda-forge/staged-recipes#22931

rev: '0.78'
hooks:
- id: flynt
args: ["--fail-on-change", "--verbose"]
Copy link
Collaborator

Choose a reason for hiding this comment

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

As we discussed, this is a great starting point. We'll play with these flags as we get more experience.

@altheaden altheaden added deployment Changes relate to creating conda and Spack environments, and creating a load script documentation Improvements or additions to documentation labels May 31, 2023
This will convert format strings to f strings when possible
Copy link
Collaborator

@xylar xylar left a comment

Choose a reason for hiding this comment

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

Approving based on an inspection of the changes (assuming the CI tests pass).

@xylar xylar removed their assignment Jul 5, 2023
@xylar xylar removed the in progress This PR is not ready for review or merging label Jul 5, 2023
@altheaden altheaden marked this pull request as ready for review July 5, 2023 17:51
@altheaden altheaden merged commit ffe9f0b into E3SM-Project:main Jul 5, 2023
5 checks passed
@altheaden altheaden deleted the add-flynt-to-pre-commit branch July 5, 2023 17:54
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
deployment Changes relate to creating conda and Spack environments, and creating a load script documentation Improvements or additions to documentation
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants