question-mark
Stuck on an issue?

Lightrun Answers was designed to reduce the constant googling that comes with debugging 3rd party libraries. It collects links to all the places you might be looking at while hunting down a tough bug.

And, if you’re still stuck at the end, we’re happy to hop on a call to see how we can help out.

`RefasterRuleCompiler` ignores all but one input file

See original GitHub issue

First of all: Refaster is awesome. Defining new rules is child’s play. Super cool!

While playing around with it I defined a number of rewrite rules. If possible I’d like pass all of these to Error Prone in one go. But, while cursory look at the RefasterRuleCompiler indicates that it outputs a list of CodeTransformers to the file specified using the --out flag, only one of the input .java files actually contributes to the output. Would it be possible to combine multiple before/after templates into a single .refaster file?

(I’m not familiar with javac internals, but if you give me some pointers I’m willing to implement this generalization. Provided that you think this is a sound idea in the first place, of course.)

Issue Analytics

  • State:open
  • Created 7 years ago
  • Reactions:4
  • Comments:8 (6 by maintainers)

github_iconTop GitHub Comments

2reactions
lowassercommented, Mar 2, 2017

FWIW: internally the refaster rule compiler only accepts one file at a time, but we also have a separate tool that assembles a “suite” (which can include mixed Refaster and Error Prone refactorings). We might be able to externalize that bit?

1reaction
PhilippWendlercommented, Jul 29, 2019

Thanks a lot @Stephan202! I hope a solution can be found that does not need the use of forks.

Given that the implementation of your first approach seems so trivial: Googlers (@nglorioso, @lowasser), is there hope that this gets integrated soon in error-prone? It absolutely makes sense to do this, and would make at least refaster usable in many cases until a more general solution like @Stephan202’s second approach can be done.

Read more comments on GitHub >

github_iconTop Results From Across the Web

Index (Error Prone parent POM HEAD-SNAPSHOT API)
A list of all checks with severity ERROR that are on by default. ENABLED_WARNINGS - Static variable in class com.google.errorprone.scanner.
Read more >
Input files not all in same directory, please supply explicit wd ...
I encountered this error and your fix worked for me. I also tried passing an explicit working directory via the argument knit_root_dir but...
Read more >
Java Examples for java.nio.file.FileSystems - Javatips.net
This java examples will help you to understand the usage of java.nio.file. ... in copy operation but you set an already existing file...
Read more >
407643 – .gitignore: Ignore all but files of certain extension.
gitignore file: * !*.java !*/ It should ignore everything but the *.java files in current directory and its subdirectories. And it certainly ...
Read more >

github_iconTop Related Medium Post

No results found

github_iconTop Related StackOverflow Question

No results found

github_iconTroubleshoot Live Code

Lightrun enables developers to add logs, metrics and snapshots to live code - no restarts or redeploys required.
Start Free

github_iconTop Related Reddit Thread

No results found

github_iconTop Related Hackernoon Post

No results found

github_iconTop Related Tweet

No results found

github_iconTop Related Dev.to Post

No results found

github_iconTop Related Hashnode Post

No results found