diff --git a/.check.exs b/.check.exs index bf33eee..97e799f 100644 --- a/.check.exs +++ b/.check.exs @@ -1,15 +1,10 @@ -[ - ## all available options with default values (see `mix check` docs for description) - # parallel: true, - # skipped: true, +# SPDX-FileCopyrightText: 2020 Zach Daniel +# +# SPDX-License-Identifier: MIT - ## list of tools (see `mix check` docs for defaults) +[ tools: [ - ## curated tools may be disabled (e.g. the check for compilation warnings) - # {:compiler, false}, - - ## ...or adjusted (e.g. use one-line formatter for more compact credo output) - # {:credo, "mix credo --format oneline"}, - {:doctor, false} + {:doctor, false}, + {:reuse, command: ["pipx", "run", "reuse", "lint", "-q"]} ] ] diff --git a/.credo.exs b/.credo.exs index 9215ef2..c231f91 100644 --- a/.credo.exs +++ b/.credo.exs @@ -1,3 +1,7 @@ +# SPDX-FileCopyrightText: 2020 Zach Daniel +# +# SPDX-License-Identifier: MIT + # This file contains the configuration for Credo and you are probably reading # this after creating it with `mix credo.gen.config`. # diff --git a/.doctor.exs b/.doctor.exs index 56efb6e..5221697 100644 --- a/.doctor.exs +++ b/.doctor.exs @@ -1,3 +1,7 @@ +# SPDX-FileCopyrightText: 2020 Zach Daniel +# +# SPDX-License-Identifier: MIT + %Doctor.Config{ ignore_modules: [ ], ignore_paths: [], diff --git a/.formatter.exs b/.formatter.exs index d2cda26..bd5d678 100644 --- a/.formatter.exs +++ b/.formatter.exs @@ -1,3 +1,7 @@ +# SPDX-FileCopyrightText: 2020 Zach Daniel +# +# SPDX-License-Identifier: MIT + # Used by "mix format" [ inputs: ["{mix,.formatter}.exs", "{config,lib,test}/**/*.{ex,exs}"] diff --git a/.github/dependabot.yml b/.github/dependabot.yml index 47da1a1..461c067 100644 --- a/.github/dependabot.yml +++ b/.github/dependabot.yml @@ -1,3 +1,7 @@ +# SPDX-FileCopyrightText: 2020 Zach Daniel +# +# SPDX-License-Identifier: MIT + --- updates: - directory: / diff --git a/.github/workflows/ci.yml b/.github/workflows/ci.yml index 6819a09..01e8275 100644 --- a/.github/workflows/ci.yml +++ b/.github/workflows/ci.yml @@ -1,3 +1,7 @@ +# SPDX-FileCopyrightText: 2020 Zach Daniel +# +# SPDX-License-Identifier: MIT + name: Ash CI on: push: @@ -12,5 +16,6 @@ jobs: with: spark-formatter: false spark-cheat-sheets: false + reuse: true secrets: HEX_API_KEY: ${{ secrets.HEX_API_KEY }} diff --git a/.gitignore b/.gitignore index 96b5b76..dcd2a86 100644 --- a/.gitignore +++ b/.gitignore @@ -1,3 +1,7 @@ +# SPDX-FileCopyrightText: 2020 Zach Daniel +# +# SPDX-License-Identifier: MIT + # The directory Mix will write compiled artifacts to. /_build/ diff --git a/.tool-versions b/.tool-versions index 4c93d59..0f2418e 100644 --- a/.tool-versions +++ b/.tool-versions @@ -1,2 +1,3 @@ erlang 26.0.2 elixir 1.18.4 +pipx 1.8.0 diff --git a/.tool-versions.license b/.tool-versions.license new file mode 100644 index 0000000..815664f --- /dev/null +++ b/.tool-versions.license @@ -0,0 +1,3 @@ +SPDX-FileCopyrightText: 2020 Zach Daniel + +SPDX-License-Identifier: MIT diff --git a/CHANGELOG.md b/CHANGELOG.md index 61eb740..3e1f4ba 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -1,3 +1,9 @@ + + # Change Log All notable changes to this project will be documented in this file. diff --git a/LICENSE b/LICENSE deleted file mode 100644 index 4eb51a5..0000000 --- a/LICENSE +++ /dev/null @@ -1,21 +0,0 @@ -MIT License - -Copyright (c) 2020 Zachary Scott Daniel - -Permission is hereby granted, free of charge, to any person obtaining a copy -of this software and associated documentation files (the "Software"), to deal -in the Software without restriction, including without limitation the rights -to use, copy, modify, merge, publish, distribute, sublicense, and/or sell -copies of the Software, and to permit persons to whom the Software is -furnished to do so, subject to the following conditions: - -The above copyright notice and this permission notice shall be included in all -copies or substantial portions of the Software. - -THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR -IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, -FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE -AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER -LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, -OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE -SOFTWARE. diff --git a/LICENSES/MIT.txt b/LICENSES/MIT.txt new file mode 100644 index 0000000..d817195 --- /dev/null +++ b/LICENSES/MIT.txt @@ -0,0 +1,18 @@ +MIT License + +Copyright (c) + +Permission is hereby granted, free of charge, to any person obtaining a copy of this software and +associated documentation files (the "Software"), to deal in the Software without restriction, including +without limitation the rights to use, copy, modify, merge, publish, distribute, sublicense, and/or sell +copies of the Software, and to permit persons to whom the Software is furnished to do so, subject to the +following conditions: + +The above copyright notice and this permission notice shall be included in all copies or substantial +portions of the Software. + +THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR IMPLIED, INCLUDING BUT NOT +LIMITED TO THE WARRANTIES OF MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO +EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER +IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE +USE OR OTHER DEALINGS IN THE SOFTWARE. diff --git a/README.md b/README.md index a1d05b2..7276eef 100644 --- a/README.md +++ b/README.md @@ -1,3 +1,13 @@ + +[![Elixir CI](https://github.com/ash-project/splode/actions/workflows/ci.yml/badge.svg)](https://github.com/ash-project/splode/actions/workflows/ci.yml)[![License: MIT](https://img.shields.io/badge/License-MIT-yellow.svg)](https://opensource.org/licenses/MIT) +[![Hex version badge](https://img.shields.io/hexpm/v/splode.svg)](https://hex.pm/packages/splode) +[![Hexdocs badge](https://img.shields.io/badge/docs-hexdocs-purple)](https://hexdocs.pm/splode) +[![REUSE status](https://api.reuse.software/badge/github.com/ash-project/splode)](https://api.reuse.software/info/github.com/ash-project/splode) + # Splode Splode helps you deal with errors and exceptions in your application that are aggregatable and consistent. The general pattern is that you use the `Splode` module as a top level aggregator of error classes, and whenever you return errors, you return one of your `Splode.Error` structs, or a string, or a keyword list. Then, if you want to group errors together, you can use your `Splode` module to do so. You can also use that module to turn any arbitrary value into a splode error. diff --git a/config/config.exs b/config/config.exs index de37b6e..7b76d4d 100644 --- a/config/config.exs +++ b/config/config.exs @@ -1,3 +1,7 @@ +# SPDX-FileCopyrightText: 2020 Zach Daniel +# +# SPDX-License-Identifier: MIT + import Config if Mix.env() == :dev do diff --git a/documentation/tutorials/get-started-with-splode.md b/documentation/tutorials/get-started-with-splode.md index 2f1893f..312e1c1 100644 --- a/documentation/tutorials/get-started-with-splode.md +++ b/documentation/tutorials/get-started-with-splode.md @@ -1,3 +1,9 @@ + + # Get Started with Splode Splode helps you deal with errors and exceptions in your application that are aggregatable and consistent. The general pattern is that you use the `Splode` module as a top level aggregator of error classes, and whenever you return errors, you return one of your `Splode.Error` structs, or a string, or a keyword list. Then, if you want to group errors together, you can use your `Splode` module to do so. You can also use that module to turn any arbitrary value into a splode error. diff --git a/lib/splode.ex b/lib/splode.ex index 0b71ac7..4f63865 100644 --- a/lib/splode.ex +++ b/lib/splode.ex @@ -1,3 +1,7 @@ +# SPDX-FileCopyrightText: 2020 Zach Daniel +# +# SPDX-License-Identifier: MIT + defmodule Splode do @moduledoc """ Use this module to create your error aggregator and handler. diff --git a/lib/splode/error.ex b/lib/splode/error.ex index 01a823c..2f34376 100644 --- a/lib/splode/error.ex +++ b/lib/splode/error.ex @@ -1,3 +1,7 @@ +# SPDX-FileCopyrightText: 2020 Zach Daniel +# +# SPDX-License-Identifier: MIT + defmodule Splode.Error do @moduledoc """ Use this module to create an aggregatable error. diff --git a/lib/splode/error_class.ex b/lib/splode/error_class.ex index ba35746..1fd7823 100644 --- a/lib/splode/error_class.ex +++ b/lib/splode/error_class.ex @@ -1,3 +1,7 @@ +# SPDX-FileCopyrightText: 2020 Zach Daniel +# +# SPDX-License-Identifier: MIT + defmodule Splode.ErrorClass do @moduledoc "Tools for working with error classes" diff --git a/lib/splode/stacktrace.ex b/lib/splode/stacktrace.ex index 01716cd..4ce96aa 100644 --- a/lib/splode/stacktrace.ex +++ b/lib/splode/stacktrace.ex @@ -1,3 +1,7 @@ +# SPDX-FileCopyrightText: 2020 Zach Daniel +# +# SPDX-License-Identifier: MIT + defmodule Splode.Stacktrace do @moduledoc "A placeholder for a stacktrace so that we can avoid printing it everywhere" defstruct [:stacktrace] diff --git a/lib/splode/unknown.ex b/lib/splode/unknown.ex index 88bf11b..156b475 100644 --- a/lib/splode/unknown.ex +++ b/lib/splode/unknown.ex @@ -1,3 +1,7 @@ +# SPDX-FileCopyrightText: 2020 Zach Daniel +# +# SPDX-License-Identifier: MIT + defmodule Splode.Error.Unknown do @moduledoc "The default top level unknown error container" use Splode.ErrorClass, class: :unknown diff --git a/mix.exs b/mix.exs index 947bc83..b3d225a 100644 --- a/mix.exs +++ b/mix.exs @@ -1,3 +1,7 @@ +# SPDX-FileCopyrightText: 2020 Zach Daniel +# +# SPDX-License-Identifier: MIT + defmodule Splode.MixProject do use Mix.Project @@ -32,15 +36,19 @@ defmodule Splode.MixProject do defp package do [ - name: :splode, + maintainers: [ + "Zach Daniel " + ], licenses: ["MIT"], files: ~w(lib .formatter.exs mix.exs README* LICENSE* CHANGELOG* documentation), links: %{ - GitHub: "https://github.com/ash-project/splode", - Discord: "https://discord.gg/HTHRaaVPUc", - Website: "https://ash-hq.org", - Forum: "https://elixirforum.com/c/elixir-framework-forums/ash-framework-forum" + "GitHub" => "https://github.com/ash-project/splode", + "Changelog" => "https://github.com/ash-project/splode/blob/main/CHANGELOG.md", + "Discord" => "https://discord.gg/HTHRaaVPUc", + "Website" => "https://ash-hq.org", + "Forum" => "https://elixirforum.com/c/elixir-framework-forums/ash-framework-forum", + "REUSE Compliance" => "https://api.reuse.software/info/github.com/ash-project/splode" } ] end diff --git a/mix.lock.license b/mix.lock.license new file mode 100644 index 0000000..815664f --- /dev/null +++ b/mix.lock.license @@ -0,0 +1,3 @@ +SPDX-FileCopyrightText: 2020 Zach Daniel + +SPDX-License-Identifier: MIT diff --git a/test/splode/error_test.exs b/test/splode/error_test.exs index 5d3b7c2..cc0b010 100644 --- a/test/splode/error_test.exs +++ b/test/splode/error_test.exs @@ -1,3 +1,7 @@ +# SPDX-FileCopyrightText: 2020 Zach Daniel +# +# SPDX-License-Identifier: MIT + defmodule Splode.ErrorTest do alias Splode.Stacktrace use ExUnit.Case diff --git a/test/splode_test.exs b/test/splode_test.exs index c0c55a2..84bdcae 100644 --- a/test/splode_test.exs +++ b/test/splode_test.exs @@ -1,3 +1,7 @@ +# SPDX-FileCopyrightText: 2020 Zach Daniel +# +# SPDX-License-Identifier: MIT + defmodule SplodeTest do use ExUnit.Case diff --git a/test/test_helper.exs b/test/test_helper.exs index 869559e..8f8d236 100644 --- a/test/test_helper.exs +++ b/test/test_helper.exs @@ -1 +1,5 @@ +# SPDX-FileCopyrightText: 2020 Zach Daniel +# +# SPDX-License-Identifier: MIT + ExUnit.start()