about summary refs log tree commit diff
path: root/pkgs/aszlig/rustfmt/config.patch
Commit message (Collapse)AuthorAgeFilesLines
* vim: Don't rustfmt without an explicit configaszlig2024-03-251-13/+0
| | | | | | | | | | | This is getting annoying when contributing to external projects that don't have a rustfmt.toml, because I constantly forget to disable it for a buffer and then get a massive diff that I need to revert. My own projects all have a rustfmt.toml anyway, so there really is no reason to do it by default nor have a custom rustfmt config in Vuizvui. Signed-off-by: aszlig <aszlig@nix.build>
* pkgs/rustfmt: Fix patching in default configaszlig2022-04-131-3/+3
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | The patch file was relative to the rustfmt crate within the rustc source tree, so I added "-d src/tools/rustfmt" as patchFlags to apply the patch against that subdirectory. Unfortunately, patchFlags also applies to other patches as well and I didn't account for that. With current rustfmt from rustc 1.59.0 we have a patch in nixpkgs, which now fails to apply because of this: applying patch /nix/store/...-rustfmt-fix-self-tests.patch can't find file to patch at input line 3 Perhaps you used the wrong -p or --strip option? The text leading up to this was: -------------------------- |--- a/src/tools/rustfmt/src/ignore_path.rs |+++ b/src/tools/rustfmt/src/ignore_path.rs -------------------------- File to patch: Skip this patch? [y] Skipping patch. 1 out of 1 hunk ignored To fix this, I changed the paths in config.patch to be relative to the rustc tree rather than just the rustfmt crate, so the patch should now apply regardless of whether there are other patches. Signed-off-by: aszlig <aszlig@nix.build>
* pkgs/vim: Add rustfmt with custom default configaszlig2022-02-091-0/+13
Since I do have a lot of projects where I use rustfmt, it gets pretty tedious to manually run "cargo fmt". Using g:rustfmt_autosave should make this less tedious but it might annoy me in the future, let's see. In addition to setting rustfmt I also added a default path for rustc, which is used whenever there is no rustc in path. This is because I usually switch between several projects which use different Rust versions and this way it will use the rustc version that is in PATH during "nix develop". For the rustfmt part I also added a small default configuration which represents my opinion on how I think Rust code should be formatted. The file is used whenever a project doesn't have a "rustfmt.toml" or ".rustfmt.toml". Unfortunately, RustFmt is broken in Vim right now[1], so I'm using the upstream project until the issue has been resolved. [1]: https://github.com/rust-lang/rust.vim/issues/446 Signed-off-by: aszlig <aszlig@nix.build>