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
7 changes: 6 additions & 1 deletion .check.exs
Original file line number Diff line number Diff line change
@@ -1,10 +1,15 @@
# SPDX-FileCopyrightText: 2025 Zach Daniel
#
# SPDX-License-Identifier: MIT

[
## all available options with default values (see `mix check` docs for description)
# parallel: true,
# skipped: true,

## list of tools (see `mix check` docs for defaults)
tools: [
{: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: 2025 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 .formatter.exs
Original file line number Diff line number Diff line change
@@ -1,3 +1,7 @@
# SPDX-FileCopyrightText: 2025 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: 2025 Zach Daniel
#
# SPDX-License-Identifier: MIT

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

name: CI
on:
push:
Expand All @@ -15,3 +19,4 @@ jobs:
with:
spark-formatter: false
spark-cheat-sheets: false
reuse: true
4 changes: 4 additions & 0 deletions .gitignore
Original file line number Diff line number Diff line change
@@ -1,3 +1,7 @@
# SPDX-FileCopyrightText: 2025 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 27.0.1
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: 2025 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: 2025 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.
11 changes: 11 additions & 0 deletions README.md
Original file line number Diff line number Diff line change
@@ -1,3 +1,14 @@
<!--
SPDX-FileCopyrightText: 2025 Zach Daniel

SPDX-License-Identifier: MIT
-->
[![CI](https://github.com/ash-project/usage_rules/actions/workflows/elixir.yml/badge.svg)](https://github.com/ash-project/usage_rules/actions/workflows/elixir.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/usage_rules.svg)](https://hex.pm/packages/usage_rules)
[![Hexdocs badge](https://img.shields.io/badge/docs-hexdocs-purple)](https://hexdocs.pm/usage_rules)
[![REUSE status](https://api.reuse.software/badge/github.com/ash-project/usage_rules)](https://api.reuse.software/info/github.com/ash-project/usage_rules)

# UsageRules

**UsageRules** is a development tool for Elixir projects that:
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: 2025 Zach Daniel
#
# SPDX-License-Identifier: MIT

import Config

if Mix.env() == :dev do
Expand Down
4 changes: 4 additions & 0 deletions lib/mix/tasks/usage_rules.docs.ex
Original file line number Diff line number Diff line change
@@ -1,3 +1,7 @@
# SPDX-FileCopyrightText: 2025 Zach Daniel
#
# SPDX-License-Identifier: MIT

defmodule Mix.Tasks.UsageRules.Docs do
use Mix.Task

Expand Down
4 changes: 4 additions & 0 deletions lib/mix/tasks/usage_rules.install.ex
Original file line number Diff line number Diff line change
@@ -1,3 +1,7 @@
# SPDX-FileCopyrightText: 2025 Zach Daniel
#
# SPDX-License-Identifier: MIT

defmodule Mix.Tasks.UsageRules.Install.Docs do
@moduledoc false

Expand Down
4 changes: 4 additions & 0 deletions lib/mix/tasks/usage_rules.search_docs.ex
Original file line number Diff line number Diff line change
@@ -1,3 +1,7 @@
# SPDX-FileCopyrightText: 2025 Zach Daniel
#
# SPDX-License-Identifier: MIT

defmodule Mix.Tasks.UsageRules.SearchDocs do
use Mix.Task
# This will eventually be replaced with something like `mix hex.docs.search` ideally
Expand Down
10 changes: 7 additions & 3 deletions lib/mix/tasks/usage_rules.sync.ex
Original file line number Diff line number Diff line change
@@ -1,3 +1,7 @@
# SPDX-FileCopyrightText: 2025 Zach Daniel
#
# SPDX-License-Identifier: MIT

defmodule Mix.Tasks.UsageRules.Sync.Docs do
@moduledoc false

Expand Down Expand Up @@ -304,7 +308,8 @@ if Code.ensure_loaded?(Igniter) do
link_to_folder && is_nil(igniter.args.positional[:file]) ->
Igniter.add_issue(igniter, "--link-to-folder option requires a file to write to")

# If no packages are given and neither --list nor --all nor --remove nor --remove-missing nor --folder-only is set, add error
# If no packages are given and neither --list nor --all nor --remove nor --remove-missing nor --folder-only is
# set, add error
Enum.empty?(provided_packages) && !all_option && !list_option && !remove_option &&
!remove_missing_option && !folder_only ->
add_usage_error(igniter)
Expand Down Expand Up @@ -846,13 +851,12 @@ if Code.ensure_loaded?(Igniter) do

section_names =
rules
|> Enum.map(fn {_name, _path, sub_rule} ->
|> Enum.map_join(", ", fn {_name, _path, sub_rule} ->
case sub_rule do
nil -> to_string(package_name)
sub_rule_name -> "#{package_name}:#{sub_rule_name}"
end
end)
|> Enum.join(", ")

acc
|> Igniter.add_notice(
Expand Down
4 changes: 4 additions & 0 deletions lib/usage_rules.ex
Original file line number Diff line number Diff line change
@@ -1,3 +1,7 @@
# SPDX-FileCopyrightText: 2025 Zach Daniel
#
# SPDX-License-Identifier: MIT

defmodule UsageRules do
@moduledoc """
Tools for gathering usage rules from dependencies for projects.
Expand Down
15 changes: 11 additions & 4 deletions mix.exs
Original file line number Diff line number Diff line change
@@ -1,3 +1,7 @@
# SPDX-FileCopyrightText: 2025 Zach Daniel
#
# SPDX-License-Identifier: MIT

defmodule UsageRules.MixProject do
use Mix.Project

Expand Down Expand Up @@ -28,17 +32,20 @@ defmodule UsageRules.MixProject do

defp package do
[
name: :usage_rules,
maintainers: [
"Zach Daniel <zach@zachdaniel.dev>"
],
licenses: ["MIT"],
maintainers: "Zach Daniel",
files:
~w(lib .formatter.exs mix.exs README* LICENSE* CHANGELOG* usage-rules usage-rules.md),
links: %{
"GitHub" => @source_url,
"GitHub" => "https://github.com/ash-project/usage_rules",
"Changelog" => "https://github.com/ash-project/usage_rules/blob/main/CHANGELOG.md",
"Discord" => "https://discord.gg/HTHRaaVPUc",
"Website" => "https://ash-hq.org",
"Forum" => "https://elixirforum.com/c/ash-framework-forum/",
"Changelog" => "#{@source_url}/blob/main/CHANGELOG.md"
"Forum" => "https://elixirforum.com/c/elixir-framework-forums/ash-framework-forum",
"REUSE Compliance" => "https://api.reuse.software/info/github.com/ash-project/usage_rules"
}
]
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: 2025 Zach Daniel

SPDX-License-Identifier: MIT
Loading