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

Util: Adding git pre-commit checks (PROJQUAY-4658) #1585

Merged
merged 2 commits into from
Oct 25, 2022

Conversation

Sunandadadi
Copy link
Contributor

@Sunandadadi Sunandadadi commented Oct 24, 2022

The PR adds pre-commit hooks that are run before every commit on git. Primarily, it check when committing config files like local-dev/stack/config.yaml. Other checks include:
trailing-whitespace check
end-of-file check (stripping multiple extra lines at the end of file)
gitleaks
black

Please run the following in the quay directory where the repo is forked:
pip install pre-commit==2.20.0
pre-commit install

After completion, If changes are committed to local-dev/stack/config.yaml, the commit should fail with an error message.
The checks can be bypassed using --no-verify option with git commit.

@Sunandadadi Sunandadadi changed the title Util: Adding git pre-commit checks (PROJQUAY-0000) Util: Adding git pre-commit checks (PROJQUAY-4658) Oct 24, 2022
Copy link
Contributor

@syed syed left a comment

Choose a reason for hiding this comment

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

LGTM

@HammerMeetNail
Copy link
Contributor

@Sunandadadi Can you add a make target that installs the dependency and then does the pre-commit install?

@Sunandadadi
Copy link
Contributor Author

@Sunandadadi Can you add a make target that installs the dependency and then does the pre-commit install?

Can I add that in another PR? I want to clean up existing pre-commit checks (black).

@Sunandadadi Sunandadadi merged commit e8e5d5d into quay:master Oct 25, 2022
@Sunandadadi Sunandadadi deleted the pre-commit branch October 25, 2022 14:11
HammerMeetNail pushed a commit to HammerMeetNail/quay that referenced this pull request Dec 7, 2022
* Util: Adding git pre-commit checks (PROJQUAY-0000)

* updating getting started markdown
HammerMeetNail added a commit that referenced this pull request Dec 7, 2022
* Util: Adding git pre-commit checks (PROJQUAY-4658) (#1585)

* Util: Adding git pre-commit checks (PROJQUAY-0000)

* updating getting started markdown

* ui: Add script for adobe analytics for quay.io (PROJQUAY-4582) (#1648)

Analytics will be added only when building for quay.io

* secscan: Correct links (PROJQUAY-2164) (#1552)

Use first link in the "array", don't display link icon when
no links exist.

Signed-off-by: crozzy <joseph.crosland@gmail.com>

* ui: Show UI toggle on quay.io only to redhat users (PROJQUAY-4804) (#1653)

ui: Show UI toggle on quay.io only to redhat users (PROJQUAY-4804)

New UI preview on quay.io is being released as a preview only
to RedHat users before being GA

* Update nginx config (#1639)

Signed-off-by: Dave O'Connor <doconnor@redhat.com>

* ui: Add script for adobe analytics for quay.io in angular UI (PROJQUAY-4582) (#1654)

This will be used for usage analytics on quay.io

* Add cookie consent for quay.io (#1657)

* ui: Remove FEATURE_UI_V2 from analytics scripts (PROJQUAY-4582) (#1658)

* ui: Remove FEATURE_ from feature_set in base template (PROJQUAY-4582)

the variable `feature_set` has features with the `FEATURE_` prefix
removed. Fix the jinja check for this

* remove feature_ui_v2

Signed-off-by: crozzy <joseph.crosland@gmail.com>
Signed-off-by: Dave O'Connor <doconnor@redhat.com>
Co-authored-by: Sunandadadi <Sunandadadi@users.noreply.github.com>
Co-authored-by: Syed Ahmed <syed@apache.org>
Co-authored-by: Joseph Crosland <joseph.crosland@gmail.com>
HammerMeetNail added a commit to openshift-cherrypick-robot/quay that referenced this pull request Dec 12, 2022
* Util: Adding git pre-commit checks (PROJQUAY-4658) (quay#1585)

* Util: Adding git pre-commit checks (PROJQUAY-0000)

* updating getting started markdown

* ui: Add script for adobe analytics for quay.io (PROJQUAY-4582) (quay#1648)

Analytics will be added only when building for quay.io

* secscan: Correct links (PROJQUAY-2164) (quay#1552)

Use first link in the "array", don't display link icon when
no links exist.

Signed-off-by: crozzy <joseph.crosland@gmail.com>

* ui: Show UI toggle on quay.io only to redhat users (PROJQUAY-4804) (quay#1653)

ui: Show UI toggle on quay.io only to redhat users (PROJQUAY-4804)

New UI preview on quay.io is being released as a preview only
to RedHat users before being GA

* Update nginx config (quay#1639)

Signed-off-by: Dave O'Connor <doconnor@redhat.com>

* ui: Add script for adobe analytics for quay.io in angular UI (PROJQUAY-4582) (quay#1654)

This will be used for usage analytics on quay.io

* Add cookie consent for quay.io (quay#1657)

* ui: Remove FEATURE_UI_V2 from analytics scripts (PROJQUAY-4582) (quay#1658)

* ui: Remove FEATURE_ from feature_set in base template (PROJQUAY-4582)

the variable `feature_set` has features with the `FEATURE_` prefix
removed. Fix the jinja check for this

* remove feature_ui_v2

Signed-off-by: crozzy <joseph.crosland@gmail.com>
Signed-off-by: Dave O'Connor <doconnor@redhat.com>
Co-authored-by: Sunandadadi <Sunandadadi@users.noreply.github.com>
Co-authored-by: Syed Ahmed <syed@apache.org>
Co-authored-by: Joseph Crosland <joseph.crosland@gmail.com>
@HammerMeetNail
Copy link
Contributor

#1587 was the follow up

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Development

Successfully merging this pull request may close these issues.

3 participants