Skip to content

Provide an option to look at linting errors without doing any rewrites #956

Open
@Prithvirajbilla

Description

@Prithvirajbilla

Problem

When writing linting rules which can possibly do a autofix/rewrite, it would be nice to have an option to run all linting rules to see what the errors were without doing a rewrite. And then run scalafix again to rewrite the linting errors which have an autofix.

For e.g: Let's say I want to write a linter rule which enforces javaconverters over java conversions. It would be good if it let the dev know other helpful information in linting message and an option to autofix it. currently we either do a check (--check flag) which prints patch to terminal (not pleasant) or automatic rewrite (with out --check flag)

Proposal

Add an option --dry-run (name upfor debate), which prints out only Patch.Lint messages to terminal without doing any rewrites and Optionally, letting users know there is a possibility of fixing few linting errors.

Metadata

Metadata

Assignees

No one assigned

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions