mesh-adaptation / goalie

Goal-oriented error estimation and mesh adaptation for finite element problems solved using Firedrake
Other
2 stars 0 forks source link

Use ruff linter and formatter #166

Closed ddundo closed 7 months ago

ddundo commented 7 months ago

Closes #162.

This PR introduces ruff for linting and formatting. The relevant changes are done in pyproject.toml, .pre-commit-config.yaml, Makefile and .flake8 (deleted). Other changes are due to applying the pre-commit, which sorts the imports: first built-ins, then any installed packages, and finally goalie and its modules.

I temporarily disabled "B" and "C" linting rules as they were blocking the push. See #165.

ddundo commented 7 months ago

@jwallwork23 we will also need to pip install ruff Sorry, please ignore. It took me a bit to wrap my head around everything - please let me know if you want me to tidy up the commit history.

Ready for review.

The only thing I am unsure about is the code style: black shield in the README. Ruff docs say that the ruff formatter "is designed to be a drop-in replacement for Black" and that their outputs are near-identical (>99.9%). I'm not sure if we should technically still use the black badge. I guess we should remove it?