black/tests/data
Antonio Ossa-Guerra 0e9d29ab73
Apply .gitignore correctly in every source entry (#3336)
When passing multiple src directories, the root gitignore was only
applied to the first processed source. The reason is that, in the
first source, exclude is `None`, but then the value gets overridden by
`re_compile_maybe_verbose(DEFAULT_EXCLUDES)`, so in the next iteration
where the source is a directory, the condition is not met and sets the
value of `gitignore` to `None`.

To fix this problem, we store a boolean indicating if `exclude` is
`None` and set the value of `exclude` to its default value if that's
the case. This makes sure that the flow enters the correct condition on
following iterations and also keeps the original value if the condition
is not met.

Also, the value of `gitignore` is initialized as `None` and overriden
if necessary. The value of `root_gitignore` is always calculated to
avoid using additional variables (at the small cost of additional
computations).

Signed-off-by: Antonio Ossa Guerra <aaossa@uc.cl>
2022-11-04 22:09:59 -07:00
..
fast Remove hard coded test cases (#3062) 2022-05-18 12:11:37 -07:00
gitignore_used_on_multiple_sources Apply .gitignore correctly in every source entry (#3336) 2022-11-04 22:09:59 -07:00
include_exclude_tests Do not use gitignore if explicitly passing excludes (#2170) 2021-05-07 14:54:21 +02:00
invalid_gitignore_tests Present a more user-friendly error if .gitignore is invalid (#2414) 2021-08-20 19:54:53 -04:00
invalid_nested_gitignore_tests Present a more user-friendly error if .gitignore is invalid (#2414) 2021-08-20 19:54:53 -04:00
jupyter Remove hard coded test cases (#3062) 2022-05-18 12:11:37 -07:00
miscellaneous Add option to skip the first line of source code (#3299) 2022-10-06 15:17:32 -07:00
nested_gitignore_tests Fix: black only respects the root gitignore. (#2225) 2021-05-16 13:51:27 -04:00
preview Wrap concatenated strings used as function args in parens (#3307) 2022-10-26 18:03:10 -07:00
preview_39 Remove hard coded test cases (#3062) 2022-05-18 12:11:37 -07:00
preview_310 Use underscores instead of a space in a test file's name (#3180) 2022-07-19 21:33:00 -04:00
py_36 Remove hard coded test cases (#3062) 2022-05-18 12:11:37 -07:00
py_37 Remove hard coded test cases (#3062) 2022-05-18 12:11:37 -07:00
py_38 Remove hard coded test cases (#3062) 2022-05-18 12:11:37 -07:00
py_39 Remove hard coded test cases (#3062) 2022-05-18 12:11:37 -07:00
py_310 Add support for named exprs inside function calls as gen-exps (#3327) 2022-10-11 10:54:09 +11:00
py_311 Implement support for PEP 646 (#3071) 2022-05-26 09:45:22 -07:00
simple_cases Enforce empty lines before classes/functions with sticky leading comments. (#3302) 2022-10-25 18:03:24 -07:00
empty_pyproject.toml Support pyproject.toml 2018-06-06 17:02:10 -07:00