~afrantzis/bzr-text-checker/empty-line-at-eof

« back to all changes in this revision

Viewing changes to __init__.py

  • Committer: Marius Kruger
  • Date: 2009-05-02 12:48:51 UTC
  • Revision ID: amanic@gmail.com-20090502124851-auhwffax838wrpyf
start updating the documentation to the new rules-based way

Show diffs side-by-side

added added

removed removed

Lines of Context:
7
7
 
8
8
Features:
9
9
 
10
 
* Currently we check for new trailing whitespace, leading tabs or files
11
 
  not ending with a newline.
12
 
* You can specify which files to check by adding a config item eg.:
13
 
  ``text_check_file_filters=*.py, NEWS``
14
 
* Configurations may appear in the bazaar.conf, locations.conf or branch.conf.
15
 
* By default it would just print out warnings when you commit violating text,
16
 
  but it can be explicitly configured:
17
 
  ``text_check_action=warn``
18
 
* If you would like this plugin to prevent you from committing violating text,
19
 
  you can do this by adding the following to your configuration:
20
 
  ``text_check_action=fail``
 
10
* Currently we can check for new trailing whitespace, tabs, files not ending
 
11
  with a newline and long lines.
 
12
* You can specify which files to check by adding rules (see `bzr help rules`):
 
13
    [name <file glob pattern> <file glob pattern> ... ]
 
14
    trailing_whitespace={ignore|warn|fail}
 
15
    tabs={ignore|warn|fail}
 
16
    newline_at_eof={ignore|warn|fail}
 
17
    long_line_length=80
 
18
    long_lines={ignore|warn|fail}
 
19
* the different actions are defined as follows:
 
20
    ignore --> do nothing
 
21
    warn --> print a waning message when committing
 
22
    fail --> prevent the commit from succeeding
21
23
* You can force a commit with violating text using a the
22
24
  `--text-check-warn-only` commit option.
23
25
  When this plugin is configured to 'fail', this option would temporarily
42
44
  use the new content filters of Ian Clatworthy when that lands in bazaar.
43
45
  ``text_check_action=auto-fix``
44
46
 
45
 
* rule based configs
 
47
* rule based config example:
46
48
[name *.py, *.java, NEWS, README]
47
49
trailing_whitespace=fail
48
50
tabs=warn