mirror of
https://github.com/Mic92/nix-update.git
synced 2024-08-14 21:20:29 +03:00
use nixfmt
with --format
This commit is contained in:
parent
e278a56d12
commit
3b1c559db5
@ -140,7 +140,7 @@ tested. Additionally, the `--review` flag can be used to
|
||||
initiate a run of [nixpkgs-review](https://github.com/Mic92/nixpkgs-review), which will ensure all
|
||||
dependent packages can be built. In order to ensure consistent
|
||||
formatting, the `--format` flag will invoke
|
||||
[nixpkgs-fmt](https://github.com/nix-community/nixpkgs-fmt).
|
||||
[nixfmt](https://github.com/NixOS/nixfmt).
|
||||
|
||||
```console
|
||||
# Also runs nix-build
|
||||
|
@ -21,7 +21,7 @@ pkgs.python311.pkgs.buildPythonApplication {
|
||||
makeWrapperArgs = [
|
||||
"--prefix PATH"
|
||||
":"
|
||||
(pkgs.lib.makeBinPath [ pkgs.nixVersions.stable or pkgs.nix_2_4 pkgs.nixpkgs-review pkgs.nix-prefetch-git ])
|
||||
(pkgs.lib.makeBinPath [ pkgs.nixVersions.stable or pkgs.nix_2_4 pkgs.nixpkgs-review pkgs.nix-prefetch-git pkgs.nixfmt-rfc-style ])
|
||||
];
|
||||
shellHook = ''
|
||||
# workaround because `python setup.py develop` breaks for me
|
||||
|
@ -31,7 +31,7 @@ def parse_args(args: list[str]) -> Options:
|
||||
parser.add_argument(
|
||||
"--review", action="store_true", help="Run `nixpkgs-review wip`"
|
||||
)
|
||||
parser.add_argument("--format", action="store_true", help="Run `nixpkgs-fmt`")
|
||||
parser.add_argument("--format", action="store_true", help="Run `nixfmt`")
|
||||
parser.add_argument(
|
||||
"--commit", action="store_true", help="Commit the updated package"
|
||||
)
|
||||
@ -326,7 +326,7 @@ def main(args: list[str] = sys.argv[1:]) -> None:
|
||||
nixpkgs_review()
|
||||
|
||||
if options.format:
|
||||
run(["nixpkgs-fmt", package.filename], stdout=None)
|
||||
run(["nixfmt", package.filename], stdout=None)
|
||||
|
||||
if options.commit:
|
||||
assert git_dir is not None
|
||||
|
@ -27,8 +27,7 @@ from .version import Version, VersionPreference
|
||||
|
||||
|
||||
class SnapshotFetcher(Protocol):
|
||||
def __call__(self, url: ParseResult, branch: str) -> list[Version]:
|
||||
...
|
||||
def __call__(self, url: ParseResult, branch: str) -> list[Version]: ...
|
||||
|
||||
|
||||
fetchers: list[Callable[[ParseResult], list[Version]]] = [
|
||||
|
Loading…
Reference in New Issue
Block a user