• Home
  • Raw
  • Download

Lines Matching +full:no +full:- +full:trailing +full:- +full:spaces

5 """reindent [-d][-r][-v] [ path ... ]
7 -d (--dryrun) Dry run. Analyze, but don't make any changes to, files.
8 -r (--recurse) Recurse. Search for all .py files in subdirectories too.
9 -n (--nobackup) No backup. Does not make a ".bak" file before reindenting.
10 -v (--verbose) Verbose. Print informative msgs; else no output.
11 (--newline) Newline. Specify the newline character to use (CRLF, LF).
13 -h (--help) Help. Print this usage information and exit.
15 Change Python (.py) files to use 4-space indents and no hard tab characters.
16 Also trim excess spaces and tabs from ends of lines, and remove empty lines
19 If no paths are given on the command line, reindent operates as a filter,
21 source to standard output. In this case, the -d, -r and -v flags are
25 path, all .py files within the directory will be examined, and, if the -r
31 file is a fixed-point for future runs (i.e., running reindent on the
41 you'd prefer. You can always use the --nobackup option to prevent this.
55 # A specified newline to be used in the output (set by --newline option)
79 if o in ('-d', '--dryrun'):
81 elif o in ('-r', '--recurse'):
83 elif o in ('-n', '--nobackup'):
85 elif o in ('-v', '--verbose'):
87 elif o in ('--newline',):
92 elif o in ('-h', '--help'):
135 errprint("%s: mixed newlines detected; cannot continue without --newline" % file)
161 """Return line stripped of trailing spaces, tabs, newlines.
169 while i > 0 and line[i - 1] in JUNK:
170 i -= 1
183 # File lines, rstripped & tab-expanded. Dummy at start is so
184 # that we can use tokenize's 1-based line numbering easily.
185 # Note that a line is all-blank iff it's "\n".
192 # comment line. indentlevel is -1 for comment lines, as a
205 # Remove trailing empty lines.
207 while lines and lines[-1] == "\n":
212 # Map count of leading spaces to # we want.
216 # Copy over initial empty lines -- there's nothing to do until
220 for i in range(len(stats) - 1):
231 want = have2want.get(have, -1)
234 for j in range(i + 1, len(stats) - 1):
244 for j in range(i - 1, -1, -1):
247 want = have + (getlspace(after[jline - 1]) -
251 # Still no luck -- leave it alone.
257 diff = want - have
268 remove = min(getlspace(line), -diff)
275 # Line-getter for tokenize.
284 # Line-eater for tokenize.
304 self.level -= 1
308 self.stats.append((slinecol[0], -1))