Skip to content

Commit

Permalink
Update example exclude to match only files in root (#1861)
Browse files Browse the repository at this point in the history
* Update example exclude to match only files in root

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.

* Mention excluding directories as well
  • Loading branch information
orn688 committed Jan 27, 2021
1 parent 692c0f5 commit 71117e7
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 @@ -313,9 +313,10 @@ line-length = 88
target-version = ['py37']
include = '\.pyi?$'
exclude = '''
(
/(
# A regex preceded with ^/ will apply only to files and directories
# 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 71117e7

Please sign in to comment.