Skip to content
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
17 changes: 6 additions & 11 deletions .check.exs
Original file line number Diff line number Diff line change
@@ -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"]}
]
]
4 changes: 4 additions & 0 deletions .credo.exs
Original file line number Diff line number Diff line change
@@ -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`.
#
Expand Down
4 changes: 4 additions & 0 deletions .doctor.exs
Original file line number Diff line number Diff line change
@@ -1,3 +1,7 @@
# SPDX-FileCopyrightText: 2020 Zach Daniel
#
# SPDX-License-Identifier: MIT

%Doctor.Config{
ignore_modules: [ ],
ignore_paths: [],
Expand Down
4 changes: 4 additions & 0 deletions .formatter.exs
Original file line number Diff line number Diff line change
@@ -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}"]
Expand Down
4 changes: 4 additions & 0 deletions .github/dependabot.yml
Original file line number Diff line number Diff line change
@@ -1,3 +1,7 @@
# SPDX-FileCopyrightText: 2020 Zach Daniel
#
# SPDX-License-Identifier: MIT

---
updates:
- directory: /
Expand Down
5 changes: 5 additions & 0 deletions .github/workflows/ci.yml
Original file line number Diff line number Diff line change
@@ -1,3 +1,7 @@
# SPDX-FileCopyrightText: 2020 Zach Daniel
#
# SPDX-License-Identifier: MIT

name: Ash CI
on:
push:
Expand All @@ -12,5 +16,6 @@ jobs:
with:
spark-formatter: false
spark-cheat-sheets: false
reuse: true
secrets:
HEX_API_KEY: ${{ secrets.HEX_API_KEY }}
4 changes: 4 additions & 0 deletions .gitignore
Original file line number Diff line number Diff line change
@@ -1,3 +1,7 @@
# SPDX-FileCopyrightText: 2020 Zach Daniel
#
# SPDX-License-Identifier: MIT

# The directory Mix will write compiled artifacts to.
/_build/

Expand Down
1 change: 1 addition & 0 deletions .tool-versions
Original file line number Diff line number Diff line change
@@ -1,2 +1,3 @@
erlang 26.0.2
elixir 1.18.4
pipx 1.8.0
3 changes: 3 additions & 0 deletions .tool-versions.license
Original file line number Diff line number Diff line change
@@ -0,0 +1,3 @@
SPDX-FileCopyrightText: 2020 Zach Daniel

SPDX-License-Identifier: MIT
6 changes: 6 additions & 0 deletions CHANGELOG.md
Original file line number Diff line number Diff line change
@@ -1,3 +1,9 @@
<!--
SPDX-FileCopyrightText: 2020 Zach Daniel

SPDX-License-Identifier: MIT
-->

# Change Log

All notable changes to this project will be documented in this file.
Expand Down
21 changes: 0 additions & 21 deletions LICENSE

This file was deleted.

18 changes: 18 additions & 0 deletions LICENSES/MIT.txt
Original file line number Diff line number Diff line change
@@ -0,0 +1,18 @@
MIT License

Copyright (c) <year> <copyright holders>

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.
10 changes: 10 additions & 0 deletions README.md
Original file line number Diff line number Diff line change
@@ -1,3 +1,13 @@
<!--
SPDX-FileCopyrightText: 2020 Zach Daniel

SPDX-License-Identifier: MIT
-->
[![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.
Expand Down
4 changes: 4 additions & 0 deletions config/config.exs
Original file line number Diff line number Diff line change
@@ -1,3 +1,7 @@
# SPDX-FileCopyrightText: 2020 Zach Daniel
#
# SPDX-License-Identifier: MIT

import Config

if Mix.env() == :dev do
Expand Down
6 changes: 6 additions & 0 deletions documentation/tutorials/get-started-with-splode.md
Original file line number Diff line number Diff line change
@@ -1,3 +1,9 @@
<!--
SPDX-FileCopyrightText: 2020 Zach Daniel

SPDX-License-Identifier: MIT
-->

# 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.
Expand Down
4 changes: 4 additions & 0 deletions lib/splode.ex
Original file line number Diff line number Diff line change
@@ -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.
Expand Down
4 changes: 4 additions & 0 deletions lib/splode/error.ex
Original file line number Diff line number Diff line change
@@ -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.
Expand Down
4 changes: 4 additions & 0 deletions lib/splode/error_class.ex
Original file line number Diff line number Diff line change
@@ -1,3 +1,7 @@
# SPDX-FileCopyrightText: 2020 Zach Daniel
#
# SPDX-License-Identifier: MIT

defmodule Splode.ErrorClass do
@moduledoc "Tools for working with error classes"

Expand Down
4 changes: 4 additions & 0 deletions lib/splode/stacktrace.ex
Original file line number Diff line number Diff line change
@@ -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]
Expand Down
4 changes: 4 additions & 0 deletions lib/splode/unknown.ex
Original file line number Diff line number Diff line change
@@ -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
Expand Down
18 changes: 13 additions & 5 deletions mix.exs
Original file line number Diff line number Diff line change
@@ -1,3 +1,7 @@
# SPDX-FileCopyrightText: 2020 Zach Daniel
#
# SPDX-License-Identifier: MIT

defmodule Splode.MixProject do
use Mix.Project

Expand Down Expand Up @@ -32,15 +36,19 @@ defmodule Splode.MixProject do

defp package do
[
name: :splode,
maintainers: [
"Zach Daniel <zach@zachdaniel.dev>"
],
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
Expand Down
3 changes: 3 additions & 0 deletions mix.lock.license
Original file line number Diff line number Diff line change
@@ -0,0 +1,3 @@
SPDX-FileCopyrightText: 2020 Zach Daniel

SPDX-License-Identifier: MIT
4 changes: 4 additions & 0 deletions test/splode/error_test.exs
Original file line number Diff line number Diff line change
@@ -1,3 +1,7 @@
# SPDX-FileCopyrightText: 2020 Zach Daniel
#
# SPDX-License-Identifier: MIT

defmodule Splode.ErrorTest do
alias Splode.Stacktrace
use ExUnit.Case
Expand Down
4 changes: 4 additions & 0 deletions test/splode_test.exs
Original file line number Diff line number Diff line change
@@ -1,3 +1,7 @@
# SPDX-FileCopyrightText: 2020 Zach Daniel
#
# SPDX-License-Identifier: MIT

defmodule SplodeTest do
use ExUnit.Case

Expand Down
4 changes: 4 additions & 0 deletions test/test_helper.exs
Original file line number Diff line number Diff line change
@@ -1 +1,5 @@
# SPDX-FileCopyrightText: 2020 Zach Daniel
#
# SPDX-License-Identifier: MIT

ExUnit.start()