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
Copy file name to clipboardexpand all lines: docs/documentation/code-format-lint.md
+15-13
Original file line number
Diff line number
Diff line change
@@ -33,13 +33,9 @@ consistency and catches errors early.
33
33
34
34
While pre-commit is a powerful tool to add to your workflow, many do not like it:
35
35
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.
43
39
44
40
## Pre-commit.ci Bot
45
41
@@ -48,8 +44,8 @@ repository to run pre-commit checks in an online continuous integration pipeline
48
44
The bot will run any pre-commit hooks that you have set up on new pull requests
49
45
submitted to your repository.
50
46
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
53
49
request. This way, if you have a new contributor (or a seasoned one) who doesn't
54
50
want to set up pre-commit locally, or someone who wants to submit a pull request
55
51
(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.
64
60
65
61
## VSCode
66
62
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:
68
64
69
65
1.**Install Ruff:**
70
66
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.
85
81
"editor.defaultFormatter": "charliermarsh.ruff",
86
82
"editor.codeActionsOnSave": {
87
83
"source.fixAll": "always",
88
-
"source.organizeImports": "always",
89
-
},
84
+
"source.organizeImports": "always"
85
+
}
90
86
},
91
-
// TODO: figure out how the formatter is selected for notebooks
0 commit comments