Skip to content
This repository was archived by the owner on Jul 12, 2022. It is now read-only.
This repository was archived by the owner on Jul 12, 2022. It is now read-only.

extensibility plans (being able to ignore rules) #124

@shiftkey

Description

@shiftkey

First off, thanks for making this open source. Real easy to use, and my Roslyn-fu is terrible.

I can see some mention of rule types floating around but these don't seem to be used any more. That's fine, I hacked around it for now 😁 and I'm probably missing some context on the decision to drop it.

I wanted to submit some changes that would help my use case, but wanted to see what plans you had (if any) for tailoring CodeFormatter to be able to ignore rules - without turning this into a religious holy war.

The things I had in mind at the moment:

  • move FormattingEngine.Create into the main project, so you can include rules from other assemblies outside the core
  • an optional list of rules to ignore as the last arguments to CodeFormatter.exe

I don't want to go down the FxCop/StyleCop path of setting up a whole bunch of useless IDs here, or define a "profile-esque" format that you pass in as an argument, so perhaps specifying the type name is okay (and given rules are suffixed with Rule that can be ignored for conciseness). Doing a blacklist rather than whitelist feels more practical because I think you generally want to suppress a couple of rules (that pit of success thing).

So if I wanted to format Octokit I could pass parameters like this to skip the three rules I don't like:

`.\CodeFormatter /nocopyright ExplicitVisibility NewLineAbove PrivateFieldNaming

Or if we want to be more explicit about the intent:

`.\CodeFormatter /nocopyright /skip ExplicitVisibility NewLineAbove PrivateFieldNaming

Thoughts?

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions