Ameba::Config
Inherits Ameba::GlobUtils < Reference < Object
A configuration entry for Ameba::Runner.
Config can be loaded from configuration YAML file and adjusted.
config = Ameba::Config.load
config.formatter = my_formatter
Constants
Class methods
Instance methods
Represents a list of paths to exclude from globs. Can have wildcards.
config = Ameba::Config.load
config.excluded = Set{"spec", "src/server/*.cr"}
Represents a list of paths to exclude from globs. Can have wildcards.
config = Ameba::Config.load
config.excluded = Set{"spec", "src/server/*.cr"}
Returns a list of files matching globs and excluded sections.
config = Ameba::Config.load
config.files # => list of default files
config.globs = Set{"**/*.cr", "**/*.ecr"}
config.excluded = Set{"spec"}
config.files # => list of files found by the wildcards
Returns a formatter to be used while inspecting files. If formatter is not set, it will return default formatter.
config = Ameba::Config.load
config.formatter = custom_formatter
config.formatter
Sets formatter by name.
config = Ameba::Config.load
config.formatter = :progress
Returns a formatter to be used while inspecting files. If formatter is not set, it will return default formatter.
config = Ameba::Config.load
config.formatter = custom_formatter
config.formatter
Returns a list of paths (with wildcards) to files. Represents a list of sources to be inspected. If globs are not set, it will return default list of files.
config = Ameba::Config.load
config.globs = Set{"**/*.cr"}
config.globs
Returns a list of paths (with wildcards) to files. Represents a list of sources to be inspected. If globs are not set, it will return default list of files.
config = Ameba::Config.load
config.globs = Set{"**/*.cr"}
config.globs
Returns a list of sources matching globs and excluded sections.
config = Ameba::Config.load
config.sources # => list of default sources
config.globs = Set{"**/*.cr", "**/*.ecr"}
config.excluded = Set{"spec"}
config.sources # => list of sources pointing to files found by the wildcards
Returns a filename if reading source file from STDIN.
Updates rule properties.
config = Ameba::Config.load
config.update_rule "MyRuleName", enabled: false
Updates rules properties.
config = Ameba::Config.load
config.update_rules %w[Rule1 Rule2], enabled: true
also it allows to update groups of rules:
config.update_rules %w[Group1 Group2], enabled: true
Returns an ameba version to be used by Ameba::Runner.