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

Update TODOs and Elixir version #2073

Merged
merged 2 commits into from
Jan 27, 2025
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
2 changes: 1 addition & 1 deletion .github/workflows/ci.yml
Original file line number Diff line number Diff line change
Expand Up @@ -76,7 +76,7 @@ jobs:
matrix:
include:
# Test very old Elixir and Erlang
- elixir: "1.14"
- elixir: "1.15"
otp: "25"
# Test Erlang without -doc attribute support
- elixir: "1.16"
Expand Down
13 changes: 2 additions & 11 deletions assets/css/content/code.css
Original file line number Diff line number Diff line change
Expand Up @@ -63,17 +63,8 @@
}

@media screen and (max-width: 768px) {
/*
TODO:

This selector can be more specific once Firefox ships default
support for the :has() pseudo-class: https://caniuse.com/css-has

.content-inner > pre:has(code),
.content-inner section > pre:has(code) {
*/
.content-inner > pre,
.content-inner section > pre {
.content-inner > pre:has(code),
.content-inner section > pre:has(code) {
margin-left: calc(-1 * var(--content-gutter));
margin-right: calc(-1 * var(--content-gutter));
}
Expand Down
4 changes: 1 addition & 3 deletions lib/ex_doc/language.ex
Original file line number Diff line number Diff line change
Expand Up @@ -80,9 +80,7 @@ defmodule ExDoc.Language do
%{
id_key: binary(),
default_group: binary(),
# TODO: change to following on Elixir 1.15. It trips mix formatter between 1.14 and 1.15
# doc_fallback: (-> ExDoc.DocAST.t()),
doc_fallback: (... -> ExDoc.DocAST.t()),
doc_fallback: (-> ExDoc.DocAST.t()),
extra_annotations: [String.t()],
signature: [binary()],
source_file: String.t() | nil,
Expand Down
2 changes: 1 addition & 1 deletion lib/ex_doc/retriever.ex
Original file line number Diff line number Diff line change
Expand Up @@ -338,6 +338,6 @@ defmodule ExDoc.Retriever do
defp source_link(%{path: _, url: nil}, _line), do: nil

defp source_link(source, line) do
Utils.source_url_pattern(source.url, source.path |> Path.relative_to(File.cwd!()), line)
Utils.source_url_pattern(source.url, path_relative_to_cwd(source.path, []), line)
end
end
2 changes: 1 addition & 1 deletion mix.exs
Original file line number Diff line number Diff line change
Expand Up @@ -8,7 +8,7 @@ defmodule ExDoc.Mixfile do
[
app: :ex_doc,
version: @version,
elixir: "~> 1.14",
elixir: "~> 1.15",
deps: deps(),
aliases: aliases(),
package: package(),
Expand Down
8 changes: 1 addition & 7 deletions test/ex_doc/retriever/elixir_test.exs
Original file line number Diff line number Diff line change
Expand Up @@ -268,13 +268,7 @@ defmodule ExDoc.Retriever.ElixirTest do
assert mod.title == "MyException"
assert mod.type == :exception

# TODO: this is because `%ExDoc.Config{}.groups_for_modules == []`.
#
# We build the default groups (Exceptions, Deprecated) in lib/ex_doc.ex,
# maybe we should do that in the retriever instead?
#
# Remember Exceptions is an Elixir specific thing so the default should
# probably be language specific.
# TODO: this is because `%ExDoc.Config{}.groups_for_modules == []`
refute mod.group
end

Expand Down
42 changes: 0 additions & 42 deletions test/mix/tasks/docs_test.exs
Original file line number Diff line number Diff line change
Expand Up @@ -7,8 +7,6 @@ defmodule Mix.Tasks.DocsTest do

import ExUnit.CaptureIO

alias ExDoc.Utils

@moduletag :tmp_dir

def run(context, args, opts, generator \\ &{&1, &2, &3}) do
Expand Down Expand Up @@ -404,8 +402,6 @@ defmodule Mix.Tasks.DocsTest do
end)
end

# TODO:
@tag :skip
test "accepts warnings_as_errors in :warnings_as_errors", context do
assert [
{"ex_doc", "dev",
Expand All @@ -430,42 +426,4 @@ defmodule Mix.Tasks.DocsTest do
]}
] = run(context, [], app: :ex_doc, docs: [warnings_as_errors: false])
end

# TODO:
@tag :skip
@tag :tmp_dir
test "exits with 1 due to warnings, with flag --warnings_as_errors", context do
Utils.unset_warned()

Mix.Project.in_project(:single, "test/fixtures/single", fn _mod ->
source_beam = "_build/test/lib/single/ebin"

fun = fn ->
run_with_io(
context,
[],
[
app: :single,
docs: [
source_beam: source_beam,
warnings_as_errors: true,
formatter: "html",
deps: []
],
version: "0.1.0"
],
&ExDoc.generate_docs/3
)
end

io =
capture_io(:stderr, fn ->
assert catch_exit(fun.()) == {:shutdown, 1}
end)

assert io =~
"Documents have been generated, but generation for html format failed due to warnings " <>
"while using the --warnings-as-errors option."
end)
end
end