• Get Review Board
  • What's New
  • Products
  • Review Board Code review, image review, and document review
  • Documentation
  • Release Notes
  • Power Pack Enterprise integrations, reports, and enhanced document review
  • Try for 60 Days
  • Purchase
  • RBCommons Review Board as a Service, hosted by us
  • Pricing
  • RBTools Command line tools and Python API for Review Board
  • Documentation
  • Release Notes
  • Review Bot Automated code review, connecting tools you already use
  • Documentation
  • Release Notes
  • RB Gateway Manage Git and Mercurial repositories in your network
  • Documentation
  • Release Notes
  • Learn and Explore
  • What is Code Review?
  • Documentation
  • Frequently Asked Questions
  • Support Options
  • Third-Party Integrations
  • Demo
  • Review Board RBTools Power Pack Review Bot Djblets RB Gateway
    1. Review Bot 1.0
    2. Version 4.x
    3. Version 3.0
    4. Version 2.0
    5. Version 1.0
    6. Module and Class Reference
    7. reviewbot.tools.base.mixins
  • Home
  • Installation
  • Manually Installing Review Bot
  • Review Bot Docker Images
  • Upgrading Review Bot
  • Configuring Review Bot
  • Review Bot Tools
  • Cargo Tool
  • Checkstyle
  • Clang Static Analyzer
  • Cppcheck
  • Cpplint
  • Doc8
  • FBInfer
  • Flake8
  • Go Fmt
  • Go Tool
  • JSHint
  • PMD
  • Pycodestyle
  • Pydocstyle
  • Pyflakes
  • RuboCop
  • Rust Fmt
  • Secret Scanner
  • ShellCheck
  • Module and Class Reference
  • reviewbot.tools.base
  • reviewbot.tools.base.mixins
  • reviewbot.tools.base.registry
  • reviewbot.tools.base.tool
  • reviewbot.testing.testcases
  • reviewbot.testing.utils
  • reviewbot.tools.testing
  • reviewbot.tools.testing.decorators
  • reviewbot.tools.testing.testcases
  • reviewbot.processing.review
  • reviewbot.utils.api
  • reviewbot.utils.filesystem
  • reviewbot.utils.log
  • reviewbot.utils.process
  • reviewbot.utils.text
  • reviewbot.celery
  • reviewbot.config
  • reviewbot.deprecation
  • reviewbot.errors
  • reviewbot.repositories
  • reviewbot.tasks
  • reviewbot.tools.cargotool
  • reviewbot.tools.checkstyle
  • reviewbot.tools.clang
  • reviewbot.tools.cppcheck
  • reviewbot.tools.cpplint
  • reviewbot.tools.doc8
  • reviewbot.tools.fbinfer
  • reviewbot.tools.flake8
  • reviewbot.tools.gofmt
  • reviewbot.tools.gotool
  • reviewbot.tools.jshint
  • reviewbot.tools.pmd
  • reviewbot.tools.pycodestyle
  • reviewbot.tools.pydocstyle
  • reviewbot.tools.pyflakes
  • reviewbot.tools.rbsecretscanner
  • reviewbot.tools.rubocop
  • reviewbot.tools.rustfmt
  • reviewbot.tools.shellcheck
  • General Index
  • Python Module Index
  • Release Notes
  • This documentation covers Review Bot 1.0. You can select a version above or view the latest documentation.

    reviewbot.tools.base.mixins¶

    Useful mixins for code checking tools.

    New in version 3.0.

    Classes

    FilePatternsFromSettingMixin(**kwargs)

    Mixin to set file patterns based on a configured tool setting.

    FullRepositoryToolMixin()

    Mixin for tools that need access to the entire repository.

    JavaToolMixin()

    Mixin for Java-based tools.

    class FilePatternsFromSettingMixin(**kwargs)[source]¶

    Bases: object

    Mixin to set file patterns based on a configured tool setting.

    Subclasses can base file patterns off either a setting representing a comma-separated list of file patterns, or a setting representing a comma-separated list of file extensions. If both are provided, both will be checked, with the file patterns taking precedence over file extensions.

    If neither are provided by the user, the default list of file patterns set by the subclass (if any) will be used.

    New in version 3.0.

    file_extensions_setting = None[source]¶

    The name of a tool setting for a comma-separated list of extensions.

    Type:

    unicode

    file_patterns_setting = None[source]¶

    The name of a tool setting for a comma-separated list of patterns.

    Type:

    unicode

    include_default_file_patterns = True[source]¶

    Whether to include default file patterns in the resulting list.

    Type:

    boolean

    __init__(**kwargs)[source]¶

    Initialize the tool.

    Parameters

    **kwargs (dict) – Keyword arguments for the tool.

    __annotations__ = {}[source]¶
    class FullRepositoryToolMixin[source]¶

    Bases: object

    Mixin for tools that need access to the entire repository.

    This will take care of checking out a copy of the repository and applying patches from the diff being reviewed.

    New in version 3.0: This replaced the legacy reviewbot.tools.RepositoryTool.

    working_directory_required = True[source]¶
    execute(review, repository=None, base_commit_id=None, **kwargs)[source]¶

    Perform a review using the tool.

    Parameters
    • review (reviewbot.processing.review.Review) – The review object.

    • settings (dict, optional) – Tool-specific settings.

    • repository (reviewbot.repositories.Repository, optional) – The repository.

    • base_commit_id (unicode, optional) – The ID of the commit that the patch should be applied to.

    __annotations__ = {}[source]¶
    class JavaToolMixin[source]¶

    Bases: object

    Mixin for Java-based tools.

    New in version 3.0.

    java_main = None[source]¶

    Main class to call to run the Java application.

    Type:

    unicode

    java_classpaths_key = None[source]¶

    The key identifying the classpaths to use.

    Type:

    unicode

    exe_dependencies = ['java'][source]¶
    classmethod set_has_java_runtime(has_runtime)[source]¶

    Set whether there’s a Java runtime installed.

    Parameters

    has_runtime (bool) – Whether there’s a runtime installed.

    classmethod clear_has_java_runtime()[source]¶

    Clear whether there’s a Java runtime installed.

    This will force the next dependency check to re-check for a runtime.

    check_dependencies()[source]¶

    Verify the tool’s dependencies are installed.

    This will invoke the base class’s dependency checking, ensuring that java is available, and will then attempt to run the configured Java class (java_main), checking that it could be found.

    Returns

    True if all dependencies for the tool are satisfied. If this returns False, the worker will not listen for this Tool’s queue, and a warning will be logged.

    Return type

    bool

    build_base_command(**kwargs)[source]¶

    Build the base command line used to review files.

    Parameters

    **kwargs (dict, unused) – Additional keyword arguments.

    Returns

    The base command line.

    Return type

    list of unicode

    __annotations__ = {}[source]¶

    Keep up with the latest Review Board releases, security updates, and helpful information.

    About
    News
    Demo
    RBCommons Hosting
    Integrations
    Happy Users
    Support Options
    Documentation
    FAQ
    User Manual
    RBTools
    Administration Guide
    Power Pack
    Release Notes
    Downloads
    Review Board
    RBTools
    Djblets
    Power Pack
    Package Store
    PGP Signatures
    Contributing
    Bug Tracker
    Submit Patches
    Development Setup
    Wiki
    Follow Us
    Mailing Lists
    Reddit
    Twitter
    Mastodon
    Facebook
    YouTube

    Copyright © 2006-2025 Beanbag, Inc. All rights reserved.

    Terms of Service — Privacy Policy — AI Ethics Policy — Branding

    On this page

    • [Top]