Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Fix error in exclude section #12078

Merged
merged 1 commit into from
Jan 27, 2022

Conversation

posita
Copy link
Contributor

@posita posita commented Jan 26, 2022

Brings INI and TOML examples in line as noted.

Brings INI and TOML examples in line as noted.
@posita
Copy link
Contributor Author

posita commented Jan 26, 2022

Motivation

The current version of the docs for exclude have the following INI example:

[mypy]
exclude = (?x)(
    ^one\.py$    # files named "one.py"
    | two\.pyi$  # or files ending with "two.pyi"
    | ^three\.   # or files starting with "three."
  )

Shortly after that example, there is a note with the following TOML examples:

[tool.mypy]
exclude = [
  "^file1\\.py$",  # TOML's double-quoted strings require escaping backslashes
  '^file2\.py$',  # but TOML's single-quoted strings do not
]

[tool.mypy]
exclude = '''(?x)(
    ^file1\.py$
    |^file2\.py$,
)'''

The following sentence accompanies the TOML examples:

The [provided] TOML examples are equivalent to the above INI example.

In iterating on #11828 and #11881, those examples diverged such that the quoted sentence was no longer true, but that went undetected (until I went back and read the entry recently).

Correction

Screen Shot 2022-01-26 at 17 06 37

make -C docs clean linkcheck does not surface any errors with this page.

@JelleZijlstra
Copy link
Member

Thanks!

@JelleZijlstra JelleZijlstra merged commit a825c15 into python:master Jan 27, 2022
@posita posita deleted the posita/0/fix-exclude-docs branch January 27, 2022 00:54
ViacheslavKolupaev added a commit to ViacheslavKolupaev/notebook that referenced this pull request May 11, 2022
An update was required to fix the issue described here:
python/mypy#12078
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

None yet

2 participants