Skip to content

Conversation

ghost
Copy link

@ghost ghost commented Jan 26, 2022

Brings INI and TOML examples in line as noted.

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

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

@ghost ghost closed this Jan 26, 2022
@posita posita deleted the posita/0/fix-exclude-docs branch January 27, 2022 00:54
This pull request was closed.
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

1 participant