pelican icon indicating copy to clipboard operation
pelican copied to clipboard

Linted: apply *isort* and *black*

Open minchinweb opened this issue 4 years ago • 5 comments

Working on #2897, I discovered that the codebase didn't conform to either isort (import sorting) or black (general code formating). This resolves both.

As a possible expasion of this, black and isort may be desirable to be added to the pre-commit setup and/or the lint CI testing.

  • [x] Ensured tests pass and (if applicable) updated functional test output
  • [x] Conformed to code style guidelines by running appropriate linting tools
  • [ n/a ] Added tests for changed code
  • [ n/a ] Updated documentation for changed code

minchinweb avatar Jul 01 '21 06:07 minchinweb

This may cover much of the same ground as #2889

minchinweb avatar Jul 01 '21 06:07 minchinweb

Lint checker is not happy

avaris avatar Jul 02 '21 13:07 avaris

FYI... The reason that these code formatting tools haven't been used on the Pelican codebase up until this point is that there are existing pull requests in the queue, and I didn't want to cause merge conflicts with those PRs until they can be reviewed and cleared out of the queue. 😊

justinmayer avatar Jul 02 '21 13:07 justinmayer

The linter isn't happy because flake8 doesn't like the import order we're using with isort here. Drop flake8? Configure it to like the isort style I'm using here?

minchinweb avatar Jul 03 '21 02:07 minchinweb

let me know if you need a flake8 config that plays nice with isort. i have one lying around.

ingwinlu avatar Nov 27 '21 09:11 ingwinlu

This has since been obviated by #3231. But many thanks nonetheless for the PR, @MinchinWeb.

justinmayer avatar Oct 30 '23 18:10 justinmayer

Happy to help! I've been watching Ruff for a while, so I'm interested to see how it's adoption plays out here...

minchinweb avatar Nov 02 '23 02:11 minchinweb