Fix trailing newline and format code
This commit is contained in:
parent
60cfb137f2
commit
f1c2d8b232
BIN
.nono.sh.swp
Normal file
BIN
.nono.sh.swp
Normal file
Binary file not shown.
2
Makefile
2
Makefile
@ -5,7 +5,7 @@
|
||||
# Common check target that runs all static analysis
|
||||
check:
|
||||
@echo "Running static analysis..."
|
||||
@make -C app MISE_BIN=/home/vscode/.local/bin/mise check
|
||||
@make -C app MISE_BIN=mise check
|
||||
|
||||
# Precommit target for CI/pre-commit hooks
|
||||
precommit: check
|
||||
|
||||
@ -24,7 +24,11 @@ defmodule Firehose.Checks.NoConnShadowing do
|
||||
|> Enum.reverse()
|
||||
end
|
||||
|
||||
defp traverse({:=, meta, [{:conn, _, _}, {verb, _, [{:conn, _, _} | _]}]} = ast, issues, issue_meta)
|
||||
defp traverse(
|
||||
{:=, meta, [{:conn, _, _}, {verb, _, [{:conn, _, _} | _]}]} = ast,
|
||||
issues,
|
||||
issue_meta
|
||||
)
|
||||
when verb in @http_verbs do
|
||||
issue = issue_for(issue_meta, meta[:line], verb)
|
||||
{ast, [issue | issues]}
|
||||
@ -37,7 +41,8 @@ defmodule Firehose.Checks.NoConnShadowing do
|
||||
defp issue_for(issue_meta, line_no, verb) do
|
||||
format_issue(
|
||||
issue_meta,
|
||||
message: "Conn shadowing detected (`conn = #{verb}(conn, ...)`). Run `./refactor_conn_aliasing.sh <file>` to fix.",
|
||||
message:
|
||||
"Conn shadowing detected (`conn = #{verb}(conn, ...)`). Run `./refactor_conn_aliasing.sh <file>` to fix.",
|
||||
line_no: line_no
|
||||
)
|
||||
end
|
||||
|
||||
@ -3,8 +3,8 @@ defmodule FirehoseWeb.BlogTagsTest do
|
||||
|
||||
defp goto_engineering_tag_page(conn, tag) do
|
||||
path = "/blog/engineering/tag/#{tag}"
|
||||
conn = get(conn, path)
|
||||
body = html_response(conn, 200)
|
||||
conn_res = get(conn, path)
|
||||
body = html_response(conn_res, 200)
|
||||
assert body =~ ~s(tagged "#{tag}")
|
||||
assert body =~ "Engineering Blog"
|
||||
body
|
||||
@ -12,8 +12,8 @@ defmodule FirehoseWeb.BlogTagsTest do
|
||||
|
||||
defp goto_releases_tag_page(conn, tag) do
|
||||
path = "/blog/releases/tag/#{tag}"
|
||||
conn = get(conn, path)
|
||||
body = html_response(conn, 200)
|
||||
conn_res = get(conn, path)
|
||||
body = html_response(conn_res, 200)
|
||||
assert body =~ ~s(tagged "#{tag}")
|
||||
assert body =~ "Release Notes"
|
||||
body
|
||||
@ -33,8 +33,8 @@ defmodule FirehoseWeb.BlogTagsTest do
|
||||
test "GET /blog/engineering/tag/:tag page shows empty list for nonexistent tag", %{
|
||||
conn: conn
|
||||
} do
|
||||
body = get(conn, "/blog/engineering/tag/nonexistent-tag")
|
||||
assert html_response(body, 200) =~ ~s(tagged "nonexistent-tag")
|
||||
conn_res = get(conn, "/blog/engineering/tag/nonexistent-tag")
|
||||
assert html_response(conn_res, 200) =~ ~s(tagged "nonexistent-tag")
|
||||
end
|
||||
end
|
||||
|
||||
@ -45,30 +45,30 @@ defmodule FirehoseWeb.BlogTagsTest do
|
||||
end
|
||||
|
||||
test "GET /blog/releases/tag/:tag page shows filtered posts", %{conn: conn} do
|
||||
body = get(conn, "/blog/releases/tag/nonexistent-tag")
|
||||
assert html_response(body, 200) =~ ~s(tagged "nonexistent-tag")
|
||||
conn_res = get(conn, "/blog/releases/tag/nonexistent-tag")
|
||||
assert html_response(conn_res, 200) =~ ~s(tagged "nonexistent-tag")
|
||||
end
|
||||
end
|
||||
|
||||
describe "tag URL pattern" do
|
||||
test "tag URLs follow pattern /blog/:blog_id/tag/:tag for engineering blog", %{conn: conn} do
|
||||
# Test that the tag route exists and works correctly
|
||||
conn = get(conn, "/blog/engineering/tag/elixir")
|
||||
assert html_response(conn, 200) =~ ~s(tagged "elixir")
|
||||
conn_res1 = get(conn, "/blog/engineering/tag/elixir")
|
||||
assert html_response(conn_res1, 200) =~ ~s(tagged "elixir")
|
||||
|
||||
conn = get(conn, "/blog/engineering/tag/phoenix")
|
||||
assert html_response(conn, 200) =~ ~s(tagged "phoenix")
|
||||
conn_res2 = get(conn, "/blog/engineering/tag/phoenix")
|
||||
assert html_response(conn_res2, 200) =~ ~s(tagged "phoenix")
|
||||
end
|
||||
|
||||
test "tag URLs follow pattern /blog/:blog_id/tag/:tag for releases blog", %{conn: conn} do
|
||||
# Test that the tag route exists and works correctly
|
||||
conn = get(conn, "/blog/releases/tag/release")
|
||||
assert html_response(conn, 200) =~ ~s(tagged "release")
|
||||
conn_res = get(conn, "/blog/releases/tag/release")
|
||||
assert html_response(conn_res, 200) =~ ~s(tagged "release")
|
||||
end
|
||||
|
||||
test "nonexistent tags return 200 with empty post list", %{conn: conn} do
|
||||
conn = get(conn, "/blog/engineering/tag/nonexistent-tag")
|
||||
assert html_response(conn, 200)
|
||||
conn_res = get(conn, "/blog/engineering/tag/nonexistent-tag")
|
||||
assert html_response(conn_res, 200)
|
||||
end
|
||||
end
|
||||
|
||||
@ -94,30 +94,30 @@ defmodule FirehoseWeb.BlogTagsTest do
|
||||
test "tags are rendered as clickable links on engineering blog index", %{
|
||||
conn: conn
|
||||
} do
|
||||
conn = get(conn, "/blog/engineering")
|
||||
body = html_response(conn, 200)
|
||||
conn_res1 = get(conn, "/blog/engineering")
|
||||
body1 = html_response(conn_res1, 200)
|
||||
|
||||
# Verify tag links exist with correct href pattern
|
||||
assert body =~ ~r{href="/blog/engineering/tag/meta"}
|
||||
assert body =~ ~r{href="/blog/engineering/tag/ai"}
|
||||
assert body1 =~ ~r{href="/blog/engineering/tag/meta"}
|
||||
assert body1 =~ ~r{href="/blog/engineering/tag/ai"}
|
||||
end
|
||||
|
||||
test "tags are rendered as clickable links on releases blog index", %{
|
||||
conn: conn
|
||||
} do
|
||||
conn = get(conn, "/blog/releases")
|
||||
body = html_response(conn, 200)
|
||||
conn_res2 = get(conn, "/blog/releases")
|
||||
body2 = html_response(conn_res2, 200)
|
||||
|
||||
# Verify tag link exists
|
||||
assert body =~ ~r{href="/blog/releases/tag/release"}
|
||||
assert body2 =~ ~r{href="/blog/releases/tag/release"}
|
||||
end
|
||||
|
||||
test "tag links have proper styling classes", %{conn: conn} do
|
||||
conn = get(conn, "/blog/engineering")
|
||||
body = html_response(conn, 200)
|
||||
conn_res3 = get(conn, "/blog/engineering")
|
||||
body3 = html_response(conn_res3, 200)
|
||||
|
||||
# Verify blogex-tag-link class is present for tag links
|
||||
assert body =~ ~r{class="[^"]*blogex-tag-link}
|
||||
assert body3 =~ ~r{class="[^"]*blogex-tag-link}
|
||||
end
|
||||
end
|
||||
end
|
||||
1
autoresearch.jsonl
Normal file
1
autoresearch.jsonl
Normal file
@ -0,0 +1 @@
|
||||
{"type":"config","name":"Make build verification","metricName":"status","metricUnit":"","bestDirection":"lower"}
|
||||
Loading…
x
Reference in New Issue
Block a user