Skip to content

Commit 2852a92

Browse files
committed
feat: update ruff linting page
1 parent 965e5c4 commit 2852a92

File tree

1 file changed

+15
-13
lines changed

1 file changed

+15
-13
lines changed

docs/documentation/code-format-lint.md

+15-13
Original file line numberDiff line numberDiff line change
@@ -33,13 +33,9 @@ consistency and catches errors early.
3333

3434
While pre-commit is a powerful tool to add to your workflow, many do not like it:
3535

36-
* For beginner contributors, running pre-commit hooks can be confusing. You need
37-
to understand that each time you commit, it will run the checks. If it finds
38-
issues in your files, it will not actually commit your files to history. This
39-
can be confusing for even seasoned developers if they haven't used pre-commit
40-
before.
41-
* Some prefer to set up autoformatters that run every time you save a file in
42-
your preferred code editor (like VSCode). More on that below.
36+
-* For beginner contributors, running pre-commit hooks can be confusing. Each time you commit, the hooks will run checks. If issues are found in your files, they will not be committed to history. This can be confusing even for seasoned developers who are new to pre-commit. Remember, it is *your* local development environment. You are not obliged to install pre-commit hooks, and you can remove them at any time with `pre-commit uninstall`. To bypass the hooks for a single commit, you can use `git commit --no-verify`. However, skipping these hooks might require formatting your code through other means later.
37+
38+
* Some developers prefer to set up auto-formatters that run every time you save a file in your preferred code editor (like VSCode). More on that below.
4339

4440
## Pre-commit.ci Bot
4541

@@ -48,8 +44,8 @@ repository to run pre-commit checks in an online continuous integration pipeline
4844
The bot will run any pre-commit hooks that you have set up on new pull requests
4945
submitted to your repository.
5046

51-
Pre-commit.ci can be a nice tool to use for pull requests if set up correctly.
52-
Ideally, you can set pre-commit CI to run only when you call it in a pull
47+
Pre-commit.ci can be a useful tool to use for pull requests if set up correctly.
48+
Ideally, you can set the pre-commit.CI bot to run only when you call it in a pull
5349
request. This way, if you have a new contributor (or a seasoned one) who doesn't
5450
want to set up pre-commit locally, or someone who wants to submit a pull request
5551
(e.g., as a first contribution!) fully from the GitHub interface, you can enable
@@ -64,7 +60,7 @@ TODO: More here on setting this up in VSCode and other tools.
6460

6561
## VSCode
6662

67-
1. Make sure you have the the Python extension for vscode installed:
63+
1. Make sure you have the the Python extension for VSCode installed:
6864

6965
1. **Install Ruff:**
7066
Ensure you have Ruff installed in your environment. You can install it using pip:
@@ -85,11 +81,17 @@ files every time you edit and save them.
8581
"editor.defaultFormatter": "charliermarsh.ruff",
8682
"editor.codeActionsOnSave": {
8783
"source.fixAll": "always",
88-
"source.organizeImports": "always",
89-
},
84+
"source.organizeImports": "always"
85+
}
9086
},
91-
// TODO: figure out how the formatter is selected for notebooks
9287
"notebook.formatOnSave.enabled": true,
88+
"notebook.codeActionsOnSave": {
89+
"notebook.source.fixAll": "explicit",
90+
"notebook.source.organizeImports": "explicit"
91+
},
92+
"[python]": {
93+
"editor.defaultFormatter": "charliermarsh.ruff"
94+
}
9395
}
9496
```
9597

0 commit comments

Comments
 (0)