Skip to main content

CLI that formats Python code in such a way that after the function definition header all newlines will be deleted

Project description

Eliminate Newlines CLI

This CLI formats Python code in such a way that after the function definition header all newlines will be deleted.

Example

def foo(a):

   return a + 1


class A:
    def bar(self,
    b,
    c):


        return b + c

will be formatted to:

def foo(a):
   return a + 1


class A:
    def bar(self,
    b,
    c):
        return a + b + c

Example usage:

Reformat file:

eliminate_newlines testfile.py

Reformat folder (recursively):

eliminate_newlines /path/to/testfolder

Check mode:

eliminate_newlines testfile.py --check

Return Codes

Return code 0 means nothing would change.

Return code 1 means some files would be reformatted.

Return code 123 means there was an internal error.

CLI Documentation:

eliminate_newlines --help
Usage: eliminate_newlines [OPTIONS] PATH

  This CLI formats Python code in such a way that after the function
  definition header all newlines will be deleted.

  Return code 0 means nothing would change.  Return code 1 means some files
  would be reformatted. Return code 123 means there was an internal error.""
  pass.

  Passed PATHS can be either filea or directories. In the latter case, all
  files in the folders will be formatted recursively.

Options:
  --check  Don't write the files back, just return the status.
  --help   Show this message and exit.

Project details


Download files

Download the file for your platform. If you're not sure which to choose, learn more about installing packages.

Source Distribution

eliminate-newlines-1.2.tar.gz (3.3 kB view details)

Uploaded Source

Built Distribution

eliminate_newlines-1.2-py3-none-any.whl (5.1 kB view details)

Uploaded Python 3

File details

Details for the file eliminate-newlines-1.2.tar.gz.

File metadata

  • Download URL: eliminate-newlines-1.2.tar.gz
  • Upload date:
  • Size: 3.3 kB
  • Tags: Source
  • Uploaded using Trusted Publishing? No
  • Uploaded via: twine/3.2.0 pkginfo/1.5.0.1 requests/2.24.0 setuptools/47.1.0 requests-toolbelt/0.9.1 tqdm/4.50.0 CPython/3.8.5

File hashes

Hashes for eliminate-newlines-1.2.tar.gz
Algorithm Hash digest
SHA256 6a858e94f29057d5077dd78a28e2747eedff77f6b41cee982cedd13c88a811d0
MD5 9d3ba9bbf6d85c16a7c3a21cc5ea21e8
BLAKE2b-256 05d449efb129197d92fbb31b512562bd5d3dfdfbe07110a66c1ea40983a0601f

See more details on using hashes here.

File details

Details for the file eliminate_newlines-1.2-py3-none-any.whl.

File metadata

  • Download URL: eliminate_newlines-1.2-py3-none-any.whl
  • Upload date:
  • Size: 5.1 kB
  • Tags: Python 3
  • Uploaded using Trusted Publishing? No
  • Uploaded via: twine/3.2.0 pkginfo/1.5.0.1 requests/2.24.0 setuptools/47.1.0 requests-toolbelt/0.9.1 tqdm/4.50.0 CPython/3.8.5

File hashes

Hashes for eliminate_newlines-1.2-py3-none-any.whl
Algorithm Hash digest
SHA256 27d2991cd6a5477b10817e14eb344937277ec62dffae2a18b194a20f403768c8
MD5 6f3497786e56dc1c3009f2179a3bb077
BLAKE2b-256 3b9441a6ffcb2c57848ada90a4f6e2715ff1250e2f2078f75eabe076fd6898f1

See more details on using hashes here.

Supported by

AWS AWS Cloud computing and Security Sponsor Datadog Datadog Monitoring Fastly Fastly CDN Google Google Download Analytics Microsoft Microsoft PSF Sponsor Pingdom Pingdom Monitoring Sentry Sentry Error logging StatusPage StatusPage Status page