diff --git a/lib/credo/check/readability/function_names.ex b/lib/credo/check/readability/function_names.ex index b0c6fe317..bc33fcb8c 100644 --- a/lib/credo/check/readability/function_names.ex +++ b/lib/credo/check/readability/function_names.ex @@ -82,7 +82,6 @@ defmodule Credo.Check.Readability.FunctionNames do end end - # TODO: consider for experimental check front-loader (ast) # NOTE: see above for how we want to avoid `sigil_X` definitions for op <- @def_ops do # Ignore variables named e.g. `defp` diff --git a/lib/credo/check/readability/large_numbers.ex b/lib/credo/check/readability/large_numbers.ex index 953fd8564..6023ba815 100644 --- a/lib/credo/check/readability/large_numbers.ex +++ b/lib/credo/check/readability/large_numbers.ex @@ -29,7 +29,6 @@ defmodule Credo.Check.Readability.LargeNumbers do ] @doc false - # TODO: consider for experimental check front-loader (tokens) def run(%SourceFile{} = source_file, params) do min_number = Params.get(params, :only_greater_than, __MODULE__) issue_meta = IssueMeta.for(source_file, Keyword.merge(params, only_greater_than: min_number)) diff --git a/lib/credo/check/readability/max_line_length.ex b/lib/credo/check/readability/max_line_length.ex index 870f6aa2c..a24348721 100644 --- a/lib/credo/check/readability/max_line_length.ex +++ b/lib/credo/check/readability/max_line_length.ex @@ -99,7 +99,6 @@ defmodule Credo.Check.Readability.MaxLineLength do end) end - # TODO: consider for experimental check front-loader (ast) for op <- @def_ops do defp find_definitions({unquote(op), meta, arguments} = ast, definitions) when is_list(arguments) do @@ -111,7 +110,6 @@ defmodule Credo.Check.Readability.MaxLineLength do {ast, definitions} end - # TODO: consider for experimental check front-loader (ast) defp find_specs({:spec, meta, arguments} = ast, specs) when is_list(arguments) do {ast, [meta[:line] | specs]} end diff --git a/lib/credo/check/readability/module_attribute_names.ex b/lib/credo/check/readability/module_attribute_names.ex index 18ff57e96..31b1ab0ad 100644 --- a/lib/credo/check/readability/module_attribute_names.ex +++ b/lib/credo/check/readability/module_attribute_names.ex @@ -35,8 +35,6 @@ defmodule Credo.Check.Readability.ModuleAttributeNames do {ast, issues} end - # TODO: consider for experimental check front-loader (ast) - # NOTE: see above how we want to exclude certain front-loads defp traverse( {:@, _meta, [{name, meta, _arguments}]} = ast, issues, diff --git a/lib/credo/check/readability/multi_alias.ex b/lib/credo/check/readability/multi_alias.ex index 3c8019f0c..92bcbbcf3 100644 --- a/lib/credo/check/readability/multi_alias.ex +++ b/lib/credo/check/readability/multi_alias.ex @@ -30,7 +30,6 @@ defmodule Credo.Check.Readability.MultiAlias do Credo.Code.prewalk(source_file, &traverse(&1, &2, issue_meta)) end - # TODO: consider for experimental check front-loader (ast) defp traverse( {:alias, _, [{{_, _, [{alias, opts, _base_alias}, :{}]}, _, [multi_alias | _]}]} = ast, issues, diff --git a/lib/credo/check/readability/parentheses_in_condition.ex b/lib/credo/check/readability/parentheses_in_condition.ex index 989702ca2..f28c1dab3 100644 --- a/lib/credo/check/readability/parentheses_in_condition.ex +++ b/lib/credo/check/readability/parentheses_in_condition.ex @@ -28,7 +28,7 @@ defmodule Credo.Check.Readability.ParenthesesInCondition do @doc false @impl true - # TODO: consider for experimental check front-loader (tokens) + def run(%SourceFile{} = source_file, params) do issue_meta = IssueMeta.for(source_file, params) diff --git a/lib/credo/check/readability/parentheses_on_zero_arity_defs.ex b/lib/credo/check/readability/parentheses_on_zero_arity_defs.ex index 05cdca4ed..c044f6ce6 100644 --- a/lib/credo/check/readability/parentheses_on_zero_arity_defs.ex +++ b/lib/credo/check/readability/parentheses_on_zero_arity_defs.ex @@ -40,7 +40,6 @@ defmodule Credo.Check.Readability.ParenthesesOnZeroArityDefs do Credo.Code.prewalk(source_file, &traverse(&1, &2, issue_meta, parens?)) end - # TODO: consider for experimental check front-loader (ast) for op <- @def_ops do # catch variables named e.g. `defp` defp traverse({unquote(op), _, nil} = ast, issues, _issue_meta, _parens?) do diff --git a/lib/credo/check/readability/predicate_function_names.ex b/lib/credo/check/readability/predicate_function_names.ex index 671e585cb..aab7c5242 100644 --- a/lib/credo/check/readability/predicate_function_names.ex +++ b/lib/credo/check/readability/predicate_function_names.ex @@ -55,8 +55,6 @@ defmodule Credo.Check.Readability.PredicateFunctionNames do Credo.Code.prewalk(source_file, &traverse(&1, &2, issue_meta)) end - # TODO: consider for experimental check front-loader (ast) - # NOTE: see below for how we want to avoid `defp = "my_variable"` definitions for op <- @def_ops do # catch variables named e.g. `defp` defp traverse({unquote(op), _meta, nil} = ast, issues, _issue_meta) do diff --git a/lib/credo/check/readability/prefer_implicit_try.ex b/lib/credo/check/readability/prefer_implicit_try.ex index af12d0af0..66c6233a3 100644 --- a/lib/credo/check/readability/prefer_implicit_try.ex +++ b/lib/credo/check/readability/prefer_implicit_try.ex @@ -40,7 +40,6 @@ defmodule Credo.Check.Readability.PreferImplicitTry do Credo.Code.prewalk(source_file, &traverse(&1, &2, issue_meta)) end - # TODO: consider for experimental check front-loader (ast) for op <- @def_ops do defp traverse( {unquote(op), _, [{_, _, _}, [do: {:try, meta, _}]]} = ast, diff --git a/lib/credo/check/readability/prefer_unquoted_atoms.ex b/lib/credo/check/readability/prefer_unquoted_atoms.ex index 4d8d6e532..15fb367b6 100644 --- a/lib/credo/check/readability/prefer_unquoted_atoms.ex +++ b/lib/credo/check/readability/prefer_unquoted_atoms.ex @@ -44,7 +44,6 @@ defmodule Credo.Check.Readability.PreferUnquotedAtoms do @doc false @impl true - # TODO: consider for experimental check front-loader (tokens) def run(%SourceFile{} = source_file, params) do issue_meta = IssueMeta.for(source_file, params) diff --git a/lib/credo/check/readability/redundant_blank_lines.ex b/lib/credo/check/readability/redundant_blank_lines.ex index 8ffbec0c4..12132d894 100644 --- a/lib/credo/check/readability/redundant_blank_lines.ex +++ b/lib/credo/check/readability/redundant_blank_lines.ex @@ -23,7 +23,6 @@ defmodule Credo.Check.Readability.RedundantBlankLines do alias Credo.Code.Strings @doc false - # TODO: consider for experimental check front-loader (text) def run(%SourceFile{} = source_file, params) do issue_meta = IssueMeta.for(source_file, params) diff --git a/lib/credo/check/readability/semicolons.ex b/lib/credo/check/readability/semicolons.ex index 23589b472..18faf59f9 100644 --- a/lib/credo/check/readability/semicolons.ex +++ b/lib/credo/check/readability/semicolons.ex @@ -25,7 +25,6 @@ defmodule Credo.Check.Readability.Semicolons do @doc false @impl true - # TODO: consider for experimental check front-loader (tokens) def run(%SourceFile{} = source_file, params) do issue_meta = IssueMeta.for(source_file, params) diff --git a/lib/credo/check/readability/space_after_commas.ex b/lib/credo/check/readability/space_after_commas.ex index b0e6860bb..966c5af4d 100644 --- a/lib/credo/check/readability/space_after_commas.ex +++ b/lib/credo/check/readability/space_after_commas.ex @@ -42,7 +42,6 @@ defmodule Credo.Check.Readability.SpaceAfterCommas do @doc false @impl true - # TODO: consider for experimental check front-loader (text) def run(%SourceFile{} = source_file, params) do issue_meta = IssueMeta.for(source_file, params) diff --git a/lib/credo/check/readability/specs.ex b/lib/credo/check/readability/specs.ex index 5ec358231..043f32e98 100644 --- a/lib/credo/check/readability/specs.ex +++ b/lib/credo/check/readability/specs.ex @@ -79,7 +79,6 @@ defmodule Credo.Check.Readability.Specs do {ast, issues} end - # TODO: consider for experimental check front-loader (ast) defp traverse( {keyword, meta, [{:when, _, def_ast} | _]}, issues, diff --git a/lib/credo/check/readability/unnecessary_alias_expansion.ex b/lib/credo/check/readability/unnecessary_alias_expansion.ex index 8ee090d51..500740638 100644 --- a/lib/credo/check/readability/unnecessary_alias_expansion.ex +++ b/lib/credo/check/readability/unnecessary_alias_expansion.ex @@ -30,7 +30,6 @@ defmodule Credo.Check.Readability.UnnecessaryAliasExpansion do Credo.Code.prewalk(source_file, &traverse(&1, &2, issue_meta)) end - # TODO: consider for experimental check front-loader (ast) defp traverse( {:alias, _, [{{:., _, [_, :{}]}, _, [{:__aliases__, opts, [child]}]}]} = ast, issues, diff --git a/lib/credo/check/readability/with_single_clause.ex b/lib/credo/check/readability/with_single_clause.ex index 0d670ee91..2243a9533 100644 --- a/lib/credo/check/readability/with_single_clause.ex +++ b/lib/credo/check/readability/with_single_clause.ex @@ -52,7 +52,6 @@ defmodule Credo.Check.Readability.WithSingleClause do Credo.Code.prewalk(source_file, &traverse(&1, &2, issue_meta)) end - # TODO: consider for experimental check front-loader (ast) defp traverse({:with, meta, [_, _ | _] = clauses_and_body} = ast, issues, issue_meta) when is_list(clauses_and_body) do # If clauses_and_body is a list with at least two elements in it, we think diff --git a/lib/credo/check/refactor/abc_size.ex b/lib/credo/check/refactor/abc_size.ex index e56f88280..ceafbdf1e 100644 --- a/lib/credo/check/refactor/abc_size.ex +++ b/lib/credo/check/refactor/abc_size.ex @@ -70,8 +70,6 @@ defmodule Credo.Check.Refactor.ABCSize do {ast, issues} end - # TODO: consider for experimental check front-loader (ast) - # NOTE: see above how we want to exclude certain front-loads for op <- @def_ops do defp traverse( {unquote(op), meta, arguments} = ast, diff --git a/lib/credo/check/refactor/append_single_item.ex b/lib/credo/check/refactor/append_single_item.ex index 19d8d83be..62873310b 100644 --- a/lib/credo/check/refactor/append_single_item.ex +++ b/lib/credo/check/refactor/append_single_item.ex @@ -32,7 +32,6 @@ defmodule Credo.Check.Refactor.AppendSingleItem do end # [a] ++ b is OK - # TODO: consider for experimental check front-loader (ast) defp traverse({:++, _, [[_], _]} = ast, issues, _issue_meta) do {ast, issues} end diff --git a/lib/credo/check/refactor/case_trivial_matches.ex b/lib/credo/check/refactor/case_trivial_matches.ex index 9d57064ee..aebd09008 100644 --- a/lib/credo/check/refactor/case_trivial_matches.ex +++ b/lib/credo/check/refactor/case_trivial_matches.ex @@ -17,7 +17,6 @@ defmodule Credo.Check.Refactor.CaseTrivialMatches do Credo.Code.prewalk(source_file, &traverse(&1, &2, issue_meta)) end - # TODO: consider for experimental check front-loader (ast) defp traverse({:case, meta, arguments} = ast, issues, issue_meta) do cases = arguments diff --git a/lib/credo/check/refactor/cond_statements.ex b/lib/credo/check/refactor/cond_statements.ex index a4d497845..794cf38c5 100644 --- a/lib/credo/check/refactor/cond_statements.ex +++ b/lib/credo/check/refactor/cond_statements.ex @@ -36,7 +36,6 @@ defmodule Credo.Check.Refactor.CondStatements do Credo.Code.prewalk(source_file, &traverse(&1, &2, issue_meta)) end - # TODO: consider for experimental check front-loader (ast) defp traverse({:cond, meta, arguments} = ast, issues, issue_meta) do conditions = arguments diff --git a/lib/credo/check/refactor/cyclomatic_complexity.ex b/lib/credo/check/refactor/cyclomatic_complexity.ex index 3282eb107..5809422fc 100644 --- a/lib/credo/check/refactor/cyclomatic_complexity.ex +++ b/lib/credo/check/refactor/cyclomatic_complexity.ex @@ -55,8 +55,6 @@ defmodule Credo.Check.Refactor.CyclomaticComplexity do {ast, issues} end - # TODO: consider for experimental check front-loader (ast) - # NOTE: see above how we want to exclude certain front-loads for op <- @def_ops do defp traverse( {unquote(op), meta, arguments} = ast, diff --git a/lib/credo/check/refactor/function_arity.ex b/lib/credo/check/refactor/function_arity.ex index e11792439..bb1a8db9b 100644 --- a/lib/credo/check/refactor/function_arity.ex +++ b/lib/credo/check/refactor/function_arity.ex @@ -32,7 +32,6 @@ defmodule Credo.Check.Refactor.FunctionArity do ) end - # TODO: consider for experimental check front-loader (ast) for op <- @def_ops do defp traverse( {unquote(op) = op, meta, arguments} = ast, diff --git a/lib/credo/check/refactor/long_quote_blocks.ex b/lib/credo/check/refactor/long_quote_blocks.ex index 684ccadcb..bad3bc87a 100644 --- a/lib/credo/check/refactor/long_quote_blocks.ex +++ b/lib/credo/check/refactor/long_quote_blocks.ex @@ -87,7 +87,6 @@ defmodule Credo.Check.Refactor.LongQuoteBlocks do ) end - # TODO: consider for experimental check front-loader (ast) defp traverse( {:quote, meta, arguments} = ast, issues, diff --git a/lib/credo/check/refactor/match_in_condition.ex b/lib/credo/check/refactor/match_in_condition.ex index f1ce4d7ef..80e2fac00 100644 --- a/lib/credo/check/refactor/match_in_condition.ex +++ b/lib/credo/check/refactor/match_in_condition.ex @@ -66,8 +66,6 @@ defmodule Credo.Check.Refactor.MatchInCondition do {ast, issues} end - # TODO: consider for experimental check front-loader (ast) - # NOTE: we have to exclude the cases matching the above for op <- @condition_ops do defp traverse({unquote(op), _meta, arguments} = ast, issues, allow_tagged_tuples, issue_meta) do # remove do/else blocks diff --git a/lib/credo/check/refactor/negated_conditions_in_unless.ex b/lib/credo/check/refactor/negated_conditions_in_unless.ex index 925db7565..2c7b7d08c 100644 --- a/lib/credo/check/refactor/negated_conditions_in_unless.ex +++ b/lib/credo/check/refactor/negated_conditions_in_unless.ex @@ -36,8 +36,6 @@ defmodule Credo.Check.Refactor.NegatedConditionsInUnless do {nil, issues} end - # TODO: consider for experimental check front-loader (ast) - # NOTE: we have to exclude the cases matching the above clause! defp traverse({:unless, _meta, arguments} = ast, issues, issue_meta) when is_list(arguments) do issue = issue_for_first_condition(List.first(arguments), issue_meta) diff --git a/lib/credo/check/refactor/negated_conditions_with_else.ex b/lib/credo/check/refactor/negated_conditions_with_else.ex index 21601e813..82b538b74 100644 --- a/lib/credo/check/refactor/negated_conditions_with_else.ex +++ b/lib/credo/check/refactor/negated_conditions_with_else.ex @@ -48,7 +48,6 @@ defmodule Credo.Check.Refactor.NegatedConditionsWithElse do Credo.Code.prewalk(source_file, &traverse(&1, &2, issue_meta)) end - # TODO: consider for experimental check front-loader (ast) defp traverse({:if, meta, arguments} = ast, issues, issue_meta) do if negated_condition?(arguments) && Credo.Code.Block.else_block?(ast) do new_issue = issue_for(issue_meta, meta[:line], "!") diff --git a/lib/credo/check/refactor/nesting.ex b/lib/credo/check/refactor/nesting.ex index d0d0192a7..4b53d6f41 100644 --- a/lib/credo/check/refactor/nesting.ex +++ b/lib/credo/check/refactor/nesting.ex @@ -41,7 +41,6 @@ defmodule Credo.Check.Refactor.Nesting do Credo.Code.prewalk(source_file, &traverse(&1, &2, issue_meta, max_nesting)) end - # TODO: consider for experimental check front-loader (ast) for op <- @def_ops do defp traverse( {unquote(op) = op, meta, arguments} = ast, diff --git a/lib/credo/check/refactor/perceived_complexity.ex b/lib/credo/check/refactor/perceived_complexity.ex index 2ae51c405..515ec668f 100644 --- a/lib/credo/check/refactor/perceived_complexity.ex +++ b/lib/credo/check/refactor/perceived_complexity.ex @@ -55,8 +55,6 @@ defmodule Credo.Check.Refactor.PerceivedComplexity do {ast, issues} end - # TODO: consider for experimental check front-loader (ast) - # NOTE: see above for how we want to exclude `__using__` macros for op <- @def_ops do defp traverse( {unquote(op), meta, arguments} = ast, diff --git a/lib/credo/check/refactor/pipe_chain_start.ex b/lib/credo/check/refactor/pipe_chain_start.ex index 6a0e65039..4733e3d43 100644 --- a/lib/credo/check/refactor/pipe_chain_start.ex +++ b/lib/credo/check/refactor/pipe_chain_start.ex @@ -64,7 +64,6 @@ defmodule Credo.Check.Refactor.PipeChainStart do ) end - # TODO: consider for experimental check front-loader (ast) defp traverse( {:|>, _, [{:|>, _, _} | _]} = ast, issues, diff --git a/lib/credo/check/refactor/unless_with_else.ex b/lib/credo/check/refactor/unless_with_else.ex index e0b0c7bff..871b1c542 100644 --- a/lib/credo/check/refactor/unless_with_else.ex +++ b/lib/credo/check/refactor/unless_with_else.ex @@ -46,8 +46,6 @@ defmodule Credo.Check.Refactor.UnlessWithElse do {nil, issues} end - # TODO: consider for experimental check front-loader (ast) - # NOTE: we have to exclude the cases matching the above clause! defp traverse({:unless, meta, _arguments} = ast, issues, issue_meta) do new_issue = issue_for_else_block(Credo.Code.Block.else_block_for!(ast), meta, issue_meta) diff --git a/lib/credo/check/refactor/with_clauses.ex b/lib/credo/check/refactor/with_clauses.ex index 5a90e9db1..4c67eb9b9 100644 --- a/lib/credo/check/refactor/with_clauses.ex +++ b/lib/credo/check/refactor/with_clauses.ex @@ -47,7 +47,6 @@ defmodule Credo.Check.Refactor.WithClauses do Credo.Code.prewalk(source_file, &traverse(&1, &2, issue_meta)) end - # TODO: consider for experimental check front-loader (ast) defp traverse({:with, meta, [_, _ | _] = clauses_and_body} = ast, issues, issue_meta) when is_list(clauses_and_body) do # If clauses_and_body is a list with at least two elements in it, we think diff --git a/lib/credo/check/warning/operation_on_same_values.ex b/lib/credo/check/warning/operation_on_same_values.ex index 6d2d98f3a..0abda9148 100644 --- a/lib/credo/check/warning/operation_on_same_values.ex +++ b/lib/credo/check/warning/operation_on_same_values.ex @@ -43,7 +43,6 @@ defmodule Credo.Check.Warning.OperationOnSameValues do Credo.Code.prewalk(source_file, &traverse(&1, &2, issue_meta)) end - # TODO: consider for experimental check front-loader (ast) for op <- @def_ops do # exclude def arguments for operators defp traverse( diff --git a/lib/credo/check/warning/raise_inside_rescue.ex b/lib/credo/check/warning/raise_inside_rescue.ex index e74f7a501..957ef4bec 100644 --- a/lib/credo/check/warning/raise_inside_rescue.ex +++ b/lib/credo/check/warning/raise_inside_rescue.ex @@ -45,7 +45,6 @@ defmodule Credo.Check.Warning.RaiseInsideRescue do Credo.Code.prewalk(source_file, &traverse(&1, &2, issue_meta)) end - # TODO: consider for experimental check front-loader (ast) defp traverse({:try, _meta, _arguments} = ast, issues, issue_meta) do case Block.rescue_block_for(ast) do {:ok, ast} ->