Skip to content

Formatting#51

Open
AlecThomson wants to merge 3 commits intolofar-astron:masterfrom
AlecThomson:formatting
Open

Formatting#51
AlecThomson wants to merge 3 commits intolofar-astron:masterfrom
AlecThomson:formatting

Conversation

@AlecThomson
Copy link
Contributor

Adds a pre-commit hook for formatting using ruff, and runs the formatter. The changes here are pretty much all whitespace.

The linter had to be disabled due to the large number of errors! For reference, the current list of reported errors can be found here. To run the linter simply run:

ruff check . --fix

in the root directory of RMextract.

Once these issues are resolved we should re-enable the linter in the pre-commit hook .i.e.

    # Run the linter.
    - id: ruff
      args: [ --fix ]

There is also a free CI service which can monitor the repo for future commits and PRs. See https://pre-commit.ci/.

Once solved, this closes #50

@gmloose
Copy link
Collaborator

gmloose commented May 6, 2024

Nice! 🤩
One thing I was wondering. Any reason to not use the pre-commit-ci GitHub action? Now the project depends on another 3rd party tool, which is also granted push/commit rights.

@AlecThomson
Copy link
Contributor Author

AlecThomson commented May 6, 2024

The pre-commit CI bot adds a few extra features (which may or may not be desirable). Notably it'll patch a mis-formatted PR automatically (coming in as a virtual collaborator), and also keep itself and the dependencies up-to-date with automated self-PRs. EDIT: See description here: https://pre-commit.ci/

The CI-lite action is indeed the 'liter' version, and acts as a more typical GH action.

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.

Code style

2 participants