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

Black compatibility : relative vs absolute path #210

Open
Nodd opened this issue Sep 17, 2024 · 0 comments
Open

Black compatibility : relative vs absolute path #210

Nodd opened this issue Sep 17, 2024 · 0 comments

Comments

@Nodd
Copy link

Nodd commented Sep 17, 2024

I noticed a minor incompatibility between black and blackdoc: black displays absolute filenames in the console while blackdoc displays relative paths. This would not be a problem, except that is renders blackdoc incompatible with black-gl-code-quality. I think that it can be easily fixed on this side.

Here is the error:

$ blackdoc --check . 2>&1 | black-gl-cq
Traceback (most recent call last):
  File "<frozen runpy>", line 198, in _run_module_as_main
  File "<frozen runpy>", line 88, in _run_code
  File "D:\XXX\Scripts\black-gl-cq.exe\__main__.py", line 7, in <module>
  File "D:\XXX\Lib\site-packages\black_gl_code_quality\__main__.py", line 42, in main
    output = parse_simple_mode(lines, severity)
             ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
  File "D:\XXX\Lib\site-packages\black_gl_code_quality\parser.py", line 13, in parse_simple_mode
    path = Path(line.strip(magic_word).strip()).relative_to(Path.cwd())
           ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
  File "D:\XXX\Lib\pathlib.py", line 730, in relative_to
    raise ValueError("{!r} is not in the subpath of {!r}"
ValueError: 'XXX.py' is not in the subpath of 'D:\\YYY' OR one path is relative and the other is absolute.
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

No branches or pull requests

1 participant