Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Deprecate --rules in favor of --rule-patterns #256

Closed
tarkatronic opened this issue Nov 2, 2021 · 1 comment · Fixed by #287
Closed

Deprecate --rules in favor of --rule-patterns #256

tarkatronic opened this issue Nov 2, 2021 · 1 comment · Fixed by #287
Assignees
Labels
enhancement New feature or request
Milestone

Comments

@tarkatronic
Copy link
Contributor

Feature Request

Is your feature request related to a problem? Please describe.

At this point, all tartufo config has been moved into the one central configuration file, except for --rules. In order to keep everything consistent, we should fix this one last one.

Describe the solution you'd like

  • Use of the --rules option should present the user with a DeprecationWarning

  • New regex patterns should instead be specified in the configuration file as a table of tables, similar to new style entropy exclusion. It would probably look something like

    [tool.tartufo]
    rule-patterns = [
      {name = "Private key", pattern = "---- BEGIN EC PRIVATE KEY ----", path_pattern = "/some/path"}
    ]

    OR

    [[tool.tartufo.rule-patterns]]
    name = "Private key"
    pattern = "---- BEGIN EC PRIVATE KEY ----"
    path_pattern = "/some/path"
  • Required keys would be "name" and "pattern"; "path_pattern" would be optional.

As far as the future deprecation path, I see two possibilities:

  1. This gets added to main directly, then ported to the v3.x branch, with the --rules option removed entirely in v3.0
  2. This gets merged into v3.x, and we decide upon some far future version (likely even v4.0) where the --rules option can be fully removed

The choice is up to the author of the PR!

@tarkatronic tarkatronic added the enhancement New feature or request label Nov 2, 2021
@tarkatronic tarkatronic added this to the Version 3.0 milestone Nov 2, 2021
@tarkatronic tarkatronic self-assigned this Nov 11, 2021
@tarkatronic tarkatronic linked a pull request Nov 22, 2021 that will close this issue
15 tasks
@tarkatronic
Copy link
Contributor Author

Fixed in #287

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
enhancement New feature or request
Projects
None yet
Development

Successfully merging a pull request may close this issue.

1 participant