Java Developer

ot-clean, Scan multiple unrelated directories

Since version 0.9 ot-clean is supporting multiple starting directories. It means that you can execute cleaning in single place and clean unrelated directories. For example .clean.yml configuration might look like this:

 - c:/Users/ggajos/
 - ../above/parent

More detailed information will appear in the readme with version 0.10.

Taking care of exceptional cases

This tool is removing files from the hard drive. That is why test coverage is very important. Coverage for version 0.9 is 95%. I don’t think that it is necessary to have 100% but before the final release, it might reach that point. Below you can see also one of the test cases that is checking multiple dirs feature.

public void cleanupProjectStartingFromDifferentDirectory() {
    final String one = "one";
    final String two = "two";
    final Path root = this.folder.getRoot().toPath();
    this.writeYml(root.resolve(one), "deletes:\n - todelete");
            "dirs:\n - '",
    final Mode mode = new Mode(Mode.Arg.D.getLabel());
    new Clean(mode).clean(root.resolve(two));

The ot-clean series

This blog post is one of the series about the ot-clean. Simple open source tool that maintains your projects directories cleaned from all the garbage. Feel free to look at the source code or readme page for more information. You can also submit pull request or post suggestion. This text participates in open source blogging competition.

Project status

Build Status

All posts from the ot-clean series

Like it? Share it on , , ,

About the author

Grzegorz Gajos, Software Architect with international consulting and programming background. Co-founder of Open Tangerine Software House. Quality evangelist. An experienced entrepreneur, out of the box thinker and problem solver.