question-mark
Stuck on an issue?

Lightrun Answers was designed to reduce the constant googling that comes with debugging 3rd party libraries. It collects links to all the places you might be looking at while hunting down a tough bug.

And, if you’re still stuck at the end, we’re happy to hop on a call to see how we can help out.

Comments between fmt:on/off are reformatted

See original GitHub issue

This code:

# fmt: off
 #nospace
 #  twospaces
# fmt: on

is changed to:

# fmt: off
# nospace
#  twospaces
# fmt: on

I expected the lines betwen # fmt: off and # fmt: on to remain unchanged.

  • Version: master (19.10b1.dev22+gbe49ac7)
  • OS: Ubuntu Linux
  • Python: 3.6.9

Playground (master)

Issue Analytics

  • State:open
  • Created 4 years ago
  • Reactions:5
  • Comments:6

github_iconTop GitHub Comments

1reaction
felix-hildencommented, Mar 31, 2022

@aljabadi I don’t think we format CFG files 🤔

0reactions
SomeoneSergecommented, Jun 1, 2022

Another use-case that’s affected:

#!/usr/bin/env python3
# fmt: off
#SBATCH --job-name="Example"
#SBATCH --array=0-250
# ...
# fmt: on

Black alters #SBATCH into # SBATCH. The former is interpreted by SLURM, the latter ignored

EDIT: already reported in https://github.com/psf/black/issues/1024

Read more comments on GitHub >

github_iconTop Results From Across the Web

https://github.com/ambv/black/commit/36d3c516d3c09...
From 36d3c516d3c09fc5f05c420900dd6b854e3c8bbd Mon Sep 17 00:00:00 2001 ... blackd.py | 90 +++++++--- tests/data/fmtonoff.py | 4 +- tests/empty.toml | 1 + ...
Read more >
01/01: gnu: Separate Python core packages from the rest.
gnu/packages/python.scm: Move hundreds of package definitions from here. ... archive with a specially formatted filename and -the @code{.whl} extension.
Read more >
Download Diff File - Rekahsoft Git Repositories
+Expressions are constructed from parsed strings or directly in Python. ... archive with a specially formatted filename and +the @code{.whl} extension.
Read more >
Download Patch File - Sysnove Git Service
From 5510691d7e0543852165d691e01f7a2ef595e8bc Mon Sep 17 00:00:00 2001 From: ... now correctly indents comments in files that were previously formatted with ...
Read more >
https://yhetil.org/guix/3addb3c46a/s/gnu-packages-...
@item Makes transitioning between Bash and Python easier. ... (which "python3"))) (substitute* '("tests/data/fmtonoff.py" "tests/data/string_prefixes.py" ...
Read more >

github_iconTop Related Medium Post

No results found

github_iconTop Related StackOverflow Question

No results found

github_iconTroubleshoot Live Code

Lightrun enables developers to add logs, metrics and snapshots to live code - no restarts or redeploys required.
Start Free

github_iconTop Related Reddit Thread

No results found

github_iconTop Related Hackernoon Post

No results found

github_iconTop Related Tweet

No results found

github_iconTop Related Dev.to Post

No results found

github_iconTop Related Hashnode Post

No results found