Skip to content

Support tabbed indentation #108

@Borda

Description

@Borda

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

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions