Package: intentionally-blank
Canonicalise the leading indentation of blank lines in text files.InstallationTheintentionally-blankpackage is available on the Python Package Index (PyPI):The package supports Python 3 only. To install:$ python -m pip install intentionally-blankSynopsisFor the purposes of this tool, a “blank line” is a line containing only whitespace characters.Intentionally Blankcan apply one or more formatters to a text file for the purposes of modifying
the arrangement or representation of whitespace.To get command-line help, use the--helpoption:$ intentionally-blank --help
Usage: intentionally-blank [OPTIONS] COMMAND [ARGS]...

Options:
  --verbosity [CRITICAL|ERROR|WARNING|INFO|DEBUG|NOTSET]
                                  The logging level to use.
  --version                       Show the version and exit.
  --help                          Show this message and exit.

Commands:
  describe-format
  format
  list-formatsTo list the available formatters, used thelist-formatscommand:$ intentionally-blank list-formats
empty
identity
leading
visibleTo describe the action of particular formatter, use thedescribe-formatcommand:$ intentionally-blank describe-format --format=leading
Blank lines have leading whitespace equal to that on the previous non-blank line.To actually reformat a text file, we can use theformatcommand. To get help on a particular
command, likeformat, use the command and the--helpoption:$ intentionally-blank format --help
Usage: intentionally-blank format [OPTIONS] INPUT OUTPUT

Options:
  --format [empty|identity|leading|visible]
  --help                          Show this message and exit.Now, use theformatcommand to adjust whitespace:$ intentionally-blank format --format=leading infile.txt outfile.txtTo have blank lines be completely empty save for the terminating newline sequence, use--format=empty:$ intentionally-blank format --format=empty infile.txt outfile.txtMultiple--formatoptions can be provided, and they will be applied in the order given. Here we
apply the “leading” format, and then the “visible” format which makes whitespace characters
visible:$ intentionally-blank format --format=leading --format=visible infile.txt outfile.txtEither the INPUT or OUTPUT positional arguments can be replaced with a hyphen-to cause input
to be read from stdin or output to be written to stdout:$ intentionally-blank format --format=leading --format=visible infile.txt -
"""Model␣for␣aircraft␣flights."""↵
↵
↵
class␣Flight:↵
␣␣␣␣"""A␣flight␣with␣a␣particular␣passenger␣aircraft."""↵
␣␣␣␣↵
␣␣␣␣def␣__init__(self,␣number,␣aircraft):↵
␣␣␣␣␣␣␣␣if␣not␣number[:2].isalpha():↵
␣␣␣␣␣␣␣␣␣␣␣␣raise␣ValueError(f"No␣airline␣code␣in␣'{number}'")↵
␣␣␣␣␣␣␣␣␣␣␣␣↵MIT LicenseCopyright (c) 2020 Sixty North ASPermission is hereby granted, free of charge, to any person obtaining a copy
of this software and associated documentation files (the “Software”), to deal
in the Software without restriction, including without limitation the rights
to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
copies of the Software, and to permit persons to whom the Software is
furnished to do so, subject to the following conditions:The above copyright notice and this permission notice shall be included in all
copies or substantial portions of the Software.THE SOFTWARE IS PROVIDED “AS IS”, WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE
SOFTWARE.