Skip to content
New issue

Have a question about this project? # for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “#”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? # to your account

Misc refactors #498

Merged
merged 4 commits into from
Nov 17, 2024
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
2 changes: 1 addition & 1 deletion src/ameba/config.cr
Original file line number Diff line number Diff line change
Expand Up @@ -87,7 +87,7 @@ class Ameba::Config
property? autocorrect = false

# Returns a filename if reading source file from STDIN.
property stdin_filename : String? = nil
property stdin_filename : String?

@rule_groups : Hash(String, Array(Rule::Base))

Expand Down
4 changes: 4 additions & 0 deletions src/ameba/formatter/base_formatter.cr
Original file line number Diff line number Diff line change
Expand Up @@ -19,10 +19,14 @@ module Ameba::Formatter

# Callback that indicates when source inspection is started.
# A corresponding source is passed as an argument.
#
# WARNING: This method needs to be MT safe
def source_started(source : Source); end

# Callback that indicates when source inspection is finished.
# A corresponding source is passed as an argument.
#
# WARNING: This method needs to be MT safe
def source_finished(source : Source); end

# Callback that indicates when inspection is finished.
Expand Down
2 changes: 1 addition & 1 deletion src/ameba/formatter/dot_formatter.cr
Original file line number Diff line number Diff line change
Expand Up @@ -7,7 +7,7 @@ module Ameba::Formatter
include Util

@started_at : Time::Span?
@mutex = Thread::Mutex.new
@mutex = Mutex.new

# Reports a message when inspection is started.
def started(sources)
Expand Down
4 changes: 3 additions & 1 deletion src/ameba/formatter/todo_formatter.cr
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,9 @@ module Ameba::Formatter
# Basically, it takes all issues reported and disables corresponding rules
# or excludes failed sources from these rules.
class TODOFormatter < DotFormatter
def initialize(@output = STDOUT, @config_path : Path = Config::DEFAULT_PATH)
@config_path : Path

def initialize(@output = STDOUT, @config_path = Config::DEFAULT_PATH)
end

def finished(sources)
Expand Down