scrapinghub / spidermon

Scrapy Extension for monitoring spiders execution.
https://spidermon.readthedocs.io
BSD 3-Clause "New" or "Revised" License
526 stars 94 forks source link

fix: CI is currently failing on master #385

Closed curita closed 1 year ago

curita commented 1 year ago

Issue

Newly opened PRs are failing in their Python 3.10 build (reference).

Cause

This looks to be caused by the black check, which in its latest version introduced some new rules (removing new lines after class and function declarations, adding trailing commas to the last elements of iterables, etc.).

Proposal

To avoid these errors from happening, we could run the latest version of black over the whole codebase and/or pin its version.

VMRuiz commented 1 year ago

@kmike Suggested using pre-commit instead Example from Scrapy: https://github.com/scrapy/scrapy/blob/master/.pre-commit-config.yaml

rennerocha commented 1 year ago

pre-commit is a good improvement into the project. I am using in all my current projects. We can add a pre-commit run --all call in the build, so it will fail if the formatting (and other tests) fail, avoiding us to commit code that doesn't match. Probably it will require one big commit to format the entire project once.

VMRuiz commented 1 year ago

The project is already formatted with Black, and only a few files needs to be reformatted with the new rules of black 23.1.0 so introducing this won't cause a huge diff.