Commit graph

135 commits

Author SHA1 Message Date
8d236a2e4a update flake 2025-04-20 15:56:37 +02:00
moxian
2efee491b5 Allow specifying NOT-passes on the command line 2025-04-20 15:54:50 +02:00
moxian
d023307d8d Actually, let's not bisect imports by default
I thought it was a good idea, but now that reaper is
not completely busted, i see that this is taking a bit
longer than i'd like.. It's easier to just run reaper again
2025-04-20 15:54:50 +02:00
moxian
ecf52e2d3b Properly handle imports ending in ::self 2025-04-20 15:54:50 +02:00
moxian
a87558adf7 Teach item-deleter to delete imports.
Because reaper is finnicky and does not always
work for whatever reason.

The new test from a couple commits ago now passes.
2025-04-20 15:54:50 +02:00
moxian
3de6992d63 Add a split-use pass.
It transforms "use std::io::{Read, Write}" into
"use std::io::Read; use std::io::Write"

Which later allows to remove just precisely the statements
we do not need, and leave rest be.

The test from the last commit does not pass, but that
is seemingly to do with the test harness setup, since it
works fine locally.
2025-04-20 15:54:50 +02:00
moxian
21a5f1733c Add a test for grouped reexports (failing) 2025-04-20 15:54:50 +02:00
moxian
46c26f7af9 Minor optimization for now-overlapping paths
Naively, if we have items (1) foo, (2) foo::bar, (3) foo::baz,
we would try to first try to remove all three of them,
and then if that fails, try to remove just (1) and (2)

..except we should already know that that would fail since it still
includes (1) which covers all three items anyway.

So, try to be smarter about this and not do that.

This is achieved by avoiding ever putting both foo and foo::whatever
in the same try-set, as that gives no information on foo::whatever
regardless of if the check passes or fails
2025-04-20 15:54:50 +02:00
moxian
2f9a0d45a1 Touch up controller logic to handle nested items well.
The test in the previous commit now passes
2025-04-20 15:54:50 +02:00
moxian
5ebb428295 Add a test for nested items removal (currently failing) 2025-04-20 15:54:50 +02:00
moxian
6d4331b16b Allow bisecting privatizer use changes
Currently all the use items have the same AstPath,
which means that privatizer tries to change all of them at once.
Which means that if *any* of them can't get privated, then
*all* of them stay unprivated, with all the consequences..
2025-04-20 15:54:50 +02:00
moxian
0b7e1c2a82 Minor reaper opti: don't do rustfix with no suggestions 2025-04-20 15:54:50 +02:00
moxian
2f885257e6 Fix delete-unused-functions panics
The pass used to (?) track invalidated files itself,
but now that functionality has been moved up one level,
but also kinda not really.

So here we clarify this by:
- making reaper not care about tracking invalidated files anymore
- making processor yes care about tracking invalidated files, and
    ensuring that it does not call process_file again after gettin
    ProcessState::FileInvalidated, as it advertizes to do.
2025-04-20 15:54:50 +02:00
moxian
b44cd4e6eb Better error message on failing to parse --verify-fn
clap formats the FromStr::Err's arising from parsing the flags
with the Display formatter. This is a very reasonable default
but it also means it loses all the context, since anyhow::Error
only prints the outermost error in Display.
So any failure parsing/creating/loading the function is displayed
to the user as simple "compiling and loading rust function", which
is impossible to debug.

Using the Debug formatting in impl FromStr for RustFunction helps
work around this.
2025-04-20 15:54:50 +02:00
moxian
92aec21748 Pin markdown version to fix build error
markdown made a breaking change between 1.0.0-alpha.20 and 1.0.0-alpha.21
which made genemichaels stop building.

genemichaels never updated (as a library) to fix that,
so if we want to continue using it we have to ping markdown.

The error:

error[E0599]: no variant or associated item named `BlockQuote` found for enum `Node` in the current scope
   --> [path-to]\genemichaels-0.1.21\src\comments.rs:633:15
    |
633 |         Node::BlockQuote(x) => {
    |               ^^^^^^^^^^ variant or associated item not found in `Node`
    |
help: there is a variant with a similar name
    |
633 |         Node::Blockquote(x) => {
    |               ~~~~~~~~~~
2025-04-20 15:54:50 +02:00
moxian
fc25fcbfb5 Update install instructions 2025-04-20 15:54:50 +02:00
cf39338b30 add in memory AST 2023-12-31 17:01:16 +01:00
307cd52178 opt-level=1 in dev
This speeds up the testsuite from 1.6s->1.2s
2023-09-23 16:06:52 +02:00
50dc094ddd speed up tests by doing rustup which
`cargo test` goes from 2.4s to 1.6s
2023-09-23 16:04:17 +02:00
ea5fb6e4ba Use native library name 2023-09-23 15:26:22 +02:00
cf6706ebd6 Make dylib_flag cross-platform 2023-09-23 15:26:22 +02:00
8c8172c55d remove .gitattributes 2023-09-23 15:23:35 +02:00
699a3e1f3d update 2023-09-23 13:29:52 +02:00
42c95c9606
Merge pull request #28 from fee1-dead-contrib/fmt
use `genemichaels` for formatting
2023-05-26 14:30:13 +02:00
Deadbeef
9467c55770 use genemichaels for formatting 2023-05-26 20:00:28 +08:00
Deadbeef
4d234fc6a0 add direnv and flake.nix 2023-05-26 19:50:54 +08:00
a7881a426b require cargo check pass in testsuite 2023-04-18 08:13:52 +02:00
0ccd55fa0f remove print 2023-04-17 19:36:16 +02:00
624dfb4123
Create LICENSE-APACHE 2023-04-11 12:51:27 +02:00
8d06708e6c license 2023-04-11 12:32:44 +02:00
e5c5f6082e config 2023-04-11 12:30:48 +02:00
66ccbe115b contribute 2023-04-11 12:28:11 +02:00
5b9441d3b4
Merge pull request #23 from Nilstrieb/cross-platform-non-cursed-tests
Cross platform non cursed tests
2023-04-11 12:36:50 +02:00
b3f08e6760 remove windows cfgs 2023-04-11 12:12:38 +02:00
0ed3e5188f Also build cargo-minimize 2023-04-11 12:12:38 +02:00
250f0cd557 Dont use script 2023-04-11 12:12:38 +02:00
6eaf188597 exe 2023-04-11 12:10:24 +02:00
d97dbd6a94 clippy 2023-04-11 11:11:54 +02:00
d5f4d6e8ce build regression checker as well 2023-04-11 10:55:25 +02:00
017e78261b remove debug prints 2023-04-11 10:40:19 +02:00
6b24aa05ec move to separate crate 2023-04-11 10:39:54 +02:00
c9bdac41d8 try 2 2023-04-09 20:14:17 +02:00
8143bbf87e Fix build on windows 2023-04-09 20:08:57 +02:00
f28fdd46a8 use grep instead of ripgrep 2023-04-04 15:27:59 +02:00
40d16d8399 delete more tests :) 2023-04-04 15:20:58 +02:00
1825626f85 Delete test cases 2023-04-04 15:19:44 +02:00
17c4323264 allow non-parallel 2023-04-04 15:17:19 +02:00
2b6a1b30e0 parallel testing 2023-04-04 15:14:29 +02:00
cc526f10c7 duplicate self ty test 2023-04-04 15:09:20 +02:00
7fcc623c7f fix python indentation 2023-04-04 14:58:53 +02:00