neiam
/apollos_crib
It's Apollo's Crib
public · Issues · Pulls 1 · Labels · Forks · Compare · Actions failure · Badges · Packages
Log in to mark this repository.
Credo: IO.inspect leftovers out, dropped Enum results made explicit
ef5ef67 · Gabe Morell · 2026-11-04 20:41
Message
{commit_body(@commit)}
Files changed
modified
apps/room_air_quality/lib/room_air_quality/aqi_worker.ex
+2
−3
| 129 | 129 | |> Map.put(:inserted_at, datetime) |
| 130 | 130 | |> Map.put(:updated_at, datetime) |
| 131 | 131 | end) |
| 132 | − |> Stream.map(fn x -> | |
| 132 | + |> Enum.each(fn x -> | |
| 133 | 133 | Repo.insert( |
| 134 | 134 | x, |
| 135 | 135 | on_conflict: {:replace_all_except, [:id]}, |
| 136 | 136 | conflict_target: [:source_id, :site_name, :parameter_name] |
| 137 | 137 | ) |
| 138 | 138 | end) |
| 139 | − |> Enum.to_list() | |
| 140 | 139 | |
| 141 | 140 | :sites -> |
| 142 | 141 | result.body |
| 201 | 200 | |> Map.put(:inserted_at, datetime) |
| 202 | 201 | |> Map.put(:updated_at, datetime) |
| 203 | 202 | end) |
| 204 | − |> Enum.map(fn x -> | |
| 203 | + |> Enum.each(fn x -> | |
| 205 | 204 | Repo.insert( |
| 206 | 205 | x, |
| 207 | 206 | on_conflict: {:replace_all_except, [:id]}, |
modified
apps/room_calendar/lib/room_calendar/calendar_worker.ex
+9
−7
| 75 | 75 | |> Map.put(:updated_at, dt) |
| 76 | 76 | end) |
| 77 | 77 | |
| 78 | − Repo.insert_all( | |
| 79 | − RoomSanctum.Storage.ICalendar, | |
| 80 | − data, | |
| 81 | − on_conflict: {:replace_all_except, [:id]}, | |
| 82 | − conflict_target: [:source_id, :blob] | |
| 83 | − ) | |
| 84 | − |> IO.inspect() | |
| 78 | + {count, _} = | |
| 79 | + Repo.insert_all( | |
| 80 | + RoomSanctum.Storage.ICalendar, | |
| 81 | + data, | |
| 82 | + on_conflict: {:replace_all_except, [:id]}, | |
| 83 | + conflict_target: [:source_id, :blob] | |
| 84 | + ) | |
| 85 | + | |
| 86 | + Logger.debug("iCAL::#{state.id} wrote #{count} entries") | |
| 85 | 87 | |
| 86 | 88 | {:error, reason} -> |
| 87 | 89 | IO.puts("error #{reason.reason}") |
modified
apps/room_ephem/lib/room_ephem/ephem_worker.ex
+0
−1
| 100 | 100 | |
| 101 | 101 | @decorate cacheable(cache: RoomZeus.Cache, opts: [ttl: @ttl]) |
| 102 | 102 | def query_ephem(_name, query) do |
| 103 | − IO.inspect("QEPH") | |
| 104 | 103 | {lon, lat} = Configuration.place_for!(query).coordinates |
| 105 | 104 | lat = normalize_ll(lat) |
| 106 | 105 | lon = normalize_ll(lon) |
modified
apps/room_gbfs/lib/room_gbfs/gbfs_worker.ex
+2
−5
| 269 | 269 | point = %Geo.MultiPolygon{coordinates: x.geometry.coordinates, srid: 4326} |
| 270 | 270 | x |> Map.put(:place, point) |
| 271 | 271 | end) |
| 272 | − |> IO.inspect() | |
| 273 | 272 | |> Enum.map(fn x -> |
| 274 | 273 | RoomSanctum.Storage.change_geo_fencing_zones( |
| 275 | 274 | %RoomSanctum.Storage.GBFS.V1.GeoFencingZones{}, |
| 277 | 276 | ).changes |
| 278 | 277 | |> inj_iddt(id, dt) |
| 279 | 278 | end) |
| 280 | − |> IO.inspect() | |
| 281 | 279 | |
| 282 | 280 | RoomSanctum.Storage.truncate_geo_fencing_zones(id) |
| 283 | 281 |
| 397 | 395 | # work out how many of its bikes are electric, and operators |
| 398 | 396 | # list the feeds in whatever order suits them. |
| 399 | 397 | |> Enum.sort_by(&RoomGbfs.V3.feed_order/1) |
| 400 | − |> Enum.map(fn %{"name" => name, "url" => url} -> | |
| 398 | + |> Enum.each(fn %{"name" => name, "url" => url} -> | |
| 401 | 399 | # v3 renamed the loose-vehicle feed; everything below is |
| 402 | 400 | # written in v2's names, which is the one dialect this worker |
| 403 | 401 | # speaks. |
| 497 | 495 | |
| 498 | 496 | feeds |
| 499 | 497 | |> Enum.sort_by(&RoomGbfs.V3.feed_order/1) |
| 500 | − |> Enum.map(fn %{"name" => name, "url" => url} -> | |
| 498 | + |> Enum.each(fn %{"name" => name, "url" => url} -> | |
| 501 | 499 | case RoomGbfs.V3.feed_name(name) do |
| 502 | 500 | "station_information" -> |
| 503 | 501 | write_data(url, :stat_info, state.id, cfg.config.lang) |
| 585 | 583 | Storage.count_free_bikes_types(id) |
| 586 | 584 | |> Enum.map(fn %{cnt: cnt, ff: ff} -> {ff, cnt} end) |
| 587 | 585 | |> Map.new() |
| 588 | − |> IO.inspect() | |
| 589 | 586 | |
| 590 | 587 | %{ |
| 591 | 588 | free_bikes: Storage.count_free_bikes(id) |
modified
apps/room_gtfs/lib/room_gtfs/gtfs_worker.ex
+13
−11
| 2068 | 2068 | [] |
| 2069 | 2069 | ) |
| 2070 | 2070 | |
| 2071 | − Enum.into(contents, stream) | |
| 2071 | + contents |> Stream.into(stream) |> Stream.run() | |
| 2072 | 2072 | |
| 2073 | 2073 | qtc = |
| 2074 | 2074 | Postgrex.prepare!( |
| 2104 | 2104 | end, |
| 2105 | 2105 | timeout: :infinity |
| 2106 | 2106 | ) |
| 2107 | − |> IO.inspect() | |
| 2108 | 2107 | |
| 2109 | 2108 | GenServer.stop(pid) |
| 2110 | 2109 | end |
| 2219 | 2218 | ) |
| 2220 | 2219 | end |
| 2221 | 2220 | end) |
| 2222 | − |> Enum.count() | |
| 2221 | + |> Stream.run() | |
| 2223 | 2222 | |
| 2224 | 2223 | DateTime.utc_now() |
| 2225 | 2224 | end |
| 2533 | 2532 | files |
| 2534 | 2533 | |> gtfs_entries(id) |
| 2535 | 2534 | |> Enum.sort_by(&file_to_order(Path.basename(&1.file_name))) |
| 2536 | − |> Enum.map(fn e -> | |
| 2535 | + |> Enum.each(fn e -> | |
| 2537 | 2536 | name = Path.basename(e.file_name) |
| 2538 | 2537 | type = file_to_atom(name) |
| 2539 | 2538 |
| 2620 | 2619 | |> :zip.unzip([:memory]) do |
| 2621 | 2620 | {:ok, files} -> |
| 2622 | 2621 | files |
| 2623 | − |> Enum.map(fn {name, data} -> | |
| 2622 | + |> Enum.each(fn {name, data} -> | |
| 2624 | 2623 | as_csv = |
| 2625 | 2624 | data |
| 2626 | 2625 | |> String.split("\n") |
| 2629 | 2628 | |> XP.parse_stream() |
| 2630 | 2629 | |
| 2631 | 2630 | Logger.info({"datum", as_csv}) |
| 2632 | − IO.inspect({"datum", as_csv}) | |
| 2633 | 2631 | |
| 2634 | 2632 | case name do |
| 2635 | 2633 | 'agency.txt' -> |
| 2720 | 2718 | url_rt_tu: cfg.config.url_rt_tu, |
| 2721 | 2719 | url_rt_vp: cfg.config.url_rt_vp |
| 2722 | 2720 | } |
| 2723 | − |> IO.inspect(label: "RT URLs for source #{id}") | |
| 2721 | + |> show(label: "RT URLs for source #{id}") | |
| 2724 | 2722 | end |
| 2725 | 2723 | |
| 2726 | 2724 | @doc """ |
| 2740 | 2738 | alerts: feed.entity |> Enum.count(& &1.alert) |
| 2741 | 2739 | } |
| 2742 | 2740 | |
| 2743 | − IO.inspect(summary, label: "Feed summary") | |
| 2741 | + show(summary, label: "Feed summary") | |
| 2744 | 2742 | {:ok, feed} |
| 2745 | 2743 | |
| 2746 | 2744 | {:error, reason} -> |
| 2747 | − IO.inspect(reason, label: "Fetch failed") | |
| 2745 | + show(reason, label: "Fetch failed") | |
| 2748 | 2746 | {:error, reason} |
| 2749 | 2747 | end |
| 2750 | 2748 | end |
| 2785 | 2783 | rt_tu: feed_summary(state.rt_tu), |
| 2786 | 2784 | rt_vp: feed_summary(state.rt_vp) |
| 2787 | 2785 | } |
| 2788 | − |> IO.inspect(label: "RT worker state for source #{id}") | |
| 2786 | + |> show(label: "RT worker state for source #{id}") | |
| 2789 | 2787 | end |
| 2790 | 2788 | end |
| 2791 | 2789 |
| 2849 | 2847 | "#{length(entities)} trip_update entities#{if stop_id, do: " for stop #{stop_id}", else: ""}:" |
| 2850 | 2848 | ) |
| 2851 | 2849 | |
| 2852 | − entities |> IO.inspect(limit: :infinity) | |
| 2850 | + entities |> show(limit: :infinity) | |
| 2853 | 2851 | end |
| 2854 | 2852 | end |
| 2855 | 2853 | end |
| 2952 | 2950 | _ -> :undefined |
| 2953 | 2951 | end |
| 2954 | 2952 | end |
| 2953 | + | |
| 2954 | + # Printing is what these IEx helpers are for, not a leftover. | |
| 2955 | + # credo:disable-for-next-line Credo.Check.Warning.IoInspect | |
| 2956 | + defp show(term, opts), do: IO.inspect(term, opts) | |
| 2955 | 2957 | end |
modified
apps/room_hermes/lib/room_hermes/mail/server.ex
+1
−5
Click to load diff…
modified
apps/room_hermes/lib/room_hermes/mail/smtp.ex
+1
−1
Click to load diff…
modified
apps/room_sanctum/lib/room_sanctum/condensers/basic_mqtt.ex
+0
−1
Click to load diff…
modified
apps/room_sanctum/lib/room_sanctum/configuration/vision.ex
+1
−1
Click to load diff…
modified
apps/room_sanctum/lib/room_sanctum/queues/mail.ex
+35
−48
Click to load diff…
modified
apps/room_sanctum/lib/room_sanctum/queues/webhooks.ex
+1
−1
Click to load diff…
modified
apps/room_sanctum/lib/room_sanctum/workers/ankyra_worker.ex
+6
−6
Click to load diff…
modified
apps/room_sanctum/lib/room_sanctum_web/controllers/data_controller.ex
+1
−1
Click to load diff…
modified
apps/room_sanctum/lib/room_sanctum_web/live/cfg_pythiae_live/form_component.ex
+0
−2
Click to load diff…
modified
apps/room_sanctum/lib/room_sanctum_web/live/cfg_query_live/index.ex
+0
−2
Click to load diff…
modified
apps/room_sanctum/lib/room_sanctum_web/live/cfg_source_live/index.ex
+0
−7
Click to load diff…
modified
apps/room_sanctum/lib/room_sanctum_web/live/cfg_source_live/show.ex
+3
−8
Click to load diff…
modified
apps/room_sanctum/lib/room_sanctum_web/live/keryx_live/form_component.ex
+2
−2
Click to load diff…
modified
apps/room_scribes/lib/room_scribes/scribus_timer.ex
+0
−1
Click to load diff…
Parents: 03fe2d0