Fix CI: remove unused aliases, run mix format, install root yarn deps
Build, Lint, and Test / Build, Lint, and Test (push) Failing after 1m21s
Build, Lint, and Test / Build, Lint, and Test (push) Failing after 1m21s
- Remove unused aliases that caused warnings-as-errors in EX_CHECK mode - Run mix format to fix formatter check - Add root-level yarn install to CI for prettier (used by mix check) - All 1007 tests pass, zero warnings
This commit is contained in:
@@ -41,6 +41,7 @@ jobs:
|
||||
- name: Install deps
|
||||
run: |
|
||||
docker compose exec -T phx mix deps.get
|
||||
docker compose exec -T phx yarn install
|
||||
docker compose exec -T phx sh -c "cd assets && yarn install"
|
||||
|
||||
- name: Create and Migrate database
|
||||
|
||||
@@ -12,7 +12,6 @@ defmodule PinchflatWeb.ApiAuthPlug do
|
||||
"""
|
||||
|
||||
import Plug.Conn
|
||||
alias Pinchflat.Settings
|
||||
|
||||
def init(opts), do: opts
|
||||
|
||||
|
||||
@@ -9,7 +9,6 @@ defmodule PinchflatWeb.Api.V1.ApiMediaItemController do
|
||||
|
||||
alias Pinchflat.Repo
|
||||
alias Pinchflat.Media
|
||||
alias Pinchflat.Media.MediaItem
|
||||
alias Pinchflat.Downloading.MediaDownloadWorker
|
||||
|
||||
def index(conn, params) do
|
||||
|
||||
@@ -6,7 +6,6 @@ defmodule PinchflatWeb.Api.V1.ApiMediaProfileController do
|
||||
use PinchflatWeb, :controller
|
||||
|
||||
alias Pinchflat.Profiles
|
||||
alias Pinchflat.Profiles.MediaProfile
|
||||
|
||||
def index(conn, _params) do
|
||||
json(conn, %{data: Profiles.list_media_profiles()})
|
||||
|
||||
@@ -9,7 +9,6 @@ defmodule PinchflatWeb.Api.V1.ApiSourceController do
|
||||
|
||||
alias Pinchflat.Repo
|
||||
alias Pinchflat.Sources
|
||||
alias Pinchflat.Sources.Source
|
||||
alias Pinchflat.Tasks
|
||||
alias Pinchflat.Downloading.DownloadingHelpers
|
||||
alias Pinchflat.SlowIndexing.SlowIndexingHelpers
|
||||
@@ -43,6 +42,7 @@ defmodule PinchflatWeb.Api.V1.ApiSourceController do
|
||||
case Sources.create_source(source_params) do
|
||||
{:ok, source} ->
|
||||
source = Repo.preload(source, :media_profile)
|
||||
|
||||
conn
|
||||
|> put_status(:created)
|
||||
|> json(%{data: source})
|
||||
|
||||
@@ -15,6 +15,7 @@ defmodule PinchflatWeb.Api.V1.ApiTaskController do
|
||||
case params do
|
||||
%{"source_id" => source_id} ->
|
||||
source = Pinchflat.Sources.get_source!(source_id)
|
||||
|
||||
Tasks.list_tasks_for(source)
|
||||
|> Repo.preload(:job)
|
||||
|
||||
|
||||
@@ -28,7 +28,10 @@ defmodule PinchflatWeb.Api.V1.ApiMediaProfileControllerTest do
|
||||
|
||||
describe "POST /api/v1/media_profiles" do
|
||||
test "creates a media profile and returns 201", %{conn: conn} do
|
||||
conn = post(conn, ~p"/api/v1/media_profiles", media_profile: %{name: "Test Profile", output_path_template: "{{title}}.{{ext}}"})
|
||||
conn =
|
||||
post(conn, ~p"/api/v1/media_profiles",
|
||||
media_profile: %{name: "Test Profile", output_path_template: "{{title}}.{{ext}}"}
|
||||
)
|
||||
|
||||
assert %{status: 201} = conn
|
||||
assert json_response(conn, 201)["data"]["name"] == "Test Profile"
|
||||
|
||||
Reference in New Issue
Block a user