You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
* docs: Add a callout that using pre-commit speeds up PR review
* docs: Remove conclusion
* docs: Add a section describing how to resolve failing `pre-commit` check
* docs: Add a callout about approval process for PR checks
* fix, docs: Don't nest callouts
* fix,docs: Grammar
[pre-commit](https://pre-commit.com/) is a tool that enables us to run code when committing to a local repository. We
65
65
use this to automate running code formatters, linters, etc...
66
66
67
-
To install pre-commit in the repository, run the following from the root of the repository:
67
+
To enable `pre-commit`, run the following from the root of the repository:
68
68
69
69
```shell
70
70
pre-commit install
71
71
```
72
72
73
-
`pre-commit` will run automatically when you commit changes, but you can also manually run it using
74
-
`pre-commit run --all-files`.
73
+
`pre-commit` will now automatically run a series of code quality checks when you commit changes, which
74
+
will accelerate the identification of issues that will be flagged when the PR is submitted.
75
+
76
+
If needed, you can manually run `pre-commit` against all files with `pre-commit run --all-files`. See
77
+
[the documentation for `pre-commit run`](https://pre-commit.com/#pre-commit-run) for more information.
75
78
76
79
Note:
77
80
@@ -115,8 +118,6 @@ Note that samples are organized by scenario, find the one best-suited for your s
115
118
git push -f
116
119
```
117
120
118
-
That's it! Thank you for your contribution!
119
-
120
121
> [!IMPORTANT]
121
122
>
122
123
> You should expect to budget time to engage with reviewers (responding to comments, fixing PR checks) before your PR is merged in. This is especially
@@ -125,6 +126,45 @@ That's it! Thank you for your contribution!
125
126
> Adhering to the guidance in this document (i.e [using pre-commit](#3-set-up-pre-commit), [using provided templates](#write-your-contribution)) ***will***
126
127
>help expedite the review process.
127
128
129
+
#### Resolve Failing Pull Request Checks
130
+
131
+
132
+
> [!IMPORTANT]
133
+
>
134
+
> This repository requires approval from someone with write access for pull request checks
135
+
> to run against a PR, to avoid abuse of live resources.
136
+
>
137
+
> All of the PR checks can also be run from developers machine, which should prevent the approval
138
+
> processes from unnecessarily lengthening the feedback cycle.
139
+
140
+
> [!NOTE]
141
+
> If you are a Microsoft employee, you can skip the approval process for PR checks by:
142
+
>
143
+
>* Joining the "[Azure-Samples](https://github.com/Azure-Samples)" organization
144
+
>* [Setting your org membership visibility to public](https://docs.github.com/en/account-and-profile/setting-up-and-managing-your-personal-account-on-github/managing-your-membership-in-organizations/publicizing-or-hiding-organization-membership#changing-the-visibility-of-your-organization-membership)
145
+
>
146
+
147
+
##### pre-commit
148
+
149
+
###### black
150
+
151
+
[black](https://github.com/psf/black) is a code formatter for Python and Jupyter notebooks.
152
+
153
+
**How to Fix**: If the `pre-commit` check is failing on your PR because of `black`, just run `pre-commit run black --all-files` and commit the changes.
154
+
155
+
###### nb-clean
156
+
157
+
[nb-clean](https://github.com/srstevenson/nb-clean) that removes metadata from Jupyter Notebooks to make them more ammenable to version control.
158
+
159
+
**How to Fix**: If the `nb-clean` check is failing on your PR because of `nb-clean`, just run `pre-commit run nb-clean --all-files` and commit the changes.
160
+
161
+
###### ruff
162
+
163
+
[ruff](https://github.com/astral-sh/ruff) is a linter for Python and Jupyter Notebooks.
164
+
165
+
**How to Fix**: If the `pre-commit` step is failing on your PR because of `ruff`:
166
+
* ruff makes an attempt to automatically fix issues it detects. You can run `pre-commit run ruff --all-files` and commit any changes.
167
+
* Issues that ruff can't fix should be manually updated and committed. See ruff's [rule list](https://docs.astral.sh/ruff/rules/) for more info on issues it reports.
0 commit comments