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.1.tar.gz (3.2 kB view details)

Uploaded Source

Built Distribution

eliminate_newlines-1.1-py3-none-any.whl (4.9 kB view details)

Uploaded Python 3

File details

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

File metadata

  • Download URL: eliminate-newlines-1.1.tar.gz
  • Upload date:
  • Size: 3.2 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.48.2 CPython/3.8.5

File hashes

Hashes for eliminate-newlines-1.1.tar.gz
Algorithm Hash digest
SHA256 6e5200b154675180306a20521a4a99b516d170c8c1bfa6c6d8d0f13fe2ae6a7e
MD5 86457af86f71d021e1f7953b46e9287b
BLAKE2b-256 47fc2bf6e25e0656312b0663b33d81a9174b3d203dfd68780a508cd8d009d837

See more details on using hashes here.

File details

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

File metadata

  • Download URL: eliminate_newlines-1.1-py3-none-any.whl
  • Upload date:
  • Size: 4.9 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.48.2 CPython/3.8.5

File hashes

Hashes for eliminate_newlines-1.1-py3-none-any.whl
Algorithm Hash digest
SHA256 c36f5a749d1b3534432fb97e6aa3e3d3d9f4080a5842b1cea2a22dcdbfd620e0
MD5 a53a799b5e41675c28b189abf230b21f
BLAKE2b-256 221a912825adb7b4c026d5ffa6b7abec667fdd00bf244faeb0ab7b88a9bf6798

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