Skip to content
This repository has been archived by the owner on Jul 30, 2024. It is now read-only.

Proposed CI updates #45

Merged
merged 3 commits into from
May 8, 2024
Merged

Conversation

katieworton
Copy link
Member

Noticed some gaps in the CI for this repo (black wasn't running for non-.py files), so decided to put together a quick cleanup of the CI pipeline for this repo that fixes this problem and adds a few more nice checks to the repo.

Adding the pre-commit config should make it easier to run all the CI checks in one go locally before pushing.

Run pre-commit hooks to cleanup repo so pre-commit hooks can be added to
the repo.

The following config was run:
repos:
-   repo: https://github.com/pre-commit/pre-commit-hooks
    rev: v4.5.0
    hooks:
    -   id: check-ast
    -   id: check-case-conflict
    -   id: check-executables-have-shebangs
    -   id: check-json
    -   id: check-yaml
    -   id: debug-statements
    -   id: detect-private-key
    -   id: end-of-file-fixer
    -   id: fix-byte-order-marker
    -   id: mixed-line-ending
    -   id: requirements-txt-fixer
    -   id: trailing-whitespace
-   repo: https://github.com/psf/black
    rev: 24.4.0
    hooks:
    -   id: black
        files: "^squad-.*|."
-   repo: https://github.com/pre-commit/mirrors-isort
    rev: v5.10.1
    hooks:
    -   id: isort
        args: ["--profile", "black"]
-   repo: https://github.com/pycqa/flake8
    rev: 7.0.0
    hooks:
    -   id: flake8
        files: "^squad-.*|."
        exclude: "dist/"
        args: ["--ignore", "E501,W503"]

This will then be added as a .pre-commit-config.yaml to the repo and can
be run in CI.

Signed-off-by: Katie Worton <[email protected]>
Add a pre-commit config to the repo to make it easier to run the
relevant formatters and linters which are run in the CI pipeline for
this repo.

This will make it easier to spot linter and formatter errors as the
tooling which runs in the CI pipeline can be run locally in one step.

Signed-off-by: Katie Worton <[email protected]>
Update the CI pipeline for this repo to make use of pre-commit. This
way, pre-commit and the CI pipeline will stay aligned.

Signed-off-by: Katie Worton <[email protected]>
@katieworton
Copy link
Member Author

@roxell let me know what you think!

@roxell roxell merged commit 56876c2 into Linaro:master May 8, 2024
1 check passed
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants