2017-10-26 16:46:58 +00:00
|
|
|
require "./ameba/*"
|
2018-05-03 15:57:47 +00:00
|
|
|
require "./ameba/ast/**"
|
2021-11-16 21:30:33 +00:00
|
|
|
require "./ameba/ext/**"
|
2018-06-16 11:50:59 +00:00
|
|
|
require "./ameba/rule/**"
|
2017-11-06 08:38:17 +00:00
|
|
|
require "./ameba/formatter/*"
|
2021-10-24 18:56:01 +00:00
|
|
|
require "./ameba/source/**"
|
2017-10-26 16:46:58 +00:00
|
|
|
|
2017-11-15 18:49:09 +00:00
|
|
|
# Ameba's entry module.
|
|
|
|
#
|
|
|
|
# To run the linter with default parameters:
|
|
|
|
#
|
|
|
|
# ```
|
|
|
|
# Ameba.run
|
|
|
|
# ```
|
|
|
|
#
|
|
|
|
# To configure and run it:
|
|
|
|
#
|
|
|
|
# ```
|
|
|
|
# config = Ameba::Config.load
|
|
|
|
# config.formatter = formatter
|
|
|
|
# config.files = file_paths
|
|
|
|
#
|
|
|
|
# Ameba.run config
|
|
|
|
# ```
|
2017-10-26 16:46:58 +00:00
|
|
|
module Ameba
|
2017-10-26 17:47:42 +00:00
|
|
|
extend self
|
|
|
|
|
2019-09-14 15:31:55 +00:00
|
|
|
VERSION = {{ `shards version "#{__DIR__}"`.chomp.stringify }}
|
2017-11-15 18:49:09 +00:00
|
|
|
|
|
|
|
# Initializes `Ameba::Runner` and runs it.
|
|
|
|
# Can be configured via `config` parameter.
|
|
|
|
#
|
|
|
|
# Examples:
|
|
|
|
#
|
|
|
|
# ```
|
|
|
|
# Ameba.run
|
|
|
|
# Ameba.run config
|
|
|
|
# ```
|
2017-11-13 21:20:22 +00:00
|
|
|
def run(config = Config.load)
|
|
|
|
Runner.new(config).run
|
2017-10-26 17:47:42 +00:00
|
|
|
end
|
2017-10-26 16:46:58 +00:00
|
|
|
end
|