Skip to content

Commit

Permalink
fix: Fix dialyzer/dialyxir config (#2359)
Browse files Browse the repository at this point in the history
A few fixes:
- Uses the default dialyzer ignore file location and format
- Fails the CI task on dialyzer failure
  • Loading branch information
joshlarson authored Feb 4, 2025
1 parent 41edd16 commit 995eb2f
Show file tree
Hide file tree
Showing 4 changed files with 92 additions and 38 deletions.
33 changes: 0 additions & 33 deletions .dialyzer.ignore-warnings

This file was deleted.

90 changes: 90 additions & 0 deletions .dialyzer_ignore.exs
Original file line number Diff line number Diff line change
@@ -0,0 +1,90 @@
[
{"lib/alerts/parser.ex", :unknown_type},
{"lib/algolia/object.ex", :no_return},
{"lib/algolia/routes.ex", :call},
{"lib/algolia/routes.ex", :no_return},
{"lib/cms/api.ex", :unknown_type},
{"lib/cms/helpers.ex", :unknown_type},
{"lib/cms/partial/banner.ex", :unknown_type},
{"lib/cms/partial/teaser.ex", :unknown_type},
{"lib/cms/repo.ex", :pattern_match},
{"lib/cms/repo.ex", :unknown_type},
{"lib/dotcom/cache/subscriber.ex", :unmatched_return},
{"lib/dotcom/content_rewriter.ex", :call},
{"lib/dotcom/content_rewriter.ex", :invalid_contract},
{"lib/dotcom/content_rewriter.ex", :no_return},
{"lib/dotcom/content_rewriters/embedded_media.ex", :call},
{"lib/dotcom/content_rewriters/embedded_media.ex", :invalid_contract},
{"lib/dotcom/content_rewriters/embedded_media.ex", :no_return},
{"lib/dotcom/content_rewriters/links.ex", :invalid_contract},
{"lib/dotcom/content_rewriters/responsive_tables.ex", :invalid_contract},
{"lib/dotcom/floki_helpers.ex", :invalid_contract},
{"lib/dotcom/trip_plan/itinerary.ex", :unknown_type},
{"lib/dotcom/trip_plan/itinerary_row.ex", :unknown_type},
{"lib/dotcom/trip_plan/itinerary_row_list.ex", :unknown_type},
{"lib/dotcom/trip_plan/leg.ex", :guard_fail},
{"lib/dotcom/trip_plan/leg.ex", :invalid_contract},
{"lib/dotcom/trip_plan/leg.ex", :unknown_type},
{"lib/dotcom/trip_plan/location.ex", :call},
{"lib/dotcom/trip_plan/map.ex", :neg_guard_fail},
{"lib/dotcom/trip_plan/open_trip_planner.ex", :invalid_contract},
{"lib/dotcom/trip_plan/query.ex", :unknown_type},
{"lib/dotcom/trip_plan/related_link.ex", :call},
{"lib/dotcom/trip_plan/transit_detail.ex", :unknown_type},
{"lib/dotcom_web/components/trip_planner/itinerary_summary.ex", :unmatched_return},
{"lib/dotcom_web/controllers/cms_controller.ex", :pattern_match},
{"lib/dotcom_web/controllers/cms_controller.ex", :unknown_type},
{"lib/dotcom_web/controllers/event_controller.ex", :unknown_type},
{"lib/dotcom_web/controllers/fare_controller.ex", :unknown_type},
{"lib/dotcom_web/controllers/helpers.ex", :call},
{"lib/dotcom_web/controllers/helpers.ex", :invalid_contract},
{"lib/dotcom_web/controllers/map_config_controller.ex", :unknown_type},
{"lib/dotcom_web/controllers/mode/hub_behavior.ex", :unknown_type},
{"lib/dotcom_web/controllers/schedule/line/maps.ex", :unknown_type},
{"lib/dotcom_web/controllers/schedule/line_api.ex", :invalid_contract},
{"lib/dotcom_web/controllers/schedule/predictions.ex", :pattern_match},
{"lib/dotcom_web/controllers/schedule/timetable_controller.ex", :call},
{"lib/dotcom_web/controllers/schedule/timetable_controller.ex", :no_return},
{"lib/dotcom_web/controllers/search_controller.ex", :unknown_type},
{"lib/dotcom_web/controllers/transit_near_me_controller.ex", :pattern_match},
{"lib/dotcom_web/controllers/trip_plan/feedback.ex", :unmatched_return},
{"lib/dotcom_web/controllers/trip_plan_controller.ex", :call},
{"lib/dotcom_web/controllers/trip_plan_controller.ex", :no_return},
{"lib/dotcom_web/router.ex", :unused_fun},
{"lib/dotcom_web/stats.ex", :unmatched_return},
{"lib/dotcom_web/views/bus_stop_change_view.ex", :unknown_type},
{"lib/dotcom_web/views/helpers.ex", :unmatched_return},
{"lib/dotcom_web/views/helpers/cms_helpers.ex", :unknown_type},
{"lib/dotcom_web/views/page_content_view.ex", :call},
{"lib/dotcom_web/views/paragraph_view.ex", :unknown_type},
{"lib/dotcom_web/views/teaser_view.ex", :unknown_type},
{"lib/dotcom_web/views/trip_plan_view.ex", :invalid_contract},
{"lib/fares/fares.ex", :unknown_type},
{"lib/location_service/address.ex", :call},
{"lib/location_service/address.ex", :no_return},
{"lib/location_service/behaviour.ex", :unknown_type},
{"lib/location_service/location_service.ex", :unmatched_return},
{"lib/mix/tasks/header_footer.ex", :pattern_match},
{"lib/mix/tasks/header_footer.ex", :unknown_function},
{"lib/mix/tasks/header_footer.ex", :unmatched_return},
{"lib/open_trip_planner_client/schema/leg.ex", :unknown_type},
{"lib/open_trip_planner_client/schema/leg_time.ex", :unknown_type},
{"lib/predictions/pub_sub.ex", :unknown_type},
{"lib/predictions/pub_sub.ex", :unmatched_return},
{"lib/predictions/pub_sub/behaviour.ex", :unknown_type},
{"lib/predictions/repo.ex", :pattern_match},
{"lib/predictions/stream_supervisor.ex", :unknown_type},
{"lib/predictions/stream_topic.ex", :unknown_type},
{"lib/predictions/stream_worker.ex", :unknown_type},
{"lib/req/stats.ex", :unmatched_return},
{"lib/routes/populate_caches.ex", :unmatched_return},
{"lib/schedules/by_stop/departures.ex", :unknown_type},
{"lib/schedules/by_stop/schedules_by_stop_repo.ex", :unknown_type},
{"lib/schedules/hours_of_operation.ex", :unknown_type},
{"lib/telemetry/helper.ex", :unmatched_return},
{"test/support/cms/factory.ex", :call},
{"test/support/cms/factory.ex", :no_return},
{"test/support/cms/factory.ex", :unknown_type},
{"test/support/integration_helpers.ex", :unknown_function},
{"test/support/page_helpers.ex", :guard_fail}
]
4 changes: 1 addition & 3 deletions .github/workflows/tests.yml
Original file line number Diff line number Diff line change
Expand Up @@ -159,9 +159,7 @@ jobs:
steps:
- uses: actions/checkout@v4
- uses: ./.github/actions/setup-all
- uses: mbta/actions/dialyzer@v2
with:
cmd-line: "--ignore-exit-status"
- run: mix dialyzer

type_typescript:
name: Type checks / TypeScript
Expand Down
3 changes: 1 addition & 2 deletions mix.exs
Original file line number Diff line number Diff line change
Expand Up @@ -21,8 +21,7 @@ defmodule DotCom.Mixfile do
],
dialyzer: [
plt_add_apps: [:mix, :phoenix_live_reload],
flags: [:unmatched_returns],
ignore_warnings: ".dialyzer.ignore-warnings"
flags: [:unmatched_returns]
],
deps: deps(),

Expand Down

0 comments on commit 995eb2f

Please sign in to comment.