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 PATH can be either a file or a directory. In the latter case, all
  files in the folder 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.0.tar.gz (3.2 kB view details)

Uploaded Source

Built Distribution

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

Uploaded Python 3

File details

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

File metadata

  • Download URL: eliminate-newlines-1.0.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.0.tar.gz
Algorithm Hash digest
SHA256 cbfbe084fecd3fe101cb646f35ca1a9e0162d31971b655c5f0f7edeaff8864fc
MD5 b13d61b738d500c6e67aba4a7c5df57b
BLAKE2b-256 5a59f208e620f0deddc5a5198777adbea71446cefaffe0ac05df1b90de3943e7

See more details on using hashes here.

File details

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

File metadata

  • Download URL: eliminate_newlines-1.0-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.0-py3-none-any.whl
Algorithm Hash digest
SHA256 b88431973084f099b29bbc7f564c56d85b326a9a4c9aec349db05d4345c52989
MD5 e71f722e71922ffe91e575dc4779359b
BLAKE2b-256 1740267d1c9fcd81730c8d23c8196179fc0f934197d80d51a22818a104d3cf4f

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