Skip to content

Commit da1c320

Browse files
Add .ipynb_checkpoints, .pyenv, .pytest_cache, and .vscode to default excludes (#5513)
## Summary VS Code extensions are [recommended](https://code.visualstudio.com/docs/python/settings-reference#_linting-settings) to exclude `.vscode` and `site-packages`. Black also now omits `.vscode`, `.pytest_cache`, and `.ipynb_checkpoints` by default. Omitting `.pyenv` is similar to omitting virtual environments, but really only matters in the context of VS Code (see: #5509). Closes: #5510.
1 parent 485d997 commit da1c320

File tree

2 files changed

+40
-0
lines changed

2 files changed

+40
-0
lines changed

BREAKING_CHANGES.md

Lines changed: 36 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,41 @@
11
# Breaking Changes
22

3+
## 0.0.277
4+
5+
### `.ipynb_checkpoints`, `.pyenv`, `.pytest_cache`, and `.vscode` are now excluded by default ([#5513](https://github.com/astral-sh/ruff/pull/5513))
6+
7+
Ruff maintains a list of default exclusions, which now consists of the following patterns:
8+
9+
- `.bzr`
10+
- `.direnv`
11+
- `.eggs`
12+
- `.git`
13+
- `.git-rewrite`
14+
- `.hg`
15+
- `.ipynb_checkpoints`
16+
- `.mypy_cache`
17+
- `.nox`
18+
- `.pants.d`
19+
- `.pyenv`
20+
- `.pytest_cache`
21+
- `.pytype`
22+
- `.ruff_cache`
23+
- `.svn`
24+
- `.tox`
25+
- `.venv`
26+
- `.vscode`
27+
- `__pypackages__`
28+
- `_build`
29+
- `buck-out`
30+
- `build`
31+
- `dist`
32+
- `node_modules`
33+
- `venv`
34+
35+
Previously, the `.ipynb_checkpoints`, `.pyenv`, `.pytest_cache`, and `.vscode` directories were not
36+
excluded by default. This change brings Ruff's default exclusions in line with other tools like
37+
Black.
38+
339
## 0.0.276
440

541
### The `keep-runtime-typing` setting has been reinstated ([#5470](https://github.com/astral-sh/ruff/pull/5470))

crates/ruff/src/settings/defaults.rs

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -39,14 +39,18 @@ pub static EXCLUDE: Lazy<Vec<FilePattern>> = Lazy::new(|| {
3939
FilePattern::Builtin(".git"),
4040
FilePattern::Builtin(".git-rewrite"),
4141
FilePattern::Builtin(".hg"),
42+
FilePattern::Builtin(".ipynb_checkpoints"),
4243
FilePattern::Builtin(".mypy_cache"),
4344
FilePattern::Builtin(".nox"),
4445
FilePattern::Builtin(".pants.d"),
46+
FilePattern::Builtin(".pyenv"),
47+
FilePattern::Builtin(".pytest_cache"),
4548
FilePattern::Builtin(".pytype"),
4649
FilePattern::Builtin(".ruff_cache"),
4750
FilePattern::Builtin(".svn"),
4851
FilePattern::Builtin(".tox"),
4952
FilePattern::Builtin(".venv"),
53+
FilePattern::Builtin(".vscode"),
5054
FilePattern::Builtin("__pypackages__"),
5155
FilePattern::Builtin("_build"),
5256
FilePattern::Builtin("buck-out"),

0 commit comments

Comments
 (0)