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
1 change: 1 addition & 0 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -192,6 +192,7 @@ project runs again, so they are never ticked for you.
| Swift Package Manager | `.build` | |
| Xcode (CocoaPods) | | `Pods` |
| .NET | `bin` `obj` | |
| Elixir (Mix) | `_build` | `deps` |
| PHP (Composer) | | `vendor` |

Add your own rules in `~/Library/Application Support/OpenSweep/rules`, or keep a
Expand Down
2 changes: 2 additions & 0 deletions docs/RULE-SCHEMA.md
Original file line number Diff line number Diff line change
Expand Up @@ -106,6 +106,8 @@ rules.
## Contributing a rule

1. Add or edit a file in `engine/rules/`, with match and nomatch fixtures.
A new file also goes in `BUNDLED` in `opensweep-core/src/rules.rs`, which
builds the catalogue into the binary.
2. Run `cargo run -p opensweep-cli -- rules-check rules` and `cargo test`.
3. In the pull request, link the tool's documentation that says the path is
generated. Rule changes need two reviewers.
Expand Down
4 changes: 2 additions & 2 deletions engine/crates/opensweep-cli/tests/snapshots/rules-check.json
Original file line number Diff line number Diff line change
@@ -1,8 +1,8 @@
[
{
"artifacts": 32,
"artifacts": 34,
"command": "rules-check",
"rule_files": 11,
"rule_files": 12,
"schema_version": 1
}
]
1 change: 1 addition & 0 deletions engine/crates/opensweep-core/src/rules.rs
Original file line number Diff line number Diff line change
Expand Up @@ -577,6 +577,7 @@ pub fn load_dir(dir: &Path) -> Result<Vec<RuleFile>, RuleError> {
const BUNDLED: &[(&str, &str)] = &[
("android.toml", include_str!("../../../rules/android.toml")),
("dotnet.toml", include_str!("../../../rules/dotnet.toml")),
("elixir.toml", include_str!("../../../rules/elixir.toml")),
("flutter.toml", include_str!("../../../rules/flutter.toml")),
("go.toml", include_str!("../../../rules/go.toml")),
("java.toml", include_str!("../../../rules/java.toml")),
Expand Down
21 changes: 21 additions & 0 deletions engine/rules/elixir.toml
Original file line number Diff line number Diff line change
@@ -0,0 +1,21 @@
schema = 2
id = "elixir"
name = "Elixir (Mix)"

# Defaults from https://hexdocs.pm/mix/Mix.Project.html: build_path
# "defaults to _build" and deps_path "Defaults to deps". An umbrella's apps
# share the umbrella's folders, so only the top mix.exs has them.
[detect]
any_files = ["mix.exs"]

[[artifact]]
path = "_build"
class = "safe"
reason = "Mix build output. Recreated by the next compile."
restore = "mix compile"

[[artifact]]
path = "deps"
class = "caution"
reason = "Mix dependencies. Fetch them again from mix.lock."
restore = "mix deps.get"
Empty file.
Empty file.
2 changes: 2 additions & 0 deletions engine/rules/fixtures/elixir/match/app/expected.txt
Original file line number Diff line number Diff line change
@@ -0,0 +1,2 @@
_build
deps
Empty file.
Empty file.
Empty file.
Empty file.
Empty file.
Loading