Skip to content
New issue

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

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

Already on GitHub? Sign in to your account

Add mentoring_request_url param to feedback_request comment #421

Merged
merged 2 commits into from
Feb 19, 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
6 changes: 5 additions & 1 deletion lib/elixir_analyzer/submission.ex
Original file line number Diff line number Diff line change
Expand Up @@ -103,7 +103,11 @@ defmodule ElixirAnalyzer.Submission do
[
%{
type: :informative,
comment: Constants.general_feedback_request()
comment: Constants.general_feedback_request(),
params: %{
mentoring_request_url:
"https://exercism.org/tracks/elixir/exercises/#{submission.source.slug}/mentor_discussions"
}
}
]
else
Expand Down
36 changes: 32 additions & 4 deletions test/elixir_analyzer_test.exs
Original file line number Diff line number Diff line change
Expand Up @@ -71,7 +71,14 @@ defmodule ElixirAnalyzerTest do
},
"type" => "informative"
},
%{"comment" => "elixir.general.feedback_request", "type" => "informative"}
%{
"comment" => "elixir.general.feedback_request",
"type" => "informative",
"params" => %{
"mentoring_request_url" =>
"https://exercism.org/tracks/elixir/exercises/two-fer/mentor_discussions"
}
}
],
"summary" => "Check the comments for some suggestions. 📣"
}
Expand Down Expand Up @@ -202,7 +209,14 @@ defmodule ElixirAnalyzerTest do
},
"type" => "informative"
},
%{"comment" => "elixir.general.feedback_request", "type" => "informative"}
%{
"comment" => "elixir.general.feedback_request",
"type" => "informative",
"params" => %{
"mentoring_request_url" =>
"https://exercism.org/tracks/elixir/exercises/not-a-real-exercise/mentor_discussions"
}
}
],
"summary" => "Check the comments for some suggestions. 📣"
}
Expand Down Expand Up @@ -270,7 +284,14 @@ defmodule ElixirAnalyzerTest do
"type" => "informative"
},
%{"comment" => "elixir.solution.todo_comment", "type" => "informative"},
%{"comment" => "elixir.general.feedback_request", "type" => "informative"}
%{
"comment" => "elixir.general.feedback_request",
"type" => "informative",
"params" => %{
"mentoring_request_url" =>
"https://exercism.org/tracks/elixir/exercises/lasagna/mentor_discussions"
}
}
],
"summary" => "Check the comments for some suggestions. 📣"
}
Expand All @@ -294,7 +315,14 @@ defmodule ElixirAnalyzerTest do
},
"type" => "actionable"
},
%{"comment" => "elixir.general.feedback_request", "type" => "informative"}
%{
"comment" => "elixir.general.feedback_request",
"type" => "informative",
"params" => %{
"mentoring_request_url" =>
"https://exercism.org/tracks/elixir/exercises/lasagna/mentor_discussions"
}
}
],
"summary" => "Check the comments for some suggestions. 📣"
}
Expand Down
Original file line number Diff line number Diff line change
@@ -1 +1 @@
{"comments":[{"comment":"elixir.solution.compiler_warnings","params":{"warnings":"warning: Behaviour.defcallback/1 is deprecated. Use the @callback module attribute instead\n lib/lasagna.ex:4:13\n\nwarning: HashDict.new/0 is deprecated. Use maps and the Map module instead\n lib/lasagna.ex:7:14\n\nwarning: HashSet.member?/2 is deprecated. Use the MapSet module instead\n lib/lasagna.ex:12:13\n\nwarning: HashSet.new/0 is deprecated. Use the MapSet module instead\n lib/lasagna.ex:12:29\n\n"},"type":"actionable"},{"comment":"elixir.general.feedback_request","type":"informative"}],"summary":"Check the comments for some suggestions. 📣"}
{"comments":[{"comment":"elixir.solution.compiler_warnings","params":{"warnings":"warning: Behaviour.defcallback/1 is deprecated. Use the @callback module attribute instead\n lib/lasagna.ex:4:13\n\nwarning: HashDict.new/0 is deprecated. Use maps and the Map module instead\n lib/lasagna.ex:7:14\n\nwarning: HashSet.member?/2 is deprecated. Use the MapSet module instead\n lib/lasagna.ex:12:13\n\nwarning: HashSet.new/0 is deprecated. Use the MapSet module instead\n lib/lasagna.ex:12:29\n\n"},"type":"actionable"},{"comment":"elixir.general.feedback_request","type":"informative","params": {"mentoring_request_url":"https://exercism.org/tracks/elixir/exercises/lasagna/mentor_discussions"}}],"summary":"Check the comments for some suggestions. 📣"}
2 changes: 1 addition & 1 deletion test_data/lasagna/failing_solution/expected_analysis.json
Original file line number Diff line number Diff line change
@@ -1 +1 @@
{"comments":[{"comment":"elixir.lasagna.function_reuse","type":"actionable"},{"comment":"elixir.solution.private_helper_functions","params":{"actual":"def public_helper(_)","expected":"defp public_helper(_)"},"type":"informative"},{"comment":"elixir.solution.todo_comment","type":"informative"},{"comment":"elixir.general.feedback_request","type":"informative"}],"summary":"Check the comments for some suggestions. 📣"}
{"comments":[{"comment":"elixir.lasagna.function_reuse","type":"actionable"},{"comment":"elixir.solution.private_helper_functions","params":{"actual":"def public_helper(_)","expected":"defp public_helper(_)"},"type":"informative"},{"comment":"elixir.solution.todo_comment","type":"informative"},{"comment":"elixir.general.feedback_request","type":"informative","params": {"mentoring_request_url":"https://exercism.org/tracks/elixir/exercises/lasagna/mentor_discussions"}}],"summary":"Check the comments for some suggestions. 📣"}
Original file line number Diff line number Diff line change
@@ -1,2 +1,2 @@
{"comments":[{"comment":"elixir.square-root.do_not_use_built_in_sqrt","type":"essential"},{"comment":"elixir.general.feedback_request","type":"informative"}],"summary":"Check the comments for things to fix. 🛠"}
{"comments":[{"comment":"elixir.square-root.do_not_use_built_in_sqrt","type":"essential"},{"comment":"elixir.general.feedback_request","type":"informative","params": {"mentoring_request_url":"https://exercism.org/tracks/elixir/exercises/square-root/mentor_discussions"}}],"summary":"Check the comments for things to fix. 🛠"}

Original file line number Diff line number Diff line change
@@ -1 +1 @@
{"comments":[{"comment":"elixir.solution.raise_fn_clause_error","type":"actionable"},{"comment":"elixir.solution.variable_name_snake_case","params":{"actual":"_nameInPascalCase","expected":"_name_in_pascal_case"},"type":"actionable"},{"comment":"elixir.solution.module_attribute_name_snake_case","params":{"actual":"someUnusedModuleAttribute","expected":"some_unused_module_attribute"},"type":"actionable"},{"comment":"elixir.solution.module_pascal_case","params":{"actual":"My_empty_module","expected":"MyEmptyModule"},"type":"actionable"},{"comment":"elixir.solution.compiler_warnings","params":{"warnings":"warning: module attribute @someUnusedModuleAttribute was set but never used\n lib/two_fer.ex:2\n\n"},"type":"actionable"},{"comment":"elixir.solution.indentation","type":"informative"},{"comment":"elixir.solution.private_helper_functions","params":{"actual":"def public_helper(_)","expected":"defp public_helper(_)"},"type":"informative"},{"comment":"elixir.general.feedback_request","type":"informative"}],"summary":"Check the comments for some suggestions. 📣"}
{"comments":[{"comment":"elixir.solution.raise_fn_clause_error","type":"actionable"},{"comment":"elixir.solution.variable_name_snake_case","params":{"actual":"_nameInPascalCase","expected":"_name_in_pascal_case"},"type":"actionable"},{"comment":"elixir.solution.module_attribute_name_snake_case","params":{"actual":"someUnusedModuleAttribute","expected":"some_unused_module_attribute"},"type":"actionable"},{"comment":"elixir.solution.module_pascal_case","params":{"actual":"My_empty_module","expected":"MyEmptyModule"},"type":"actionable"},{"comment":"elixir.solution.compiler_warnings","params":{"warnings":"warning: module attribute @someUnusedModuleAttribute was set but never used\n lib/two_fer.ex:2\n\n"},"type":"actionable"},{"comment":"elixir.solution.indentation","type":"informative"},{"comment":"elixir.solution.private_helper_functions","params":{"actual":"def public_helper(_)","expected":"defp public_helper(_)"},"type":"informative"},{"comment":"elixir.general.feedback_request","type":"informative","params": {"mentoring_request_url":"https://exercism.org/tracks/elixir/exercises/two_fer/mentor_discussions"}}],"summary":"Check the comments for some suggestions. 📣"}