mirror of
https://github.com/Mic92/nix-update.git
synced 2024-09-11 02:25:32 +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
|
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
|
dependent packages can be built. In order to ensure consistent
|
||||||
formatting, the `--format` flag will invoke
|
formatting, the `--format` flag will invoke
|
||||||
[nixpkgs-fmt](https://github.com/nix-community/nixpkgs-fmt).
|
[nixfmt](https://github.com/NixOS/nixfmt).
|
||||||
|
|
||||||
```console
|
```console
|
||||||
# Also runs nix-build
|
# Also runs nix-build
|
||||||
|
@ -21,7 +21,7 @@ pkgs.python311.pkgs.buildPythonApplication {
|
|||||||
makeWrapperArgs = [
|
makeWrapperArgs = [
|
||||||
"--prefix PATH"
|
"--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 = ''
|
shellHook = ''
|
||||||
# workaround because `python setup.py develop` breaks for me
|
# workaround because `python setup.py develop` breaks for me
|
||||||
|
@ -31,7 +31,7 @@ def parse_args(args: list[str]) -> Options:
|
|||||||
parser.add_argument(
|
parser.add_argument(
|
||||||
"--review", action="store_true", help="Run `nixpkgs-review wip`"
|
"--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(
|
parser.add_argument(
|
||||||
"--commit", action="store_true", help="Commit the updated package"
|
"--commit", action="store_true", help="Commit the updated package"
|
||||||
)
|
)
|
||||||
@ -326,7 +326,7 @@ def main(args: list[str] = sys.argv[1:]) -> None:
|
|||||||
nixpkgs_review()
|
nixpkgs_review()
|
||||||
|
|
||||||
if options.format:
|
if options.format:
|
||||||
run(["nixpkgs-fmt", package.filename], stdout=None)
|
run(["nixfmt", package.filename], stdout=None)
|
||||||
|
|
||||||
if options.commit:
|
if options.commit:
|
||||||
assert git_dir is not None
|
assert git_dir is not None
|
||||||
|
@ -27,8 +27,7 @@ from .version import Version, VersionPreference
|
|||||||
|
|
||||||
|
|
||||||
class SnapshotFetcher(Protocol):
|
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]]] = [
|
fetchers: list[Callable[[ParseResult], list[Version]]] = [
|
||||||
|
Loading…
Reference in New Issue
Block a user