-
-
Notifications
You must be signed in to change notification settings - Fork 42
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
README: Add installation and integration docs #243
Conversation
0887200
to
44b3e27
Compare
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Some minor improvements, but this is great!
Feel free to merge yourself when addressed :)
README.md
Outdated
### treefmt | ||
|
||
[treefmt](https://github.com/numtide/treefmt) can be used to format repositories consisting of different languages with one command. | ||
A possible configuration for `nixfmt` in `.treefmt.toml` looks like this: |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
A possible configuration for `nixfmt` in `.treefmt.toml` looks like this: | |
A possible configuration for `nixfmt` in `treefmt.toml` looks like this: |
README.md
Outdated
`nixfmt` was used as the basis for the official Nix formatter with a standardized formatting. | ||
The new formatting differs considerably from the original one. | ||
This is why two packages are in nixpkgs: `nixfmt-classic` with the non-standardized formatting and `nixfmt-rfc-style`. |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
`nixfmt` was used as the basis for the official Nix formatter with a standardized formatting. | |
The new formatting differs considerably from the original one. | |
This is why two packages are in nixpkgs: `nixfmt-classic` with the non-standardized formatting and `nixfmt-rfc-style`. | |
A recent nixfmt version is available as `pkgs.nixfmt-rfc-style` in Nixpkgs. The formatting of this version differs considerably from the original nixfmt that was used as the basis for the standardised official formatter, which is also still available as `pkgs.nixfmt-classic` for now, though unmaintained. |
Just a rewording to make the distinction clearer
README.md
Outdated
### From the repository | ||
|
||
It's also possible to install `nixfmt` directly from the repository using `nix-env`. | ||
This allows the newest changes to be used, which may not be equal to the `nixfmt` version used to format nixpkgs, so this should be done with care! |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
This applies to all methods here. I think there should be an additional section referring to how the nix-shell
in Nixpkgs provides the correct version for Nixpkgs. Alternatively, let's just drop this sentence, otherwise it implies the above would be the correct version. As an upstream project we shouldn't really have to document downstream uses.
This allows the newest changes to be used, which may not be equal to the `nixfmt` version used to format nixpkgs, so this should be done with care! |
README.md
Outdated
} | ||
``` | ||
|
||
More information about configuration can be found in [the official README](https://github.com/numtide/treefmt-nix?tab=readme-ov-file#integration-into-nix). |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
More information about configuration can be found in [the official README](https://github.com/numtide/treefmt-nix?tab=readme-ov-file#integration-into-nix). | |
More information about configuration can be found in [the README](https://github.com/numtide/treefmt-nix?tab=readme-ov-file#integration-into-nix). |
Just a minor precaution, we don't want people to think that treefmt is also an official Nix project.
README.md
Outdated
``` | ||
{ | ||
outputs = { nixpkgs, self }: { | ||
formatter.x86_64-linux = nixpkgs.legacyPackages.x86_64-linux.nixfmt-rfc-style; | ||
}; | ||
} | ||
``` |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
``` | |
{ | |
outputs = { nixpkgs, self }: { | |
formatter.x86_64-linux = nixpkgs.legacyPackages.x86_64-linux.nixfmt-rfc-style; | |
}; | |
} | |
``` | |
```nix | |
{ | |
outputs = | |
{ nixpkgs, self }: | |
{ | |
formatter.x86_64-linux = nixpkgs.legacyPackages.x86_64-linux.nixfmt-rfc-style; | |
}; | |
} | |
``` |
We should adhere to our own formatting :P
3c967d0
to
19b8be8
Compare
0f4cbcf
to
e4033f6
Compare
469aa5b
to
3d18524
Compare
Changes: - NixOS/nixfmt#233 and NixOS/nixfmt#257 fix the poor formatting of `mkRenamedOptionModule` code. - NixOS/nixfmt#240 deprecates passing directories as CLI args, instead using [treefmt](https://github.com/numtide/treefmt) is recommended. - NixOS/nixfmt#246 fixes some problems with floats. - NixOS/nixfmt#247 fixes trailing spaces not always being stripped. - NixOS/nixfmt#248 ensures that the ownership of files isn't changed when formatting them. - NixOS/nixfmt#249 fixes some poor formatting of some attribute selections. - NixOS/nixfmt#262 ensures that 64-bit integers don't get trimmed on 32-bit platforms. - NixOS/nixfmt#264 adds a `--filename` flag to allow setting the filename in error messages when formatting standard input. - NixOS/nixfmt#243 added [installation and integration docs](https://github.com/NixOS/nixfmt?tab=readme-ov-file#installation-and-usage-instructions). - NixOS/nixfmt#238 created a [`.pre-commit-hooks.yaml`](https://github.com/NixOS/nixfmt/blob/master/.pre-commit-hooks.yaml) for integration with [pre-commit](https://pre-commit.com/)
Changes: - NixOS/nixfmt#233 and NixOS/nixfmt#257 fix the poor formatting of `mkRenamedOptionModule` code. - NixOS/nixfmt#240 deprecates passing directories as CLI args, instead using [treefmt](https://github.com/numtide/treefmt) is recommended. - NixOS/nixfmt#246 fixes some problems with floats. - NixOS/nixfmt#247 fixes trailing spaces not always being stripped. - NixOS/nixfmt#248 ensures that the ownership of files isn't changed when formatting them. - NixOS/nixfmt#249 fixes some poor formatting of some attribute selections. - NixOS/nixfmt#262 ensures that 64-bit integers don't get trimmed on 32-bit platforms. - NixOS/nixfmt#264 adds a `--filename` flag to allow setting the filename in error messages when formatting standard input. - NixOS/nixfmt#243 added [installation and integration docs](https://github.com/NixOS/nixfmt?tab=readme-ov-file#installation-and-usage-instructions). - NixOS/nixfmt#238 created a [`.pre-commit-hooks.yaml`](https://github.com/NixOS/nixfmt/blob/master/.pre-commit-hooks.yaml) for integration with [pre-commit](https://pre-commit.com/)
Changes: - NixOS/nixfmt#233 and NixOS/nixfmt#257 fix the poor formatting of `mkRenamedOptionModule` code. - NixOS/nixfmt#240 deprecates passing directories as CLI args, instead using [treefmt](https://github.com/numtide/treefmt) is recommended. - NixOS/nixfmt#246 fixes some problems with floats. - NixOS/nixfmt#247 fixes trailing spaces not always being stripped. - NixOS/nixfmt#248 ensures that the ownership of files isn't changed when formatting them. - NixOS/nixfmt#249 fixes some poor formatting of some attribute selections. - NixOS/nixfmt#262 ensures that 64-bit integers don't get trimmed on 32-bit platforms. - NixOS/nixfmt#264 adds a `--filename` flag to allow setting the filename in error messages when formatting standard input. - NixOS/nixfmt#243 added [installation and integration docs](https://github.com/NixOS/nixfmt?tab=readme-ov-file#installation-and-usage-instructions). - NixOS/nixfmt#238 created a [`.pre-commit-hooks.yaml`](https://github.com/NixOS/nixfmt/blob/master/.pre-commit-hooks.yaml) for integration with [pre-commit](https://pre-commit.com/) (cherry picked from commit edd47f7)
Changes: - NixOS/nixfmt#233 and NixOS/nixfmt#257 fix the poor formatting of `mkRenamedOptionModule` code. - NixOS/nixfmt#240 deprecates passing directories as CLI args, instead using [treefmt](https://github.com/numtide/treefmt) is recommended. - NixOS/nixfmt#246 fixes some problems with floats. - NixOS/nixfmt#247 fixes trailing spaces not always being stripped. - NixOS/nixfmt#248 ensures that the ownership of files isn't changed when formatting them. - NixOS/nixfmt#249 fixes some poor formatting of some attribute selections. - NixOS/nixfmt#262 ensures that 64-bit integers don't get trimmed on 32-bit platforms. - NixOS/nixfmt#264 adds a `--filename` flag to allow setting the filename in error messages when formatting standard input. - NixOS/nixfmt#243 added [installation and integration docs](https://github.com/NixOS/nixfmt?tab=readme-ov-file#installation-and-usage-instructions). - NixOS/nixfmt#238 created a [`.pre-commit-hooks.yaml`](https://github.com/NixOS/nixfmt/blob/master/.pre-commit-hooks.yaml) for integration with [pre-commit](https://pre-commit.com/)
Changes: - NixOS/nixfmt#233 and NixOS/nixfmt#257 fix the poor formatting of `mkRenamedOptionModule` code. - NixOS/nixfmt#240 deprecates passing directories as CLI args, instead using [treefmt](https://github.com/numtide/treefmt) is recommended. - NixOS/nixfmt#246 fixes some problems with floats. - NixOS/nixfmt#247 fixes trailing spaces not always being stripped. - NixOS/nixfmt#248 ensures that the ownership of files isn't changed when formatting them. - NixOS/nixfmt#249 fixes some poor formatting of some attribute selections. - NixOS/nixfmt#262 ensures that 64-bit integers don't get trimmed on 32-bit platforms. - NixOS/nixfmt#264 adds a `--filename` flag to allow setting the filename in error messages when formatting standard input. - NixOS/nixfmt#243 added [installation and integration docs](https://github.com/NixOS/nixfmt?tab=readme-ov-file#installation-and-usage-instructions). - NixOS/nixfmt#238 created a [`.pre-commit-hooks.yaml`](https://github.com/NixOS/nixfmt/blob/master/.pre-commit-hooks.yaml) for integration with [pre-commit](https://pre-commit.com/)
Changes: - NixOS/nixfmt#233 and NixOS/nixfmt#257 fix the poor formatting of `mkRenamedOptionModule` code. - NixOS/nixfmt#240 deprecates passing directories as CLI args, instead using [treefmt](https://github.com/numtide/treefmt) is recommended. - NixOS/nixfmt#246 fixes some problems with floats. - NixOS/nixfmt#247 fixes trailing spaces not always being stripped. - NixOS/nixfmt#248 ensures that the ownership of files isn't changed when formatting them. - NixOS/nixfmt#249 fixes some poor formatting of some attribute selections. - NixOS/nixfmt#262 ensures that 64-bit integers don't get trimmed on 32-bit platforms. - NixOS/nixfmt#264 adds a `--filename` flag to allow setting the filename in error messages when formatting standard input. - NixOS/nixfmt#243 added [installation and integration docs](https://github.com/NixOS/nixfmt?tab=readme-ov-file#installation-and-usage-instructions). - NixOS/nixfmt#238 created a [`.pre-commit-hooks.yaml`](https://github.com/NixOS/nixfmt/blob/master/.pre-commit-hooks.yaml) for integration with [pre-commit](https://pre-commit.com/)
No description provided.