mirror of
https://github.com/nerdypepper/statix.git
synced 2024-09-11 13:45:32 +03:00
update docs; nix-analyzer -> statix
This commit is contained in:
parent
a60429891f
commit
088559eedd
17
flake.lock
17
flake.lock
@ -16,22 +16,6 @@
|
||||
"type": "github"
|
||||
}
|
||||
},
|
||||
"gitignore": {
|
||||
"flake": false,
|
||||
"locked": {
|
||||
"lastModified": 1611672876,
|
||||
"narHash": "sha256-qHu3uZ/o9jBHiA3MEKHJ06k7w4heOhA+4HCSIvflRxo=",
|
||||
"owner": "hercules-ci",
|
||||
"repo": "gitignore",
|
||||
"rev": "211907489e9f198594c0eb0ca9256a1949c9d412",
|
||||
"type": "github"
|
||||
},
|
||||
"original": {
|
||||
"owner": "hercules-ci",
|
||||
"repo": "gitignore",
|
||||
"type": "github"
|
||||
}
|
||||
},
|
||||
"mozillapkgs": {
|
||||
"flake": false,
|
||||
"locked": {
|
||||
@ -97,7 +81,6 @@
|
||||
"root": {
|
||||
"inputs": {
|
||||
"flake-compat": "flake-compat",
|
||||
"gitignore": "gitignore",
|
||||
"mozillapkgs": "mozillapkgs",
|
||||
"naersk": "naersk",
|
||||
"nixpkgs": "nixpkgs_2",
|
||||
|
32
flake.nix
32
flake.nix
@ -6,21 +6,23 @@
|
||||
url = "github:mozilla/nixpkgs-mozilla";
|
||||
flake = false;
|
||||
};
|
||||
gitignore = {
|
||||
url = "github:hercules-ci/gitignore";
|
||||
flake = false;
|
||||
};
|
||||
flake-compat = {
|
||||
url = "github:edolstra/flake-compat";
|
||||
flake = false;
|
||||
};
|
||||
};
|
||||
|
||||
outputs = { self, nixpkgs, utils, naersk, mozillapkgs, gitignore, ... }:
|
||||
outputs =
|
||||
{ self
|
||||
, nixpkgs
|
||||
, utils
|
||||
, naersk
|
||||
, mozillapkgs
|
||||
, ...
|
||||
}:
|
||||
utils.lib.eachDefaultSystem (system:
|
||||
let
|
||||
pkgs = nixpkgs.legacyPackages."${system}";
|
||||
inherit (import gitignore { inherit (pkgs) lib; }) gitignoreSource;
|
||||
|
||||
# Get a specific rust version
|
||||
mozilla = pkgs.callPackage (mozillapkgs + "/package-set.nix") { };
|
||||
@ -43,21 +45,24 @@
|
||||
|
||||
in
|
||||
rec {
|
||||
packages.nix-analyzer = naersk-lib.buildPackage {
|
||||
pname = "nix-analyzer";
|
||||
packages.statix = naersk-lib.buildPackage {
|
||||
pname = "statix";
|
||||
version = "0.1.0";
|
||||
root = gitignoreSource ./.;
|
||||
root = ./.;
|
||||
inherit nativeBuildInputs;
|
||||
};
|
||||
defaultPackage = packages.nix-analyzer;
|
||||
apps.nix-analyzer = utils.lib.mkApp {
|
||||
drv = packages.nix-analyzer;
|
||||
|
||||
defaultPackage = packages.statix;
|
||||
apps.statix = utils.lib.mkApp {
|
||||
drv = packages.statix;
|
||||
};
|
||||
|
||||
apps.check = {
|
||||
type = "app";
|
||||
program = "${pkgs.cargo-watch}/bin/cargo-watch";
|
||||
};
|
||||
defaultApp = apps.nix-analyzer;
|
||||
|
||||
defaultApp = apps.statix;
|
||||
devShell = pkgs.mkShell {
|
||||
nativeBuildInputs = nativeBuildInputs ++ [
|
||||
rust
|
||||
@ -66,7 +71,6 @@
|
||||
pkgs.rustfmt
|
||||
pkgs.cargo
|
||||
pkgs.cargo-watch
|
||||
pkgs.cargo-tarpaulin
|
||||
];
|
||||
RUST_SRC_PATH = "${rust-src}/lib/rustlib/src/rust/library";
|
||||
RUST_LOG = "info";
|
||||
|
12
readme.md
12
readme.md
@ -1,15 +1,15 @@
|
||||
## nix-analyzer
|
||||
## statix
|
||||
|
||||
`nix-analyzer` intends to be a static analysis tool for the
|
||||
`statix` intends to be a static analysis tool for the
|
||||
Nix programming language.
|
||||
|
||||
For the time-being, `nix-analyzer` works only with ASTs
|
||||
For the time-being, `statix` works only with ASTs
|
||||
produced by the `rnix-parser` crate and does not evaluate
|
||||
any nix code.
|
||||
any nix code (imports, attr sets etc.).
|
||||
|
||||
## Architecture
|
||||
|
||||
`nix-analyzer` has the following components:
|
||||
`statix` has the following components:
|
||||
|
||||
- `bin`: the CLI/entrypoint
|
||||
- `lib`: library of lints and utilities to define these
|
||||
@ -18,7 +18,7 @@ any nix code.
|
||||
|
||||
### `bin`
|
||||
|
||||
This is the main point of interaction between `nix-analyzer`
|
||||
This is the main point of interaction between `statix`
|
||||
and the end user. It's output is human-readable and should
|
||||
also support JSON/errorfmt outputs for external tools to
|
||||
use.
|
||||
|
Loading…
Reference in New Issue
Block a user