Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
This PR was opened by the Changesets release GitHub action. When you're ready to do a release, you can merge this and the packages will be published to npm automatically. If you're not ready to do a release yet, that's fine, whenever you add more changesets to main, this PR will be updated.
Releases
refactor-bot@0.0.4
Patch Changes
#16
54d866e
Thanks @zaripych! - fix: if an identifier is not found, provide LLM with suggestion to reduce specificity#16
54d866e
Thanks @zaripych! - feat: improve benchmarking commandIntroduce changes to the report generated by the refactor bot so that we can get better benchmark stats.
The benchmark command now outputs
promptTokens
andcompletionTokens
.The report generated by the benchmark command has been improved to include difference comparison, outliers and a list of the refactors with lowest scores.
Example:
#16
54d866e
Thanks @zaripych! - fix: fail if eslint is not properly configured or installed instead of ignoring the errorsIf eslint is not properly configured or installed, the refactor bot would ignore the errors because it would fail to analyze
stderr
of theeslint
command.It now properly fails with a message that explains the problem.
This should lead to better outcomes when configuring the refactor bot for the first time.
#18
1d26b8c
Thanks @zaripych! - feat: introducing experimental chunky edit strategyThis strategy allows the LLM to perform edits via find-replace operations which reduce the total number of completion tokens. The completion tokens are typically priced at twice the cost of prompt tokens. In addition to the reduction of the price this strategy also significantly improves the performance of the refactoring.
Here are benchmark results for the
chunky-edit
strategy:While it does seem to improve the score, this should just be considered as variance introduce by the randomness of the LLM. The main outcome of this strategy is the reduction of the number of completion tokens and the improvement of the performance.
There might be some other side effects, probably depending on the type of the refactor. So, this strategy is still experimental and must be selectively opted-in via "--experiment-chunky-edit-strategy" cli option.