lofar-astron / RMextract

extract TEC, vTEC, Earthmagnetic field and Rotation Measures from GPS and WMM data for radio interferometry observations
GNU General Public License v3.0
31 stars 22 forks source link

Formatting #51

Open AlecThomson opened 4 months ago

AlecThomson commented 4 months ago

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 commented 4 months ago

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 commented 4 months ago

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.