Skip to content

Commit

Permalink
Update example exclude to match only files in root
Browse files Browse the repository at this point in the history
The `exclude` section of the example `pyproject.toml` file didn't work
as expected. It claimed to exclude matched files only in the project
root, but it actually excluded matched files at any directory level
within the project. We can address this by prepending `^/` to the regex
to ensure that it only matches files in the project root.

See #1473 (comment) for
explanation.
  • Loading branch information
orn688 committed Dec 7, 2020
1 parent 7f75fe3 commit 6c9e51e
Showing 1 changed file with 4 additions and 3 deletions.
7 changes: 4 additions & 3 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -308,9 +308,10 @@ line-length = 88
target-version = ['py37']
include = '\.pyi?$'
exclude = '''
(
/(
# A regex preceded with ^/ will apply only to files in the root of
# the project.
^/(
(
\.eggs # exclude a few common directories in the
| \.git # root of the project
| \.hg
Expand Down

0 comments on commit 6c9e51e

Please sign in to comment.