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

Get rid of whitelist/blacklist getter code duplication #9

Open
vergeev opened this issue Jan 21, 2018 · 2 comments
Open

Get rid of whitelist/blacklist getter code duplication #9

vergeev opened this issue Jan 21, 2018 · 2 comments

Comments

@vergeev
Copy link
Contributor

vergeev commented Jan 21, 2018

Lines like this repeat over and over again.

Since we need a way to protect ourselves from regressions, this ticket should be completed first.

@vergeev
Copy link
Contributor Author

vergeev commented Apr 7, 2018

Current problems:

  • the whitelist names are implicitly chosen
  • the whitelists are far away from the place they are being used in
  • under current convention of naming whitelists, there can be no semantically different whitelists simultaneously (e.g. a whitelist of files and a whitelist of variable names)

@vergeev
Copy link
Contributor Author

vergeev commented Apr 10, 2018

The problems were addressed in the following ways:

  • Whitelist names are actually chosen explicitly by the validators on the lines such as:
whitelist = whitelists.get('has_no_extra_dockstrings_whitelist', [])
  • Whitelists are far away, and his is a good thing, as it allows the clients to parameterize the lists. We could just write a decorator with skip_dirs parameter, but this would not allow the clients to parameterize skip_dirs easily.
  • This is being addressed in Improve the names of whitelists and blacklists #102

Finally, in PR #100 we allowed to skip user-chosen directories (by all validators and pre-validators at once. We made "a global whitelist" basically):

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

No branches or pull requests

2 participants