Skip to main content

reindent script by Tim Peters

Project description

Released to the public domain, by Tim Peters, 03 October 2000.

Usage:

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.
-v (--verbose) Verbose.  Print informative msgs; else no output.
-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.

Project details


Download files

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

Source Distributions

Reindent-0.1.0.zip (9.0 kB view details)

Uploaded Source

Reindent-0.1.0.tar.gz (5.0 kB view details)

Uploaded Source

Reindent-0.1.0.tar.bz2 (5.4 kB view details)

Uploaded Source

Built Distribution

Reindent-0.1.0-py2.5.egg (9.6 kB view details)

Uploaded Source

File details

Details for the file Reindent-0.1.0.zip.

File metadata

  • Download URL: Reindent-0.1.0.zip
  • Upload date:
  • Size: 9.0 kB
  • Tags: Source
  • Uploaded using Trusted Publishing? No

File hashes

Hashes for Reindent-0.1.0.zip
Algorithm Hash digest
SHA256 353aca76efa433ce9888fcf0928677efeb745176ef08a8babc4a4d9e76b58ede
MD5 3a61dae5d5ef5e9e60b6980ac6c5bd36
BLAKE2b-256 d4be5f06bb17ce321763fc954364271072ca0475073fa4214933537c1741fe98

See more details on using hashes here.

File details

Details for the file Reindent-0.1.0.tar.gz.

File metadata

  • Download URL: Reindent-0.1.0.tar.gz
  • Upload date:
  • Size: 5.0 kB
  • Tags: Source
  • Uploaded using Trusted Publishing? No

File hashes

Hashes for Reindent-0.1.0.tar.gz
Algorithm Hash digest
SHA256 696707bc7fe3175c122131d29ec07cecaff8dedee883da41125b3c46fd069ecf
MD5 8285356a4879e5e3de0056f017478159
BLAKE2b-256 0c8f7de1707c62558f557a4fcccaa149e5458b7d1a281f0f8fb38feb12f134be

See more details on using hashes here.

File details

Details for the file Reindent-0.1.0.tar.bz2.

File metadata

  • Download URL: Reindent-0.1.0.tar.bz2
  • Upload date:
  • Size: 5.4 kB
  • Tags: Source
  • Uploaded using Trusted Publishing? No

File hashes

Hashes for Reindent-0.1.0.tar.bz2
Algorithm Hash digest
SHA256 cd6e0ff47590fd281fd705ef73a0e746ef7f49dfb995045c3010d199fe3abb2c
MD5 20f4e82e5393b127b9be786a61b168a0
BLAKE2b-256 02c853fb67ca5ae86189b5d35de2943cfec1c981044d93c53312bcf21b4bb5fc

See more details on using hashes here.

File details

Details for the file Reindent-0.1.0-py2.5.egg.

File metadata

File hashes

Hashes for Reindent-0.1.0-py2.5.egg
Algorithm Hash digest
SHA256 1ac4b4c7948e45c1d864ec6721d64972a27bbc0873f163d94310ec27536dc14d
MD5 91c2f429bed64ebf28bff6e9d90ffb62
BLAKE2b-256 2ce59e6508982069ceafecec3a47a96a56c6a2619eb7a66b1458a2937987f3fb

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