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 #12077

Closed
wants to merge 1 commit into from

Conversation

mmmbogosian
Copy link

Brings INI and TOML examples in line as noted.

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

mmmbogosian 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.

@posita posita deleted the posita/0/fix-exclude-docs branch January 27, 2022 00:54
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