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 git hooks support #8251

Merged
merged 46 commits into from
Nov 14, 2024
Merged

Add git hooks support #8251

merged 46 commits into from
Nov 14, 2024

Conversation

kairu-ms
Copy link
Contributor

@kairu-ms kairu-ms commented Nov 8, 2024


This checklist is used to make sure that common guidelines for a pull request are followed.

Related command

Add pre-commit with secret detected.
image

Add pre-push with style, linter, and tests check.
image
image

General Guidelines

  • Have you run azdev style <YOUR_EXT> locally? (pip install azdev required)
  • Have you run python scripts/ci/test_index.py -q locally? (pip install wheel==0.30.0 required)
  • My extension version conforms to the Extension version schema

For new extensions:

About Extension Publish

There is a pipeline to automatically build, upload and publish extension wheels.
Once your pull request is merged into main branch, a new pull request will be created to update src/index.json automatically.
You only need to update the version information in file setup.py and historical information in file HISTORY.rst in your PR but do not modify src/index.json.

Copy link

azure-client-tools-bot-prd bot commented Nov 8, 2024

️✔️Azure CLI Extensions Breaking Change Test
️✔️Non Breaking Changes

Copy link

Hi @kairu-ms,
Please write the description of changes which can be perceived by customers into HISTORY.rst.
If you want to release a new extension version, please update the version in setup.py as well.

@yonzhan
Copy link
Collaborator

yonzhan commented Nov 8, 2024

Thank you for your contribution! We will review the pull request and get back to you soon.

Copy link

github-actions bot commented Nov 8, 2024

.gitattributes Outdated Show resolved Hide resolved
@@ -0,0 +1,13 @@
#!/usr/bin/env sh
":" //; if command -v pwsh >/dev/null 2>&1; then pwsh -ExecutionPolicy Bypass -File .githooks/pre-commit.ps1; else sh .githooks/pre-commit.sh; fi; exit $? # Try PowerShell Core first, then sh on Unix
Copy link
Member

Choose a reason for hiding this comment

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

The script assumes that the commit operation is executed from the repository's root directory. It uses relative paths like .githooks/xxx and .githooks\xxx to locate the hook scripts. If the commit command is run from a subdirectory, these paths will not resolve correctly, leading to errors because the scripts cannot be found.

Copy link
Contributor Author

Choose a reason for hiding this comment

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

Actually it can work in the subdirectory
image

@wangzelin007
Copy link
Member

Could you confirm if these scripts have been tested on macOS to ensure they work correctly?

Copy link

CodeGen Tools Feedback Collection

Thank you for using our CodeGen tool. We value your feedback, and we would like to know how we can improve our product. Please take a few minutes to fill our codegen survey

kairu-ms and others added 10 commits November 12, 2024 15:55
Co-authored-by: ZelinWang <zelinwang@microsoft.com>
Co-authored-by: ZelinWang <zelinwang@microsoft.com>
Co-authored-by: ZelinWang <zelinwang@microsoft.com>
Co-authored-by: ZelinWang <zelinwang@microsoft.com>
@kairu-ms kairu-ms requested a review from AllyW November 14, 2024 07:15
@kairu-ms kairu-ms merged commit fd0946c into Azure:main Nov 14, 2024
21 checks passed
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.

4 participants