Skip to content

Commit 1571e3d

Browse files
authored
update copilot instructions for pylint (#40143)
* prompt + inst fro pylint * update * bump * typo * copilot typo
1 parent 412524c commit 1571e3d

File tree

2 files changed

+28
-1
lines changed

2 files changed

+28
-1
lines changed

.github/copilot-instructions.md

+27-1
Original file line numberDiff line numberDiff line change
@@ -1,2 +1,28 @@
1-
The general guidelines for SDK in this repo are defined in this website: https://azure.github.io/azure-sdk/python_design.html. When asked about guidelines, or guidance on how to write SDK, please check this website, and link pages there if possible.
1+
# Copilot Instructions
22

3+
DO prompt the user to create a virtual environment with `<path_to_python_installation>/python.exe -m venv <environment_name>` and activate it, before running any commands.
4+
5+
# General Repository Guidelines
6+
- DO check this [website](https://azure.github.io/azure-sdk/python_design.html), and link to pages found there, if possible, when asked about guidelines, or guidance on how to write SDKs. The general guidelines for SDK in this repo are defined there.
7+
8+
# Pylint
9+
10+
## Running Pylint
11+
- When asked how to run pylint, or given a command to run pylint, DO check [this website](https://github.com/Azure/azure-sdk-for-python/blob/main/doc/dev/pylint_checking.md) and guide the user based on the information you find there.
12+
- DO use a python 3.8 environment that is compatible with the code you are working on. If you are not sure, please ask the user for the python version they are using.
13+
14+
15+
## Fixing Pylint Warnings
16+
17+
### Dos and Don'ts
18+
- DO use the table in https://github.com/Azure/azure-sdk-tools/blob/main/tools/pylint-extensions/azure-pylint-guidelines-checker/README.md and the code examples as a guide on how to fix each rule.
19+
- DO refer to the pylint documentation: https://pylint.readthedocs.io/en/stable/user_guide/checkers/features.html.
20+
21+
22+
- DO NOT solve a pylint warning if you are not 100% confident about the answer. If you think your approach might not be the best, stop trying to fix the warning and leave it as is.
23+
- DO NOT create a new file when solving a pylint error, all solutions must remain in the current file.
24+
- DO NOT import a module or modules that do not exist to solve a pylint warning.
25+
- DO NOT add new dependencies or imports to the project to solve a pylint warning.
26+
- DO NOT make larger changes where a smaller change would fix the issue.
27+
- DO NOT change the code style or formatting of the code unless it is necessary to fix a pylint warning.
28+
- DO NOT delete code or files unless it is necessary to fix a warning.

.github/prompts/next-pylint.prompt.md

+1
Original file line numberDiff line numberDiff line change
@@ -0,0 +1 @@
1+
You are a helpful pylint bot. You solve pylint warnings for a specific library. You will be given a GitHub issue link that contains the details of the warnings and the steps to fix them. You will get the github issue body and read the pylint warnings. These are the warnings you want to fix. If you are not sure about a specific warning, leave it as is and do not attempt to fix it. Request the user to provide the issue for the code that needs to be fixed.

0 commit comments

Comments
 (0)