Registered by Stian Selnes

Plugin for Bazaar which goal is to check if the committed code conforms to a specific code style. An external code style program are used for the style checking, such as "GNU Indent" or "Unqrustify". It can also correct the files that does not conform to the given style.

Features:

  - Check if changed files violates a defined coding style.
  - Uses an external program to check code style, such as GNU Indent, Uncrustify or similar.
  - Fail the commit or print a warning when a violation is detected.
  - Fix code style for one file, only modified or all all files using the "bzr style-check" command.

Configuration:

  The plugin is configured through the .conf-files bazaar.conf, locations.conf or branch.conf. Three options are available:

  - style_checker_command: The command to run in order to generate a file with correct code style. This option is
    defined as a template, e.g.

        uncrustify -q -c $ROOT/codestyle.cfg -f $IN -o $OUT

    where IN and OUT are mandatory and specifies the input and output files of the command. ROOT is optional and is root
    directory of the working tree.

  - style_checker_file_filters: A pattern that specifies which files to check.

  - style_checker_action: The action to take when a code style violation is detected. Two possible values: "fail" or "warn".
    "fail" makes a commit fail if a violation is detected, while "warn" only prints a warning.

  A complete configuration may look like this:

      style_checker_command = uncrustify -q -c $ROOT/codestyle.cfg -f $IN -o $OUT
      style_checker_file_filters = *.c, *.h
      style_checker_action = fail

Project information

Part of:
Bazaar VCS and Tools
Maintainer:
Stian Selnes
Driver:
Stian Selnes
Licence:
GNU GPL v3

RDF metadata

View full history Series and milestones

trunk series is the current focus of development.

All code Code

Version control system:
Bazaar
Programming languages:
python

All bugs Latest bugs reported

Get Involved

  • Report a bug
  • warning
    Ask a question
  • warning
    Help translate

Downloads

Latest version is 0.1.1
released

All downloads

Announcements