Don't over-eagerly make a path absolute if only one passed
If a directory or more than one file is passed, Black nicely shows the relative paths in output. Before this change, it showed an absolute path if only a single file was passed as an argument. This fixes the inconsistency.
This commit is contained in:
parent
8a82e0bf9a
commit
a80e037a9a
4
black.py
4
black.py
@ -342,8 +342,8 @@ def reformat_one(
|
||||
cache: Cache = {}
|
||||
if write_back != WriteBack.DIFF:
|
||||
cache = read_cache(line_length, mode)
|
||||
src = src.resolve()
|
||||
if src in cache and cache[src] == get_cache_info(src):
|
||||
res_src = src.resolve()
|
||||
if res_src in cache and cache[res_src] == get_cache_info(res_src):
|
||||
changed = Changed.CACHED
|
||||
if changed is not Changed.CACHED and format_file_in_place(
|
||||
src,
|
||||
|
Loading…
Reference in New Issue
Block a user