Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Add pre commit hook #2352

Merged
merged 21 commits into from
Dec 19, 2024
Merged

Add pre commit hook #2352

merged 21 commits into from
Dec 19, 2024

Conversation

ashrafchowdury
Copy link
Collaborator

@ashrafchowdury ashrafchowdury commented Dec 8, 2024

Description

This PR aims to add a pre-commit and a pre-push hook to check our code format and lint type check before we push the code.

  • Pre-commit hook:
    • Check the prettier code format style for the FE if any changes are made in the FE directory if not then it will avoid the check.
    • Check the black code format style for the BE if any changes are made in the BE directory if not then it will avoid the check.
  • Pre-push:
    • Frontend: Runs Eslint and Typescript type check to ensure code quality
    • Backend/CLI: Runs Pylint to ensure code quality

Related Issue

Closes AGE-1441

Related PRs

https://github.com/Agenta-AI/agenta_cloud/pull/527

⚠️⚠️ Note: To activate the pre-commit/pre-push hook you have to install frontend dependencies by running npm install otherwise the hook will not work ⚠️⚠️

Copy link

vercel bot commented Dec 8, 2024

The latest updates on your projects. Learn more about Vercel for Git ↗︎

Name Status Preview Comments Updated (UTC)
agenta ✅ Ready (Inspect) Visit Preview 💬 Add feedback Dec 19, 2024 9:04am
agenta-documentation ✅ Ready (Inspect) Visit Preview 💬 Add feedback Dec 19, 2024 9:04am

@ardaerzin
Copy link
Contributor

@ashrafchowdury might be worthwhile to compare performance of pre-commit vs pre-push hooks, IF the wait in pre-commit is longer than expected

@mmabrouk mmabrouk changed the base branch from main to dev December 11, 2024 12:01
Copy link
Contributor

@jp-agenta jp-agenta left a comment

Choose a reason for hiding this comment

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

@ashrafchowdury there is a chance that pylint makes everything fails because there are many unresolved errors. :D

Copy link
Contributor

@ardaerzin ardaerzin left a comment

Choose a reason for hiding this comment

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

Seal of Approval

@ashrafchowdury
Copy link
Collaborator Author

We should disable the pylint checks for now otherwise it will prevent us from pushing the branch

@ardaerzin
Copy link
Contributor

QA'ed and had no issues ✔️ @mmabrouk

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
devops size:L This PR changes 100-499 lines, ignoring generated files.
Projects
None yet
Development

Successfully merging this pull request may close these issues.

4 participants