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鈥檒l occasionally send you account related emails.

Already on GitHub? Sign in to your account

Support tabbed indentation #108

Open
Borda opened this issue Aug 5, 2021 · 2 comments
Open

Support tabbed indentation #108

Borda opened this issue Aug 5, 2021 · 2 comments

Comments

@Borda
Copy link

Borda commented Aug 5, 2021

Hi, thx for this nice package 馃惏 recently we crossed difficulty, hard to decode where the code issue is
(I think that we have some problem in our code sample in docs, but no idea where...)

- hook id: blacken-docs
- exit code: 1

Traceback (most recent call last):
  File "/pc/clone/_hcfpzVEQoOuvvQz-hvKAg/py_env-python3/bin/blacken-docs", line 8, in <module>
    sys.exit(main())
  File "/pc/clone/_hcfpzVEQoOuvvQz-hvKAg/py_env-python3/lib/python3.8/site-packages/blacken_docs.py", line 231, in main
    retv |= format_file(filename, black_mode, skip_errors=args.skip_errors)
  File "/pc/clone/_hcfpzVEQoOuvvQz-hvKAg/py_env-python3/lib/python3.8/site-packages/blacken_docs.py", line 187, in format_file
    new_contents, errors = format_str(contents, black_mode)
  File "/pc/clone/_hcfpzVEQoOuvvQz-hvKAg/py_env-python3/lib/python3.8/site-packages/blacken_docs.py", line 175, in format_str
    src = RST_RE.sub(_rst_match, src)
  File "/pc/clone/_hcfpzVEQoOuvvQz-hvKAg/py_env-python3/lib/python3.8/site-packages/blacken_docs.py", line 100, in _rst_match
    min_indent = min(INDENT_RE.findall(match['code']))
ValueError: min() arg is an empty sequence

we are running it on this repo/PR Lightning-Universe/lightning-flash#635
and the pre-commit bot results https://results.pre-commit.ci/run/github/333857397/1628203901.qtZyKfFxSMOJBpcB4hdu1Q

@asottile
Copy link
Contributor

asottile commented Aug 5, 2021

it appears to be mad because this file is tab-indented: docs/source/general/predictions.rst

@adamchainz adamchainz changed the title Better error message for ValueError Support tabbed indentation Aug 16, 2023
@adamchainz
Copy link
Owner

Just closed dupe #216.

I think it would be acceptable to add support for tabs. But I wouldn't like to limit this to a single markup language, so work on this should add support and tests for all of them. I don't have time to do that myself, but I'm open to review PRs.

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

3 participants