aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
-rw-r--r--Cargo.lock104
-rw-r--r--Cargo.toml14
-rw-r--r--bin/Cargo.toml8
-rw-r--r--bin/src/main.rs (renamed from src/main.rs)0
-rw-r--r--lib/Cargo.toml8
-rw-r--r--lib/src/lib.rs7
-rw-r--r--macros/Cargo.toml8
-rw-r--r--macros/src/lib.rs7
-rw-r--r--readme.md35
9 files changed, 79 insertions, 112 deletions
diff --git a/Cargo.lock b/Cargo.lock
deleted file mode 100644
index f09d0c9..0000000
--- a/Cargo.lock
+++ /dev/null
@@ -1,104 +0,0 @@
1# This file is automatically @generated by Cargo.
2# It is not intended for manual editing.
3version = 3
4
5[[package]]
6name = "anyhow"
7version = "1.0.43"
8source = "registry+https://github.com/rust-lang/crates.io-index"
9checksum = "28ae2b3dec75a406790005a200b1bd89785afc02517a00ca99ecfe093ee9e6cf"
10
11[[package]]
12name = "autocfg"
13version = "1.0.1"
14source = "registry+https://github.com/rust-lang/crates.io-index"
15checksum = "cdb031dd78e28731d87d56cc8ffef4a8f36ca26c38fe2de700543e627f8a464a"
16
17[[package]]
18name = "cbitset"
19version = "0.2.0"
20source = "registry+https://github.com/rust-lang/crates.io-index"
21checksum = "29b6ad25ae296159fb0da12b970b2fe179b234584d7cd294c891e2bbb284466b"
22dependencies = [
23 "num-traits",
24]
25
26[[package]]
27name = "countme"
28version = "2.0.4"
29source = "registry+https://github.com/rust-lang/crates.io-index"
30checksum = "328b822bdcba4d4e402be8d9adb6eebf269f969f8eadef977a553ff3c4fbcb58"
31
32[[package]]
33name = "hashbrown"
34version = "0.9.1"
35source = "registry+https://github.com/rust-lang/crates.io-index"
36checksum = "d7afe4a420e3fe79967a00898cc1f4db7c8a49a9333a29f8a4bd76a253d5cd04"
37
38[[package]]
39name = "memoffset"
40version = "0.6.4"
41source = "registry+https://github.com/rust-lang/crates.io-index"
42checksum = "59accc507f1338036a0477ef61afdae33cde60840f4dfe481319ce3ad116ddf9"
43dependencies = [
44 "autocfg",
45]
46
47[[package]]
48name = "nix-analyzer"
49version = "0.1.0"
50dependencies = [
51 "anyhow",
52 "rnix",
53]
54
55[[package]]
56name = "num-traits"
57version = "0.2.14"
58source = "registry+https://github.com/rust-lang/crates.io-index"
59checksum = "9a64b1ec5cda2586e284722486d802acf1f7dbdc623e2bfc57e65ca1cd099290"
60dependencies = [
61 "autocfg",
62]
63
64[[package]]
65name = "rnix"
66version = "0.9.0"
67source = "registry+https://github.com/rust-lang/crates.io-index"
68checksum = "1b37f8af07a0354606141df076458660af7e22238e4117a041c21c548080addd"
69dependencies = [
70 "cbitset",
71 "rowan",
72 "smol_str",
73]
74
75[[package]]
76name = "rowan"
77version = "0.12.6"
78source = "registry+https://github.com/rust-lang/crates.io-index"
79checksum = "a1b36e449f3702f3b0c821411db1cbdf30fb451726a9456dce5dabcd44420043"
80dependencies = [
81 "countme",
82 "hashbrown",
83 "memoffset",
84 "rustc-hash",
85 "text-size",
86]
87
88[[package]]
89name = "rustc-hash"
90version = "1.1.0"
91source = "registry+https://github.com/rust-lang/crates.io-index"
92checksum = "08d43f7aa6b08d49f382cde6a7982047c3426db949b1424bc4b7ec9ae12c6ce2"
93
94[[package]]
95name = "smol_str"
96version = "0.1.18"
97source = "registry+https://github.com/rust-lang/crates.io-index"
98checksum = "b203e79e90905594272c1c97c7af701533d42adaab0beb3859018e477d54a3b0"
99
100[[package]]
101name = "text-size"
102version = "1.1.0"
103source = "registry+https://github.com/rust-lang/crates.io-index"
104checksum = "288cb548dbe72b652243ea797201f3d481a0609a967980fcc5b2315ea811560a"
diff --git a/Cargo.toml b/Cargo.toml
index d7f3afa..adfe5d6 100644
--- a/Cargo.toml
+++ b/Cargo.toml
@@ -1,10 +1,8 @@
1[package] 1[workspace]
2name = "nix-analyzer"
3version = "0.1.0"
4edition = "2018"
5 2
6# See more keys and their definitions at https://doc.rust-lang.org/cargo/reference/manifest.html 3members = [
4 "bin",
5 "lib",
6 "macros"
7]
7 8
8[dependencies]
9anyhow = "1.0"
10rnix = "0.9.0"
diff --git a/bin/Cargo.toml b/bin/Cargo.toml
new file mode 100644
index 0000000..57cff11
--- /dev/null
+++ b/bin/Cargo.toml
@@ -0,0 +1,8 @@
1[package]
2name = "bin"
3version = "0.1.0"
4edition = "2018"
5
6# See more keys and their definitions at https://doc.rust-lang.org/cargo/reference/manifest.html
7
8[dependencies]
diff --git a/src/main.rs b/bin/src/main.rs
index e7a11a9..e7a11a9 100644
--- a/src/main.rs
+++ b/bin/src/main.rs
diff --git a/lib/Cargo.toml b/lib/Cargo.toml
new file mode 100644
index 0000000..49e2e49
--- /dev/null
+++ b/lib/Cargo.toml
@@ -0,0 +1,8 @@
1[package]
2name = "lib"
3version = "0.1.0"
4edition = "2018"
5
6# See more keys and their definitions at https://doc.rust-lang.org/cargo/reference/manifest.html
7
8[dependencies]
diff --git a/lib/src/lib.rs b/lib/src/lib.rs
new file mode 100644
index 0000000..31e1bb2
--- /dev/null
+++ b/lib/src/lib.rs
@@ -0,0 +1,7 @@
1#[cfg(test)]
2mod tests {
3 #[test]
4 fn it_works() {
5 assert_eq!(2 + 2, 4);
6 }
7}
diff --git a/macros/Cargo.toml b/macros/Cargo.toml
new file mode 100644
index 0000000..6a47e03
--- /dev/null
+++ b/macros/Cargo.toml
@@ -0,0 +1,8 @@
1[package]
2name = "macros"
3version = "0.1.0"
4edition = "2018"
5
6# See more keys and their definitions at https://doc.rust-lang.org/cargo/reference/manifest.html
7
8[dependencies]
diff --git a/macros/src/lib.rs b/macros/src/lib.rs
new file mode 100644
index 0000000..31e1bb2
--- /dev/null
+++ b/macros/src/lib.rs
@@ -0,0 +1,7 @@
1#[cfg(test)]
2mod tests {
3 #[test]
4 fn it_works() {
5 assert_eq!(2 + 2, 4);
6 }
7}
diff --git a/readme.md b/readme.md
new file mode 100644
index 0000000..9a9e0ca
--- /dev/null
+++ b/readme.md
@@ -0,0 +1,35 @@
1## nix-analyzer
2
3`nix-analyzer` intends to be a static analysis tool for the
4Nix programming language.
5
6For the time-being, `nix-analyzer` works only with ASTs
7produced by the `rnix-parser` crate and does not evaluate
8any nix code.
9
10## Architecture
11
12`nix-analyzer` has the following components:
13
14- `bin`: the CLI/entrypoint
15- `lib`: library of lints and utilities to define these
16 lints
17- `macros`: procedural macros to help define a lint
18
19### `bin`
20
21This is the main point of interaction between `nix-analyzer`
22and the end user. It's output is human-readable and should
23also support JSON/errorfmt outputs for external tools to
24use.
25
26### `lib`
27
28A library of AST-based lints and utilities to help write
29those lints. It should be easy for newcomers to write lints
30without being familiar with the rest of the codebase.
31
32### `macros`
33
34This crate intends to be a helper layer to declare lints and
35their metadata.