Skip to content

Start enforcing pre-commit? #45

@soxofaan

Description

@soxofaan

I added a pre-commit config pretty early in June to get some basic static code quality management in place. At the moment using pre-commit is optional (opt-in) for developers and I noticed that quite some code style issues are slipping in the repo

e.g. after running pre-commit run --all-files to fix various issue, I get these diff stats currently:

$ git diff --stat 
 algorithm_catalog/max_ndvi_composite.json          |  11 +-
 .../max_ndvi_composite_description.md              |  10 +-
 benchmark_scenarios/max_ndvi_composite.json        |   4 +-
 benchmark_scenarios/worldcereal.json               |  15 +-
 openeo_udp/examples/max_ndvi_composite/generate.py |  84 +++++---
 .../max_ndvi_composite/max_ndvi_composite.json     |   2 +-
 openeo_udp/worldcereal_inference.json              |   6 +-
 openeo_udp_cost_profiling/utils.py                 | 220 ++++++++++++---------
 qa/unittests/tests/test_algorithm_catalog.py       |   5 +-
 9 files changed, 212 insertions(+), 145 deletions(-)

While I understand that playing pedantic code style police is not the point of this project, I still think this project plays an exemplary role in the ecosystem and we should set some bar related to code quality and give nice and consistent examples.

I think we can start with running a pre-commit check as github action to flag new issues

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type
    No fields configured for issues without a type.

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions