Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

use nixfmt with --format #251

Merged
merged 3 commits into from
Jun 6, 2024
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
2 changes: 1 addition & 1 deletion README.md
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand Down
18 changes: 9 additions & 9 deletions flake.lock

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

4 changes: 2 additions & 2 deletions nix_update/__init__.py
Original file line number Diff line number Diff line change
Expand Up @@ -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"
)
Expand Down Expand Up @@ -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
Expand Down
3 changes: 1 addition & 2 deletions nix_update/version/__init__.py
Original file line number Diff line number Diff line change
Expand Up @@ -27,8 +27,7 @@


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]]] = [
Expand Down