FormingWorlds / PROTEUS

Coupled atmosphere-interior framework to simulate the temporal evolution of rocky planets.
https://fwl-proteus.readthedocs.io
Apache License 2.0
12 stars 1 forks source link

Add linting config and fix linting issues #146

Closed stefsmeets closed 2 months ago

stefsmeets commented 2 months ago

This PR summarizes the changes made to master directly by accident last week:

I added a linting config, which will help catch a bunch of issues. See https://docs.astral.sh/ruff/rules/#pyflakes-f and https://docs.astral.sh/ruff/rules/#pycodestyle-e-w for more info.

I addressed many of the issues in the commits linked above.

In addition, in this PR I made the final changes to get the linter to be happy.

These changes address #131

TODO:

stefsmeets commented 2 months ago

@nichollsh Let me know what you think. If you are unhappy with any of the changes made to master, I can fix roll them back or fix them in this PR.

nichollsh commented 2 months ago

These changes look good! Is there a way to enforce a maximum line length of our choosing, rather than disabling the check entirely?

stefsmeets commented 2 months ago

Yeah, with ruff --format, but this will introduce a LOT of changes that I want to avoid in this PR.

stefsmeets commented 2 months ago

The ruff action has some issues with the config and does not seem well maintained. Might be worth to just run pre-commit directly, something like:

      - name: Run Pre-Commit
        uses: pre-commit/action@v3.0.0
        with:
          extra_args: --files $CHANGED_FILES

Using: https://github.com/marketplace/actions/changed-files

stefsmeets commented 2 months ago

@nichollsh I think this PR is ready to be merged!