reindent


Namereindent JSON
Version 3.5.1 PyPI version JSON
download
home_page
Summaryreindent script by Tim Peters
upload_time2020-07-06 21:24:08
maintainerRyan Ollos
docs_urlNone
authorTim Peters
requires_python
licensePublic Domain
keywords reindent pep8 syntax lint tab space
VCS
bugtrack_url
requirements No requirements were recorded.
Travis-CI No Travis.
coveralls test coverage No coveralls.
            # reindent
Packaged Tools/scripts/reindent from cpython

```
reindent [-d][-r][-v] [ path ... ]

-d (--dryrun)   Dry run.   Analyze, but don't make any changes to, files.
-r (--recurse)  Recurse.   Search for all .py files in subdirectories too.
-n (--nobackup) No backup. Does not make a ".bak" file before reindenting.
-v (--verbose)  Verbose.   Print informative msgs; else no output.
   (--newline)  Newline.   Specify the newline character to use (CRLF, LF).
                           Default is the same as the original file.
-h (--help)     Help.      Print this usage information and exit.
```

Change Python (.py) files to use 4-space indents and no hard tab characters.
Also trim excess spaces and tabs from ends of lines, and remove empty lines
at the end of files.  Also ensure the last line ends with a newline.

If no paths are given on the command line, reindent operates as a filter,
reading a single source file from standard input and writing the transformed
source to standard output.  In this case, the `-d`, `-r` and `-v` flags are
ignored.

You can pass one or more file and/or directory paths.  When a directory
path, all .py files within the directory will be examined, and, if the `-r`
option is given, likewise recursively for subdirectories.

If output is not to standard output, reindent overwrites files in place,
renaming the originals with a .bak extension.  If it finds nothing to
change, the file is left alone.  If reindent does change a file, the changed
file is a fixed-point for future runs (i.e., running reindent on the
resulting .py file won't change it again).

The hard part of reindenting is figuring out what to do with comment
lines.  So long as the input files get a clean bill of health from
tabnanny.py, reindent should do a good job.

The backup file is a copy of the one that is being reindented. The ".bak"
file is generated with shutil.copy(), but some corner cases regarding
user/group and permissions could leave the backup file more readable than
you'd prefer. You can always use the `--nobackup` option to prevent this.



            

Raw data

            {
    "_id": null,
    "home_page": "",
    "name": "reindent",
    "maintainer": "Ryan Ollos",
    "docs_url": null,
    "requires_python": "",
    "maintainer_email": "ryan.j.ollos@gmail.com",
    "keywords": "reindent,pep8,syntax,lint,tab,space",
    "author": "Tim Peters",
    "author_email": "nottimsemail@notadomain.foo",
    "download_url": "https://files.pythonhosted.org/packages/2b/b8/ae4d040d58d2be57a2f738656ea5dcce95410d3be58ae9e16a5ab54e67e6/reindent-3.5.1.tar.gz",
    "platform": "any",
    "description": "# reindent\nPackaged Tools/scripts/reindent from cpython\n\n```\nreindent [-d][-r][-v] [ path ... ]\n\n-d (--dryrun)   Dry run.   Analyze, but don't make any changes to, files.\n-r (--recurse)  Recurse.   Search for all .py files in subdirectories too.\n-n (--nobackup) No backup. Does not make a \".bak\" file before reindenting.\n-v (--verbose)  Verbose.   Print informative msgs; else no output.\n   (--newline)  Newline.   Specify the newline character to use (CRLF, LF).\n                           Default is the same as the original file.\n-h (--help)     Help.      Print this usage information and exit.\n```\n\nChange Python (.py) files to use 4-space indents and no hard tab characters.\nAlso trim excess spaces and tabs from ends of lines, and remove empty lines\nat the end of files.  Also ensure the last line ends with a newline.\n\nIf no paths are given on the command line, reindent operates as a filter,\nreading a single source file from standard input and writing the transformed\nsource to standard output.  In this case, the `-d`, `-r` and `-v` flags are\nignored.\n\nYou can pass one or more file and/or directory paths.  When a directory\npath, all .py files within the directory will be examined, and, if the `-r`\noption is given, likewise recursively for subdirectories.\n\nIf output is not to standard output, reindent overwrites files in place,\nrenaming the originals with a .bak extension.  If it finds nothing to\nchange, the file is left alone.  If reindent does change a file, the changed\nfile is a fixed-point for future runs (i.e., running reindent on the\nresulting .py file won't change it again).\n\nThe hard part of reindenting is figuring out what to do with comment\nlines.  So long as the input files get a clean bill of health from\ntabnanny.py, reindent should do a good job.\n\nThe backup file is a copy of the one that is being reindented. The \".bak\"\nfile is generated with shutil.copy(), but some corner cases regarding\nuser/group and permissions could leave the backup file more readable than\nyou'd prefer. You can always use the `--nobackup` option to prevent this.\n\n\n",
    "bugtrack_url": null,
    "license": "Public Domain",
    "summary": "reindent script by Tim Peters",
    "version": "3.5.1",
    "split_keywords": [
        "reindent",
        "pep8",
        "syntax",
        "lint",
        "tab",
        "space"
    ],
    "urls": [
        {
            "comment_text": "",
            "digests": {
                "md5": "b6d05a5ce0c7adad0aad05828ebb6eae",
                "sha256": "1248ddf8bb209499ddaff6e841d60c822edff7dcff5e0e5beedbafa06dbc33aa"
            },
            "downloads": -1,
            "filename": "reindent-3.5.1-py3-none-any.whl",
            "has_sig": false,
            "md5_digest": "b6d05a5ce0c7adad0aad05828ebb6eae",
            "packagetype": "bdist_wheel",
            "python_version": "py3",
            "requires_python": null,
            "size": 6747,
            "upload_time": "2020-07-06T21:24:07",
            "upload_time_iso_8601": "2020-07-06T21:24:07.261785Z",
            "url": "https://files.pythonhosted.org/packages/e2/21/bbfe0baec43c1d1cb1683653334b55161ccc950991c1803e17f276b5759a/reindent-3.5.1-py3-none-any.whl",
            "yanked": false,
            "yanked_reason": null
        },
        {
            "comment_text": "",
            "digests": {
                "md5": "6c38f5ede98bbd3eaaad46337ba3cd44",
                "sha256": "59aeb8fbc16e45686f65df23b91896a17eb14ace7a7546860f50d2bb5ec4c9c0"
            },
            "downloads": -1,
            "filename": "reindent-3.5.1.tar.gz",
            "has_sig": false,
            "md5_digest": "6c38f5ede98bbd3eaaad46337ba3cd44",
            "packagetype": "sdist",
            "python_version": "source",
            "requires_python": null,
            "size": 5847,
            "upload_time": "2020-07-06T21:24:08",
            "upload_time_iso_8601": "2020-07-06T21:24:08.490547Z",
            "url": "https://files.pythonhosted.org/packages/2b/b8/ae4d040d58d2be57a2f738656ea5dcce95410d3be58ae9e16a5ab54e67e6/reindent-3.5.1.tar.gz",
            "yanked": false,
            "yanked_reason": null
        }
    ],
    "upload_time": "2020-07-06 21:24:08",
    "github": false,
    "gitlab": false,
    "bitbucket": false,
    "lcname": "reindent"
}
        
Elapsed time: 0.05752s