Knob to set blank lines near imports, classes, functions and methods
See original GitHub issueBLANK_LINE_BEFORE_NESTED_CLASS_OR_DEF
allows adding a blank line before nested classes or methods.
Ideally, a knob would allow setting a specified amount of blank lines near:
- Top-level imports
- Top-level classes and functions
- Classes
- Methods
- Top-level comments
Alternatively, offer a knob can allow “maximum blank lines”, thus allowing blank lines after imports (for example). Right now they get formatted away.
Issue Analytics
- State:
- Created 7 years ago
- Reactions:10
- Comments:10 (5 by maintainers)
Top Results From Across the Web
tslint-blank-lines-after-imports - npm
Ensure number of blank lines after all import statements.. Latest version: 0.1.1, last published: 3 years ago.
Read more >black formatter: How can I place one newline before and after ...
It uses 2 lines to visually distinguish methods from empty lines in code structure. From the docs: Black will allow single empty lines...
Read more >How to Use Scroll Panes - Oracle Help Center
This Swing Java Tutorial describes developing graphical user interfaces (GUIs) for applications and applets using Swing components.
Read more >Custom Panels — NUKE Python Developer's Guide v10.0v1 ...
Python Panels - more complex to create, but offer all knobs that are available in nodes as ... import nuke import nukescripts class...
Read more >Chapter 4. Visualization with Matplotlib - O'Reilly
In [ 1 ]: import matplotlib as mpl import matplotlib.pyplot as plt ... in the object-oriented interface the plotting functions are methods of...
Read more >
Top Related Medium Post
No results found
Top Related StackOverflow Question
No results found
Troubleshoot Live Code
Lightrun enables developers to add logs, metrics and snapshots to live code - no restarts or redeploys required.
Start Free
Top Related Reddit Thread
No results found
Top Related Hackernoon Post
No results found
Top Related Tweet
No results found
Top Related Dev.to Post
No results found
Top Related Hashnode Post
No results found
Adding the knobs shouldn’t be too hard. I’ll bump up the priority here.
yapf
andisort
currently handle blank lines near Top-level imports and comments differently.isort
is happy with this:but
yapf
wants to remove a line between the import and the comment.Irrespective of
isort
’s behaviour, it would be nice to control the number of spaces here so there’s 2 (ideally configurable) both above and below the comment. Should behave the same when there’s a constant too.