Skip to content

Commit

Permalink
♻️ Reverted -> to in logging
Browse files Browse the repository at this point in the history
  • Loading branch information
mkarlesky committed Apr 30, 2024
1 parent 1262199 commit 72419b4
Show file tree
Hide file tree
Showing 13 changed files with 25 additions and 26 deletions.
2 changes: 1 addition & 1 deletion bin/cli.rb
Original file line number Diff line number Diff line change
Expand Up @@ -243,7 +243,7 @@ def upgrade(path)
\x5 > ceedling build test:all
TASKS are zero or more build operations created from your project configuration.
If no tasks are provided, built-in default tasks or your :project ->
If no tasks are provided, built-in default tasks or your :project
:default_tasks will be executed.
Notes on Optional Flags:
Expand Down
4 changes: 2 additions & 2 deletions bin/cli_helper.rb
Original file line number Diff line number Diff line change
Expand Up @@ -74,7 +74,7 @@ def which_ceedling?(env:, config:{}, app_cfg:)
walked = @config_walkinator.fetch_value( config, :project, :which_ceedling )
if !walked[:value].nil?
which_ceedling = walked[:value].strip()
@streaminator.stream_puts( " > Set which Ceedling from config :project -> :which_ceedling => #{which_ceedling}", Verbosity::OBNOXIOUS )
@streaminator.stream_puts( " > Set which Ceedling from config :project :which_ceedling => #{which_ceedling}", Verbosity::OBNOXIOUS )
which_ceedling = :gem if (which_ceedling.casecmp( 'gem' ) == 0)
end
end
Expand Down Expand Up @@ -258,7 +258,7 @@ def dump_yaml(config, filepath, sections)
if walked[:value].nil?
# Reformat list of symbols to list of :<section>s
_sections.map! {|section| ":#{section.to_s}"}
msg = "Cound not find configuration section #{_sections.join(' -> ')}"
msg = "Cound not find configuration section #{_sections.join(' ')}"
raise(msg)
end

Expand Down
2 changes: 1 addition & 1 deletion bin/configinator.rb
Original file line number Diff line number Diff line change
Expand Up @@ -39,7 +39,7 @@ def loadinate(builtin_mixins:, filepath:nil, mixins:[], env:{})
mixins: cfg_enabled_mixins,
load_paths: cfg_load_paths,
builtins: builtin_mixins,
source: 'Config :mixins -> :enabled =>',
source: 'Config :mixins :enabled =>',
yaml_extension: yaml_ext
)
raise 'Project configuration file section :mixins failed validation'
Expand Down
2 changes: 1 addition & 1 deletion bin/projectinator.rb
Original file line number Diff line number Diff line change
Expand Up @@ -113,7 +113,7 @@ def extract_mixins(config:)
def validate_mixin_load_paths(load_paths)
validated = @path_validator.validate(
paths: load_paths,
source: 'Config :mixins -> :load_paths',
source: 'Config :mixins :load_paths',
type: :directory
)

Expand Down
12 changes: 6 additions & 6 deletions lib/ceedling/config_matchinator.rb
Original file line number Diff line number Diff line change
Expand Up @@ -62,7 +62,7 @@ def get_config(primary:, secondary:, tertiary:nil)
return elem if tertiary.nil?

# Otherwise, if an tertiary is specified but we have an array, go boom
error = "ERROR: :#{primary} -> :#{secondary} present in project configuration but does not contain :#{tertiary}."
error = "ERROR: :#{primary} :#{secondary} present in project configuration but does not contain :#{tertiary}."
raise CeedlingException.new(error)

# If [primary][secondary] is a hash
Expand All @@ -81,7 +81,7 @@ def get_config(primary:, secondary:, tertiary:nil)

# If [primary][secondary] is nothing we expect--something other than an array or hash
else
error = "ERROR: :#{primary} -> :#{secondary} in project configuration is neither a list nor hash."
error = "ERROR: :#{primary} :#{secondary} in project configuration is neither a list nor hash."
raise CeedlingException.new(error)
end

Expand All @@ -93,7 +93,7 @@ def validate_matchers(hash:, section:, context:, operation:nil)
hash.each do |k, v|
if v == nil
path = generate_matcher_path( section, context, operation )
error = "ERROR: Missing list of values for #{path} -> '#{k}' matcher in project configuration."
error = "ERROR: Missing list of values for #{path} '#{k}' matcher in project configuration."
raise CeedlingException.new(error)
end
end
Expand All @@ -106,7 +106,7 @@ def matches?(hash:, filepath:, section:, context:, operation:nil)
# Sanity check
if filepath.nil?
path = generate_matcher_path(section, context, operation)
error = "ERROR: #{path} -> #{matcher} matching provided nil #{filepath}"
error = "ERROR: #{path} #{matcher} matching provided nil #{filepath}"
raise CeedlingException.new(error)
end

Expand Down Expand Up @@ -153,7 +153,7 @@ def matches?(hash:, filepath:, section:, context:, operation:nil)
matched_notice(section:section, context:context, operation:operation, matcher:_matcher, filepath:filepath)
else # No match
path = generate_matcher_path(section, context, operation)
@streaminator.stream_puts("#{path} -> `#{matcher}` did not match #{filepath}", Verbosity::DEBUG)
@streaminator.stream_puts("#{path} `#{matcher}` did not match #{filepath}", Verbosity::DEBUG)
end
end

Expand All @@ -166,7 +166,7 @@ def matches?(hash:, filepath:, section:, context:, operation:nil)

def matched_notice(section:, context:, operation:, matcher:, filepath:)
path = generate_matcher_path(section, context, operation)
@streaminator.stream_puts("#{path} -> #{matcher} matched #{filepath}", Verbosity::OBNOXIOUS)
@streaminator.stream_puts("#{path} #{matcher} matched #{filepath}", Verbosity::OBNOXIOUS)
end

def generate_matcher_path(*keys)
Expand Down
2 changes: 1 addition & 1 deletion lib/ceedling/reportinator.rb
Original file line number Diff line number Diff line change
Expand Up @@ -116,7 +116,7 @@ def generate_config_walk(keys, depth=0)
_keys = keys.clone
_keys = _keys.slice(0, depth) if depth > 0
_keys.reject! { |key| key.nil? }
return _keys.map{|key| ":#{key}"}.join(' -> ')
return _keys.map{|key| ":#{key}"}.join(' ')
end

end
7 changes: 3 additions & 4 deletions lib/ceedling/streaminator.rb
Original file line number Diff line number Diff line change
Expand Up @@ -7,6 +7,8 @@

require 'ceedling/constants'

# Streaminator is a convenience object for handling verbosity and writing to the std streams

class Streaminator

constructor :streaminator_helper, :verbosinator, :loginator, :stream_wrapper
Expand All @@ -15,9 +17,6 @@ def setup()
$decorate = false if $decorate.nil?
end

# for those objects for whom the configurator has already been instantiated,
# Streaminator is a convenience object for handling verbosity and writing to the std streams

def stream_puts(string, verbosity=Verbosity::NORMAL, stream=nil)

# If no stream has been specified, choose one based on the verbosity level of the prompt
Expand All @@ -38,7 +37,7 @@ def stream_puts(string, verbosity=Verbosity::NORMAL, stream=nil)
# Apply decorations if supported
if ($decorate)
{
/ -> / => ' ',
/ / => ' >> ',
/^Ceedling/ => '🌱 Ceedling',
}.each_pair {|k,v| string.gsub!(k,v) }
if (verbosity == Verbosity::ERRORS)
Expand Down
2 changes: 1 addition & 1 deletion lib/ceedling/test_invoker_helper.rb
Original file line number Diff line number Diff line change
Expand Up @@ -294,7 +294,7 @@ def generate_executable_now(context:, build_path:, executable:, objects:, flags:
notice += "\n"
notice += "OPTIONS:\n" +
" 1. Doublecheck this test's #include statements.\n" +
" 2. Simplify complex macros or fully specify symbols for this test in :project -> :defines.\n" +
" 2. Simplify complex macros or fully specify symbols for this test in :project :defines.\n" +
" 3. If no header file corresponds to the needed source file, use the #{UNITY_TEST_SOURCE_FILE}()\n" +
" build diective macro in this test to inject a source file into the build.\n\n" +
"See the docs on conventions, paths, preprocessing, compilation symbols, and build directive macros.\n\n"
Expand Down
6 changes: 3 additions & 3 deletions lib/ceedling/tool_validator.rb
Original file line number Diff line number Diff line change
Expand Up @@ -101,7 +101,7 @@ def validate_executable(tool:, name:, extension:, respect_optional:, boom:)
end

if !exists
error = "#{name} -> :executable => `#{executable}` " + error
error = "#{name} :executable => `#{executable}` " + error
end

# Raise exception if executable can't be found and boom is set
Expand All @@ -124,7 +124,7 @@ def validate_stderr_redirect(tool:, name:, boom:)
if redirect.class == Symbol
if not StdErrRedirect.constants.map{|constant| constant.to_s}.include?( redirect.to_s.upcase )
options = StdErrRedirect.constants.map{|constant| ':' + constant.to_s.downcase}.join(', ')
error = "#{name} -> :stderr_redirect => :#{redirect} is not a recognized option {#{options}}."
error = "#{name} :stderr_redirect => :#{redirect} is not a recognized option {#{options}}."

# Raise exception if requested
raise CeedlingException.new( error ) if boom
Expand All @@ -134,7 +134,7 @@ def validate_stderr_redirect(tool:, name:, boom:)
return false
end
elsif redirect.class != String
raise CeedlingException.new( "#{name} -> :stderr_redirect is neither a recognized value nor custom string." )
raise CeedlingException.new( "#{name} :stderr_redirect is neither a recognized value nor custom string." )
end

return true
Expand Down
2 changes: 1 addition & 1 deletion lib/ceedling/unity_utils.rb
Original file line number Diff line number Diff line change
Expand Up @@ -109,7 +109,7 @@ def test_runner_cmdline_args_configured?()
if test_case_filters and !cmdline_args
# Blow up if filters are in use but test runner command line arguments are not enabled
msg = 'Unity test case filters cannot be used as configured. ' +
'Enable :test_runner -> :cmdline_args in your project configuration.'
'Enable :test_runner :cmdline_args in your project configuration.'

raise CeedlingException.new( msg )
end
Expand Down
4 changes: 2 additions & 2 deletions plugins/beep/lib/beep.rb
Original file line number Diff line number Diff line change
Expand Up @@ -32,13 +32,13 @@ def setup

# Ensure configuration option is an actual tool
if @tools[:beep_on_done].nil?
error = "Option :#{beep_config[:on_done]} for :beep -> :on_done plugin configuration does not map to a tool."
error = "Option :#{beep_config[:on_done]} for :beep :on_done plugin configuration does not map to a tool."
raise CeedlingException.new( error )
end

# Ensure configuration option is an actual tool
if @tools[:beep_on_error].nil?
error = "Option :#{beep_config[:on_done]} for :beep -> :on_error plugin configuration does not map to a tool."
error = "Option :#{beep_config[:on_done]} for :beep :on_error plugin configuration does not map to a tool."
raise CeedlingException.new( error )
end

Expand Down
2 changes: 1 addition & 1 deletion plugins/gcov/lib/gcov.rb
Original file line number Diff line number Diff line change
Expand Up @@ -238,7 +238,7 @@ def build_reportinators(config, enabled)
config.each do |reportinator|
if not GCOV_UTILITY_NAMES.map(&:upcase).include?( reportinator.upcase )
options = GCOV_UTILITY_NAMES.map{ |utility| "'#{utility}'" }.join(', ')
msg = "Plugin configuration :gcov -> :utilities => `#{reportinator}` is not a recognized option {#{options}}."
msg = "Plugin configuration :gcov :utilities => `#{reportinator}` is not a recognized option {#{options}}."
raise CeedlingException.new(msg)
end
end
Expand Down
4 changes: 2 additions & 2 deletions plugins/gcov/lib/gcovr_reportinator.rb
Original file line number Diff line number Diff line change
Expand Up @@ -158,9 +158,9 @@ def args_builder_common(gcovr_opts)
# Value sanity checks for :fail_under_* settings
if opt.to_s =~ /fail_/
if not value.is_a? Integer
raise CeedlingException.new(":gcov -> :gcovr -> :#{opt} => '#{value}' must be an integer")
raise CeedlingException.new(":gcov :gcovr :#{opt} => '#{value}' must be an integer")
elsif (value < 0) || (value > 100)
raise CeedlingException.new(":gcov -> :gcovr -> :#{opt} => '#{value}' must be an integer percentage 0 – 100")
raise CeedlingException.new(":gcov :gcovr :#{opt} => '#{value}' must be an integer percentage 0 – 100")
end
end

Expand Down

0 comments on commit 72419b4

Please sign in to comment.