Skip to content

Add pre-commit hooks to lint code#74

Merged
indiVar0508 merged 7 commits intomasterfrom
chore_items
Feb 16, 2023
Merged

Add pre-commit hooks to lint code#74
indiVar0508 merged 7 commits intomasterfrom
chore_items

Conversation

@indiVar0508
Copy link
Copy Markdown
Contributor

No description provided.

@indiVar0508 indiVar0508 linked an issue Feb 7, 2023 that may be closed by this pull request
@indiVar0508 indiVar0508 force-pushed the chore_items branch 2 times, most recently from c544b58 to a024fc7 Compare February 7, 2023 14:01
@@ -0,0 +1,5 @@
repos:
- repo: https://github.com/pre-commit/pre-commit-hooks
Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

pre-commit and link are not tied together.
We should use pre-commit as a subset of the lint checks we do in github actions.

We should add flake8 to the project (independent of pre-commit) and merge that as a separate commit

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

After than, another commit for add pre-commit
And document in this file maybe that the pre-commit configurations for black have not been added because of py3.6 compat issues between pre-commit and black

- uses: psf/black@stable

test-sqlite:
needs:
Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Chaining the tasks seems to increase CI time
So, can we run lint in parallel with the other tests
BUT can we configure github-actions to STOP all jobs if any 1 job fails.
i.e. if lint fails in 2mins (because of an extra space), stop all the tests

@indiVar0508 indiVar0508 force-pushed the chore_items branch 5 times, most recently from 4d11490 to 2e09022 Compare February 9, 2023 10:36
make lint an independent job for workflow
adding generic_repr method provided by sqla-utils package
to be used for attaching a generic __repr__ method to all
versioned class.
passing primary_keys to generic_repr to be shown along with
transaction_id and operation_type
@indiVar0508 indiVar0508 force-pushed the chore_items branch 3 times, most recently from d4a1059 to 130b6e4 Compare February 16, 2023 06:17
- adding flake8 github actions check for lint
- adding flake8 in pyproject.toml
- refactor sqlalchemy_history module code according
to flake8
- refactor tests directory according to flake8
enable flake8 for pre-commit check
@indiVar0508
Copy link
Copy Markdown
Contributor Author

Will add concurrent job halting of jobs if a single job fails,
have asked queries in this discussion

@indiVar0508 indiVar0508 merged commit cae1328 into master Feb 16, 2023
@indiVar0508 indiVar0508 deleted the chore_items branch February 16, 2023 07:01
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

add commit lint in githooks

2 participants