squabble.config module

class squabble.config.Config(reporter, plugins, rules)

Bases: tuple


Alias for field number 1


Alias for field number 0


Alias for field number 2

exception squabble.config.UnknownPresetException(preset)[source]

Bases: squabble.SquabbleException

Raised when user tries to apply a preset that isn’t defined.


Try to locate a config file in some likely locations.

Used when no config path is specified explicitly. In order, this will check for a file named .squabblerc:

  • in the current directory.
  • in the root of the repository (if working in a git repo).
  • in the user’s home directory.

Return a basic config value that can be overridden by user configuration files.

Parameters:preset_names – The named presets to use (applied in order), or None
squabble.config.load_config(config_file, preset_names=None, reporter_name=None)[source]

Load configuration from a file, optionally applying a predefined set of rules.

  • config_file (str) – Path to JSON file containing user configuration.
  • preset_name (str) – Preset to use as a base before applying user configuration.
  • reporter_name (str) – Override the reporter named in configuration.
squabble.config.apply_file_config(base, contents)[source]

Given a base configuration object and the contents of a file, return a new config that applies any file-specific rule additions/deletions.

Returns None if the file should be skipped.