Skip to content

Commit

Permalink
Don't break builds of our dependents if new warnings appear
Browse files Browse the repository at this point in the history
We limit warnings-as-errors to the Mix test env, which still ensures
tests will fail (and CI) if there are warnings.

GitHub issue:
* #7
  • Loading branch information
g-andrade committed Oct 29, 2023
1 parent 305d0b6 commit c608744
Show file tree
Hide file tree
Showing 2 changed files with 18 additions and 5 deletions.
5 changes: 5 additions & 0 deletions CHANGELOG.md
Original file line number Diff line number Diff line change
Expand Up @@ -11,6 +11,11 @@ and this project adheres to [Semantic Versioning](https://semver.org/spec/v2.0.0

- `new!/0` and `new!/1` to ease storing context in module attributes

### Fixed

- unwarranted risk of new future warnings breaking the builds of sqids
dependents

## [0.1.0] - 2023-10-28

### Added
Expand Down
18 changes: 13 additions & 5 deletions mix.exs
Original file line number Diff line number Diff line change
Expand Up @@ -5,17 +5,17 @@ defmodule Sqids.MixProject do
@source_url "https://github.com/sqids/sqids-elixir"

def project do
mix_env = Mix.env()

[
app: :sqids,
version: @version,
description: description(),
elixir: "~> 1.7",
start_permanent: Mix.env() === :prod,
start_permanent: mix_env === :prod,
deps: deps(),
elixirc_paths: elixirc_paths(Mix.env()),
elixirc_options: [
warnings_as_errors: true
],
elixirc_paths: elixirc_paths(mix_env),
elixirc_options: elixirc_options(mix_env),
docs: docs(),
test_coverage: [
summary: [
Expand Down Expand Up @@ -75,6 +75,14 @@ defmodule Sqids.MixProject do
end
end

defp elixirc_options(env) do
if env === :test do
[warnings_as_errors: true]
else
[]
end
end

defp docs do
[
main: "readme",
Expand Down

0 comments on commit c608744

Please sign in to comment.