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

Merging of use-implicit-booleaness-like checkers for consistency and performance #6870

Merged

Conversation

Pierre-Sassoulas
Copy link
Member

@Pierre-Sassoulas Pierre-Sassoulas commented Jun 6, 2022

Type of Changes

Type
βœ“ πŸ”¨ Refactoring
βœ“ πŸ“œ Docs

Description

Follow-up to #8630
Closes #6871
Closes #5234

@coveralls
Copy link

coveralls commented Sep 28, 2022

Pull Request Test Coverage Report for Build 3440302019

  • 25 of 25 (100.0%) changed or added relevant lines in 1 file are covered.
  • No unchanged relevant lines lost coverage.
  • Overall coverage decreased (-0.003%) to 95.395%

Totals Coverage Status
Change from base Build 3440259725: -0.003%
Covered Lines: 17275
Relevant Lines: 18109

πŸ’› - Coveralls

@github-actions

This comment has been minimized.

@Pierre-Sassoulas Pierre-Sassoulas force-pushed the merge-compare-to-falsey branch from 30aa974 to e89dedc Compare October 1, 2022 20:31
@Pierre-Sassoulas
Copy link
Member Author

Following #7629 we can merge everything in the same checker but still make one check optional by default.

@Pierre-Sassoulas Pierre-Sassoulas added Maintenance Discussion or action around maintaining pylint or the dev workflow Documentation πŸ“— and removed Discussion πŸ€” labels Oct 30, 2022
Pierre-Sassoulas added a commit to Pierre-Sassoulas/pylint that referenced this pull request Nov 6, 2022
First step prior doing pylint-dev#6870 in order to make it more reviewable.
Pierre-Sassoulas added a commit to Pierre-Sassoulas/pylint that referenced this pull request Nov 6, 2022
First step prior doing pylint-dev#6870 in order to make it more reviewable.
Pierre-Sassoulas added a commit to Pierre-Sassoulas/pylint that referenced this pull request Nov 6, 2022
First step prior doing pylint-dev#6870 in order to make it more reviewable.
Pierre-Sassoulas added a commit to Pierre-Sassoulas/pylint that referenced this pull request Nov 6, 2022
…codebase

As it will become a default check in pylint-dev#6870 it will be easier to review it if we separate the two
Pierre-Sassoulas added a commit that referenced this pull request Nov 6, 2022
…7721)

First step prior doing #6870 in order to make it more reviewable.
Pierre-Sassoulas added a commit to Pierre-Sassoulas/pylint that referenced this pull request Nov 6, 2022
This make the message more understandable and permit to make pylint-dev#6870 more reviewable
Pierre-Sassoulas added a commit to Pierre-Sassoulas/pylint that referenced this pull request Nov 6, 2022
Originally done in order to normalize the use-implicit-booleaness check.
This make the message more understandable and permit to make pylint-dev#6870 more
reviewable.
@Pierre-Sassoulas Pierre-Sassoulas added Blocked 🚧 Blocked by a particular issue and removed Work in progress labels Nov 6, 2022
Pierre-Sassoulas added a commit to Pierre-Sassoulas/pylint that referenced this pull request Nov 6, 2022
…codebase

As it will become a default check in pylint-dev#6870 it will be easier to review it if we separate the two
@Pierre-Sassoulas Pierre-Sassoulas added this to the 3.0.0b1 milestone May 2, 2023
@Pierre-Sassoulas Pierre-Sassoulas removed the Blocked 🚧 Blocked by a particular issue label May 2, 2023
@Pierre-Sassoulas Pierre-Sassoulas force-pushed the merge-compare-to-falsey branch from 012e78a to f18d4ee Compare May 2, 2023 19:09
@Pierre-Sassoulas Pierre-Sassoulas changed the title Work in progress for merging of use-implicit-booleaness-like checkers Merging of use-implicit-booleaness-like checkers May 2, 2023
…v#8592)

The extension `compare-to-empty-string` is only applicable when the expression being
compared is strictly a `str`.  The extension `compare-to-zero` is only applicable when
the expression being compared is strictly an `int`.
@Pierre-Sassoulas Pierre-Sassoulas force-pushed the merge-compare-to-falsey branch from f18d4ee to eb0931c Compare May 2, 2023 19:27
@github-actions

This comment has been minimized.

@Pierre-Sassoulas Pierre-Sassoulas force-pushed the merge-compare-to-falsey branch from eb0931c to 7aeb690 Compare May 2, 2023 20:32
@Pierre-Sassoulas Pierre-Sassoulas marked this pull request as ready for review May 2, 2023 21:10
@github-actions

This comment has been minimized.

@Pierre-Sassoulas
Copy link
Member Author

There might be some optimization between "use-implicit-booleaness-not-comparison and the two other but they're not obvious, the logic of "to-string" and "to-zero" would need a serious refactor. I think it's good enough for now.

@Pierre-Sassoulas Pierre-Sassoulas changed the title Merging of use-implicit-booleaness-like checkers Merging of use-implicit-booleaness-like checkers for consistency and performance May 2, 2023
@github-actions

This comment has been minimized.

@Pierre-Sassoulas Pierre-Sassoulas force-pushed the merge-compare-to-falsey branch from 48a4a15 to 616a234 Compare May 3, 2023 06:13
@github-actions
Copy link
Contributor

github-actions bot commented May 3, 2023

πŸ€– Effect of this PR on checked open source code: πŸ€–

Effect on astroid:
The following messages are now emitted:

  1. use-implicit-booleaness-not-comparison-to-zero:
    "argindex == 0" can be simplified to "not argindex", if it is strictly an int, as 0 is falsey
    https://github.com/pylint-dev/astroid/blob/a98b08ff09a67e4e2c9e4e0fe67c398d1537559d/astroid/arguments.py#L202
  2. use-implicit-booleaness-not-comparison-to-string:
    "parts[0] == ''" can be simplified to "not parts[0]", if it is striclty a string, as an empty string is falsey
    https://github.com/pylint-dev/astroid/blob/a98b08ff09a67e4e2c9e4e0fe67c398d1537559d/astroid/modutils.py#L430
  3. use-implicit-booleaness-not-comparison-to-string:
    "parts[starti] == ''" can be simplified to "not parts[starti]", if it is striclty a string, as an empty string is falsey
    https://github.com/pylint-dev/astroid/blob/a98b08ff09a67e4e2c9e4e0fe67c398d1537559d/astroid/modutils.py#L436
  4. use-implicit-booleaness-not-comparison-to-zero:
    "last_index[names[0]] != 0" can be simplified to "last_index[names[0]]", if it is strictly an int, as 0 is falsey
    https://github.com/pylint-dev/astroid/blob/a98b08ff09a67e4e2c9e4e0fe67c398d1537559d/astroid/nodes/scoped_nodes/scoped_nodes.py#L142

The following messages are no longer emitted:

  1. use-implicit-booleaness-not-comparison-to-zero:
    "argindex == 0" can be simplified to "not argindex" as 0 is falsey
    https://github.com/pylint-dev/astroid/blob/a98b08ff09a67e4e2c9e4e0fe67c398d1537559d/astroid/arguments.py#L202
  2. use-implicit-booleaness-not-comparison-to-string:
    "parts[0] == ''" can be simplified to "not parts[0]" as an empty string is falsey
    https://github.com/pylint-dev/astroid/blob/a98b08ff09a67e4e2c9e4e0fe67c398d1537559d/astroid/modutils.py#L430
  3. use-implicit-booleaness-not-comparison-to-string:
    "parts[starti] == ''" can be simplified to "not parts[starti]" as an empty string is falsey
    https://github.com/pylint-dev/astroid/blob/a98b08ff09a67e4e2c9e4e0fe67c398d1537559d/astroid/modutils.py#L436
  4. use-implicit-booleaness-not-comparison-to-zero:
    "last_index[names[0]] != 0" can be simplified to "last_index[names[0]]" as 0 is falsey
    https://github.com/pylint-dev/astroid/blob/a98b08ff09a67e4e2c9e4e0fe67c398d1537559d/astroid/nodes/scoped_nodes/scoped_nodes.py#L142

Effect on black:
The following messages are now emitted:

  1. use-implicit-booleaness-not-comparison-to-string:
    "LL[string_idx - 1].value == ''" can be simplified to "not LL[string_idx - 1].value", if it is striclty a string, as an empty string is falsey
    https://github.com/psf/black/blob/e712e48e06420d9240ce95c81acfcf6f11d14c83/src/black/trans.py#L1101
  2. use-implicit-booleaness-not-comparison-to-string:
    "N.value == ''" can be simplified to "not N.value", if it is striclty a string, as an empty string is falsey
    https://github.com/psf/black/blob/e712e48e06420d9240ce95c81acfcf6f11d14c83/src/black/trans.py#L1133
  3. use-implicit-booleaness-not-comparison-to-zero:
    "self._unmatched_lpars == 0" can be simplified to "not self._unmatched_lpars", if it is strictly an int, as 0 is falsey
    https://github.com/psf/black/blob/e712e48e06420d9240ce95c81acfcf6f11d14c83/src/black/trans.py#L2314
  4. use-implicit-booleaness-not-comparison-to-zero:
    "i == 0" can be simplified to "not i", if it is strictly an int, as 0 is falsey
    https://github.com/psf/black/blob/e712e48e06420d9240ce95c81acfcf6f11d14c83/src/black/linegen.py#L221
  5. use-implicit-booleaness-not-comparison-to-zero:
    "tail_len == 0" can be simplified to "not tail_len", if it is strictly an int, as 0 is falsey
    https://github.com/psf/black/blob/e712e48e06420d9240ce95c81acfcf6f11d14c83/src/black/linegen.py#L856
  6. use-implicit-booleaness-not-comparison-to-zero:
    "index == 0" can be simplified to "not index", if it is strictly an int, as 0 is falsey
    https://github.com/psf/black/blob/e712e48e06420d9240ce95c81acfcf6f11d14c83/src/black/linegen.py#L1146
  7. use-implicit-booleaness-not-comparison-to-zero:
    "len(back_slashes) % 2 == 0" can be simplified to "not len(back_slashes) % 2", if it is strictly an int, as 0 is falsey
    https://github.com/psf/black/blob/e712e48e06420d9240ce95c81acfcf6f11d14c83/src/black/strings.py#L264
  8. use-implicit-booleaness-not-comparison-to-zero:
    "self.bracket_tracker.depth == 0" can be simplified to "not self.bracket_tracker.depth", if it is strictly an int, as 0 is falsey
    https://github.com/psf/black/blob/e712e48e06420d9240ce95c81acfcf6f11d14c83/src/black/lines.py#L101
  9. use-implicit-booleaness-not-comparison-to-zero:
    "len(self.leaves) == 0" can be simplified to "not len(self.leaves)", if it is strictly an int, as 0 is falsey
    https://github.com/psf/black/blob/e712e48e06420d9240ce95c81acfcf6f11d14c83/src/black/lines.py#L195
  10. use-implicit-booleaness-not-comparison-to-zero:
    "leaf.lineno != 0" can be simplified to "leaf.lineno", if it is strictly an int, as 0 is falsey
    https://github.com/psf/black/blob/e712e48e06420d9240ce95c81acfcf6f11d14c83/src/black/lines.py#L280
  11. use-implicit-booleaness-not-comparison-to-zero:
    "leaf.lineno != 0" can be simplified to "leaf.lineno", if it is strictly an int, as 0 is falsey
    https://github.com/psf/black/blob/e712e48e06420d9240ce95c81acfcf6f11d14c83/src/black/lines.py#L282
  12. use-implicit-booleaness-not-comparison-to-zero:
    "current_line.depth == 0" can be simplified to "not current_line.depth", if it is strictly an int, as 0 is falsey
    https://github.com/psf/black/blob/e712e48e06420d9240ce95c81acfcf6f11d14c83/src/black/lines.py#L570
  13. use-implicit-booleaness-not-comparison-to-zero:
    "before == 0" can be simplified to "not before", if it is strictly an int, as 0 is falsey
    https://github.com/psf/black/blob/e712e48e06420d9240ce95c81acfcf6f11d14c83/src/black/lines.py#L668
  14. use-implicit-booleaness-not-comparison-to-zero:
    "len(multiline_string_contexts) == 0" can be simplified to "not len(multiline_string_contexts)", if it is strictly an int, as 0 is falsey
    https://github.com/psf/black/blob/e712e48e06420d9240ce95c81acfcf6f11d14c83/src/black/lines.py#L837
  15. use-implicit-booleaness-not-comparison-to-zero:
    "val == 0" can be simplified to "not val", if it is strictly an int, as 0 is falsey
    https://github.com/psf/black/blob/e712e48e06420d9240ce95c81acfcf6f11d14c83/src/black/lines.py#L840
  16. use-implicit-booleaness-not-comparison-to-string:
    "first.value == ''" can be simplified to "not first.value", if it is striclty a string, as an empty string is falsey
    https://github.com/psf/black/blob/e712e48e06420d9240ce95c81acfcf6f11d14c83/src/black/nodes.py#L759
  17. use-implicit-booleaness-not-comparison-to-string:
    "last.value == ''" can be simplified to "not last.value", if it is striclty a string, as an empty string is falsey
    https://github.com/psf/black/blob/e712e48e06420d9240ce95c81acfcf6f11d14c83/src/black/nodes.py#L762
  18. use-implicit-booleaness-not-comparison-to-string:
    "leaf.value == ''" can be simplified to "not leaf.value", if it is striclty a string, as an empty string is falsey
    https://github.com/psf/black/blob/e712e48e06420d9240ce95c81acfcf6f11d14c83/src/black/nodes.py#L771
  19. use-implicit-booleaness-not-comparison-to-string:
    "leaf.value == ''" can be simplified to "not leaf.value", if it is striclty a string, as an empty string is falsey
    https://github.com/psf/black/blob/e712e48e06420d9240ce95c81acfcf6f11d14c83/src/black/nodes.py#L775
  20. use-implicit-booleaness-not-comparison-to-zero:
    "self.depth == 0" can be simplified to "not self.depth", if it is strictly an int, as 0 is falsey
    https://github.com/psf/black/blob/e712e48e06420d9240ce95c81acfcf6f11d14c83/src/black/brackets.py#L98
  21. use-implicit-booleaness-not-comparison-to-zero:
    "self.depth == 0" can be simplified to "not self.depth", if it is strictly an int, as 0 is falsey
    https://github.com/psf/black/blob/e712e48e06420d9240ce95c81acfcf6f11d14c83/src/black/brackets.py#L119
  22. use-implicit-booleaness-not-comparison-to-zero:
    "len(nodes) == 0" can be simplified to "not len(nodes)", if it is strictly an int, as 0 is falsey
    https://github.com/psf/black/blob/e712e48e06420d9240ce95c81acfcf6f11d14c83/src/blib2to3/pytree.py#L948
  23. use-implicit-booleaness-not-comparison-to-zero:
    "len(nodes) == 0" can be simplified to "not len(nodes)", if it is strictly an int, as 0 is falsey
    https://github.com/psf/black/blob/e712e48e06420d9240ce95c81acfcf6f11d14c83/src/blib2to3/pytree.py#L953
  24. use-implicit-booleaness-not-comparison-to-zero:
    "len(alive_ilabels) == 0" can be simplified to "not len(alive_ilabels)", if it is strictly an int, as 0 is falsey
    https://github.com/psf/black/blob/e712e48e06420d9240ce95c81acfcf6f11d14c83/src/blib2to3/pgen2/parse.py#L119
  25. use-implicit-booleaness-not-comparison-to-zero:
    "x == 0" can be simplified to "not x", if it is strictly an int, as 0 is falsey
    https://github.com/psf/black/blob/e712e48e06420d9240ce95c81acfcf6f11d14c83/src/blib2to3/pgen2/conv.py#L179
  26. use-implicit-booleaness-not-comparison-to-zero:
    "parenlev == 0" can be simplified to "not parenlev", if it is strictly an int, as 0 is falsey
    https://github.com/psf/black/blob/e712e48e06420d9240ce95c81acfcf6f11d14c83/src/blib2to3/pgen2/tokenize.py#L485

The following messages are no longer emitted:

  1. use-implicit-booleaness-not-comparison-to-string:
    "LL[string_idx - 1].value == ''" can be simplified to "not LL[string_idx - 1].value" as an empty string is falsey
    https://github.com/psf/black/blob/e712e48e06420d9240ce95c81acfcf6f11d14c83/src/black/trans.py#L1101
  2. use-implicit-booleaness-not-comparison-to-string:
    "N.value == ''" can be simplified to "not N.value" as an empty string is falsey
    https://github.com/psf/black/blob/e712e48e06420d9240ce95c81acfcf6f11d14c83/src/black/trans.py#L1133
  3. use-implicit-booleaness-not-comparison-to-zero:
    "self._unmatched_lpars == 0" can be simplified to "not self._unmatched_lpars" as 0 is falsey
    https://github.com/psf/black/blob/e712e48e06420d9240ce95c81acfcf6f11d14c83/src/black/trans.py#L2314
  4. use-implicit-booleaness-not-comparison-to-zero:
    "i == 0" can be simplified to "not i" as 0 is falsey
    https://github.com/psf/black/blob/e712e48e06420d9240ce95c81acfcf6f11d14c83/src/black/linegen.py#L221
  5. use-implicit-booleaness-not-comparison-to-zero:
    "tail_len == 0" can be simplified to "not tail_len" as 0 is falsey
    https://github.com/psf/black/blob/e712e48e06420d9240ce95c81acfcf6f11d14c83/src/black/linegen.py#L856
  6. use-implicit-booleaness-not-comparison-to-zero:
    "index == 0" can be simplified to "not index" as 0 is falsey
    https://github.com/psf/black/blob/e712e48e06420d9240ce95c81acfcf6f11d14c83/src/black/linegen.py#L1146
  7. use-implicit-booleaness-not-comparison-to-zero:
    "len(back_slashes) % 2 == 0" can be simplified to "not len(back_slashes) % 2" as 0 is falsey
    https://github.com/psf/black/blob/e712e48e06420d9240ce95c81acfcf6f11d14c83/src/black/strings.py#L264
  8. use-implicit-booleaness-not-comparison-to-zero:
    "self.bracket_tracker.depth == 0" can be simplified to "not self.bracket_tracker.depth" as 0 is falsey
    https://github.com/psf/black/blob/e712e48e06420d9240ce95c81acfcf6f11d14c83/src/black/lines.py#L101
  9. use-implicit-booleaness-not-comparison-to-zero:
    "len(self.leaves) == 0" can be simplified to "not len(self.leaves)" as 0 is falsey
    https://github.com/psf/black/blob/e712e48e06420d9240ce95c81acfcf6f11d14c83/src/black/lines.py#L195
  10. use-implicit-booleaness-not-comparison-to-zero:
    "leaf.lineno != 0" can be simplified to "leaf.lineno" as 0 is falsey
    https://github.com/psf/black/blob/e712e48e06420d9240ce95c81acfcf6f11d14c83/src/black/lines.py#L280
  11. use-implicit-booleaness-not-comparison-to-zero:
    "leaf.lineno != 0" can be simplified to "leaf.lineno" as 0 is falsey
    https://github.com/psf/black/blob/e712e48e06420d9240ce95c81acfcf6f11d14c83/src/black/lines.py#L282
  12. use-implicit-booleaness-not-comparison-to-zero:
    "current_line.depth == 0" can be simplified to "not current_line.depth" as 0 is falsey
    https://github.com/psf/black/blob/e712e48e06420d9240ce95c81acfcf6f11d14c83/src/black/lines.py#L570
  13. use-implicit-booleaness-not-comparison-to-zero:
    "before == 0" can be simplified to "not before" as 0 is falsey
    https://github.com/psf/black/blob/e712e48e06420d9240ce95c81acfcf6f11d14c83/src/black/lines.py#L668
  14. use-implicit-booleaness-not-comparison-to-zero:
    "len(multiline_string_contexts) == 0" can be simplified to "not len(multiline_string_contexts)" as 0 is falsey
    https://github.com/psf/black/blob/e712e48e06420d9240ce95c81acfcf6f11d14c83/src/black/lines.py#L837
  15. use-implicit-booleaness-not-comparison-to-zero:
    "val == 0" can be simplified to "not val" as 0 is falsey
    https://github.com/psf/black/blob/e712e48e06420d9240ce95c81acfcf6f11d14c83/src/black/lines.py#L840
  16. use-implicit-booleaness-not-comparison-to-string:
    "first.value == ''" can be simplified to "not first.value" as an empty string is falsey
    https://github.com/psf/black/blob/e712e48e06420d9240ce95c81acfcf6f11d14c83/src/black/nodes.py#L759
  17. use-implicit-booleaness-not-comparison-to-string:
    "last.value == ''" can be simplified to "not last.value" as an empty string is falsey
    https://github.com/psf/black/blob/e712e48e06420d9240ce95c81acfcf6f11d14c83/src/black/nodes.py#L762
  18. use-implicit-booleaness-not-comparison-to-string:
    "leaf.value == ''" can be simplified to "not leaf.value" as an empty string is falsey
    https://github.com/psf/black/blob/e712e48e06420d9240ce95c81acfcf6f11d14c83/src/black/nodes.py#L771
  19. use-implicit-booleaness-not-comparison-to-string:
    "leaf.value == ''" can be simplified to "not leaf.value" as an empty string is falsey
    https://github.com/psf/black/blob/e712e48e06420d9240ce95c81acfcf6f11d14c83/src/black/nodes.py#L775
  20. use-implicit-booleaness-not-comparison-to-zero:
    "self.depth == 0" can be simplified to "not self.depth" as 0 is falsey
    https://github.com/psf/black/blob/e712e48e06420d9240ce95c81acfcf6f11d14c83/src/black/brackets.py#L98
  21. use-implicit-booleaness-not-comparison-to-zero:
    "self.depth == 0" can be simplified to "not self.depth" as 0 is falsey
    https://github.com/psf/black/blob/e712e48e06420d9240ce95c81acfcf6f11d14c83/src/black/brackets.py#L119
  22. use-implicit-booleaness-not-comparison-to-zero:
    "len(nodes) == 0" can be simplified to "not len(nodes)" as 0 is falsey
    https://github.com/psf/black/blob/e712e48e06420d9240ce95c81acfcf6f11d14c83/src/blib2to3/pytree.py#L948
  23. use-implicit-booleaness-not-comparison-to-zero:
    "len(nodes) == 0" can be simplified to "not len(nodes)" as 0 is falsey
    https://github.com/psf/black/blob/e712e48e06420d9240ce95c81acfcf6f11d14c83/src/blib2to3/pytree.py#L953
  24. use-implicit-booleaness-not-comparison-to-zero:
    "len(alive_ilabels) == 0" can be simplified to "not len(alive_ilabels)" as 0 is falsey
    https://github.com/psf/black/blob/e712e48e06420d9240ce95c81acfcf6f11d14c83/src/blib2to3/pgen2/parse.py#L119
  25. use-implicit-booleaness-not-comparison-to-zero:
    "x == 0" can be simplified to "not x" as 0 is falsey
    https://github.com/psf/black/blob/e712e48e06420d9240ce95c81acfcf6f11d14c83/src/blib2to3/pgen2/conv.py#L179
  26. use-implicit-booleaness-not-comparison-to-zero:
    "parenlev == 0" can be simplified to "not parenlev" as 0 is falsey
    https://github.com/psf/black/blob/e712e48e06420d9240ce95c81acfcf6f11d14c83/src/blib2to3/pgen2/tokenize.py#L485

Effect on django:
The following messages are now emitted:

  1. use-implicit-booleaness-not-comparison-to-string:
    "key == ''" can be simplified to "not key", if it is striclty a string, as an empty string is falsey
    https://github.com/django/django/blob/3b62d8c83e3e48d2ed61cfa32a61c56d9e030293/django/views/i18n.py#L185
  2. use-implicit-booleaness-not-comparison-to-zero:
    "unmatched_open_brackets == 0" can be simplified to "not unmatched_open_brackets", if it is strictly an int, as 0 is falsey
    https://github.com/django/django/blob/3b62d8c83e3e48d2ed61cfa32a61c56d9e030293/django/contrib/admindocs/utils.py#L184
  3. use-implicit-booleaness-not-comparison-to-zero:
    "i == 0" can be simplified to "not i", if it is strictly an int, as 0 is falsey
    https://github.com/django/django/blob/3b62d8c83e3e48d2ed61cfa32a61c56d9e030293/django/contrib/admin/helpers.py#L150
  4. use-implicit-booleaness-not-comparison-to-zero:
    "i == 0" can be simplified to "not i", if it is strictly an int, as 0 is falsey
    https://github.com/django/django/blob/3b62d8c83e3e48d2ed61cfa32a61c56d9e030293/django/contrib/admin/helpers.py#L153
  5. use-implicit-booleaness-not-comparison-to-string:
    "salt != ''" can be simplified to "salt", if it is striclty a string, as an empty string is falsey
    https://github.com/django/django/blob/3b62d8c83e3e48d2ed61cfa32a61c56d9e030293/django/contrib/auth/hashers.py#L744
  6. use-implicit-booleaness-not-comparison-to-string:
    "salt != ''" can be simplified to "salt", if it is striclty a string, as an empty string is falsey
    https://github.com/django/django/blob/3b62d8c83e3e48d2ed61cfa32a61c56d9e030293/django/contrib/auth/hashers.py#L799
  7. use-implicit-booleaness-not-comparison-to-string:
    "username == ''" can be simplified to "not username", if it is striclty a string, as an empty string is falsey
    https://github.com/django/django/blob/3b62d8c83e3e48d2ed61cfa32a61c56d9e030293/django/contrib/auth/management/commands/createsuperuser.py#L117
  8. use-implicit-booleaness-not-comparison-to-string:
    "password.strip() == ''" can be simplified to "not password.strip()", if it is striclty a string, as an empty string is falsey
    https://github.com/django/django/blob/3b62d8c83e3e48d2ed61cfa32a61c56d9e030293/django/contrib/auth/management/commands/createsuperuser.py#L178
  9. use-implicit-booleaness-not-comparison-to-string:
    "raw_value == ''" can be simplified to "not raw_value", if it is striclty a string, as an empty string is falsey
    https://github.com/django/django/blob/3b62d8c83e3e48d2ed61cfa32a61c56d9e030293/django/contrib/auth/management/commands/createsuperuser.py#L256
  10. use-implicit-booleaness-not-comparison-to-zero:
    "delta.days == 0" can be simplified to "not delta.days", if it is strictly an int, as 0 is falsey
    https://github.com/django/django/blob/3b62d8c83e3e48d2ed61cfa32a61c56d9e030293/django/contrib/humanize/templatetags/humanize.py#L187
  11. use-implicit-booleaness-not-comparison-to-zero:
    "delta.days != 0" can be simplified to "delta.days", if it is strictly an int, as 0 is falsey
    https://github.com/django/django/blob/3b62d8c83e3e48d2ed61cfa32a61c56d9e030293/django/contrib/humanize/templatetags/humanize.py#L289
  12. use-implicit-booleaness-not-comparison-to-zero:
    "delta.seconds == 0" can be simplified to "not delta.seconds", if it is strictly an int, as 0 is falsey
    https://github.com/django/django/blob/3b62d8c83e3e48d2ed61cfa32a61c56d9e030293/django/contrib/humanize/templatetags/humanize.py#L295
  13. use-implicit-booleaness-not-comparison-to-zero:
    "delta.days != 0" can be simplified to "delta.days", if it is strictly an int, as 0 is falsey
    https://github.com/django/django/blob/3b62d8c83e3e48d2ed61cfa32a61c56d9e030293/django/contrib/humanize/templatetags/humanize.py#L307
  14. use-implicit-booleaness-not-comparison-to-zero:
    "delta.seconds == 0" can be simplified to "not delta.seconds", if it is strictly an int, as 0 is falsey
    https://github.com/django/django/blob/3b62d8c83e3e48d2ed61cfa32a61c56d9e030293/django/contrib/humanize/templatetags/humanize.py#L313
  15. use-implicit-booleaness-not-comparison-to-string:
    "r.new_path == ''" can be simplified to "not r.new_path", if it is striclty a string, as an empty string is falsey
    https://github.com/django/django/blob/3b62d8c83e3e48d2ed61cfa32a61c56d9e030293/django/contrib/redirects/middleware.py#L45
  16. use-implicit-booleaness-not-comparison-to-zero:
    "expiry == 0" can be simplified to "not expiry", if it is strictly an int, as 0 is falsey
    https://github.com/django/django/blob/3b62d8c83e3e48d2ed61cfa32a61c56d9e030293/django/contrib/sessions/backends/base.py#L287
  17. use-implicit-booleaness-not-comparison-to-zero:
    "num_feat % progress_interval == 0" can be simplified to "not num_feat % progress_interval", if it is strictly an int, as 0 is falsey
    https://github.com/django/django/blob/3b62d8c83e3e48d2ed61cfa32a61c56d9e030293/django/contrib/gis/utils/layermapping.py#L682
  18. use-implicit-booleaness-not-comparison-to-zero:
    "index == 0" can be simplified to "not index", if it is strictly an int, as 0 is falsey
    https://github.com/django/django/blob/3b62d8c83e3e48d2ed61cfa32a61c56d9e030293/django/contrib/gis/geos/point.py#L109
  19. use-implicit-booleaness-not-comparison-to-zero:
    "s == 0" can be simplified to "not s", if it is strictly an int, as 0 is falsey
    https://github.com/django/django/blob/3b62d8c83e3e48d2ed61cfa32a61c56d9e030293/django/contrib/gis/geos/geometry.py#L362
  20. use-implicit-booleaness-not-comparison-to-zero:
    "index == 0" can be simplified to "not index", if it is strictly an int, as 0 is falsey
    https://github.com/django/django/blob/3b62d8c83e3e48d2ed61cfa32a61c56d9e030293/django/contrib/gis/geos/polygon.py#L139
  21. use-implicit-booleaness-not-comparison-to-zero:
    "result == 0" can be simplified to "not result", if it is strictly an int, as 0 is falsey
    https://github.com/django/django/blob/3b62d8c83e3e48d2ed61cfa32a61c56d9e030293/django/contrib/gis/geos/prototypes/coordseq.py#L10
  22. use-implicit-booleaness-not-comparison-to-zero:
    "result == 0" can be simplified to "not result", if it is strictly an int, as 0 is falsey
    https://github.com/django/django/blob/3b62d8c83e3e48d2ed61cfa32a61c56d9e030293/django/contrib/gis/geos/prototypes/errcheck.py#L53
  23. use-implicit-booleaness-not-comparison-to-string:
    "geo_value == ''" can be simplified to "not geo_value", if it is striclty a string, as an empty string is falsey
    https://github.com/django/django/blob/3b62d8c83e3e48d2ed61cfa32a61c56d9e030293/django/contrib/gis/db/models/proxy.py#L40
  24. use-implicit-booleaness-not-comparison-to-zero:
    "z != 0.0" can be simplified to "z", if it is strictly an int, as 0 is falsey
    https://github.com/django/django/blob/3b62d8c83e3e48d2ed61cfa32a61c56d9e030293/django/contrib/gis/db/models/functions.py#L518
  25. use-implicit-booleaness-not-comparison-to-string:
    "path == ''" can be simplified to "not path", if it is striclty a string, as an empty string is falsey
    https://github.com/django/django/blob/3b62d8c83e3e48d2ed61cfa32a61c56d9e030293/django/contrib/staticfiles/views.py#L35
  26. use-implicit-booleaness-not-comparison-to-zero:
    "len(bits) % 2 == 0" can be simplified to "not len(bits) % 2", if it is strictly an int, as 0 is falsey
    https://github.com/django/django/blob/3b62d8c83e3e48d2ed61cfa32a61c56d9e030293/django/contrib/flatpages/templatetags/flatpages.py#L81
  27. use-implicit-booleaness-not-comparison-to-string:
    "value == ''" can be simplified to "not value", if it is striclty a string, as an empty string is falsey
    https://github.com/django/django/blob/3b62d8c83e3e48d2ed61cfa32a61c56d9e030293/django/forms/widgets.py#L253
  28. use-implicit-booleaness-not-comparison-to-string:
    "v == ''" can be simplified to "not v", if it is striclty a string, as an empty string is falsey
    https://github.com/django/django/blob/3b62d8c83e3e48d2ed61cfa32a61c56d9e030293/django/forms/widgets.py#L546
  29. use-implicit-booleaness-not-comparison-to-string:
    "value == ''" can be simplified to "not value", if it is striclty a string, as an empty string is falsey
    https://github.com/django/django/blob/3b62d8c83e3e48d2ed61cfa32a61c56d9e030293/django/forms/widgets.py#L561
  30. use-implicit-booleaness-not-comparison-to-string:
    "value == ''" can be simplified to "not value", if it is striclty a string, as an empty string is falsey
    https://github.com/django/django/blob/3b62d8c83e3e48d2ed61cfa32a61c56d9e030293/django/forms/widgets.py#L739
  31. use-implicit-booleaness-not-comparison-to-string:
    "y == m == d == ''" can be simplified to "not d", if it is striclty a string, as an empty string is falsey
    https://github.com/django/django/blob/3b62d8c83e3e48d2ed61cfa32a61c56d9e030293/django/forms/widgets.py#L1156
  32. use-implicit-booleaness-not-comparison-to-zero:
    "value != 0" can be simplified to "value", if it is strictly an int, as 0 is falsey
    https://github.com/django/django/blob/3b62d8c83e3e48d2ed61cfa32a61c56d9e030293/django/utils/timesince.py#L119
  33. use-implicit-booleaness-not-comparison-to-zero:
    "value == 0" can be simplified to "not value", if it is strictly an int, as 0 is falsey
    https://github.com/django/django/blob/3b62d8c83e3e48d2ed61cfa32a61c56d9e030293/django/utils/timesince.py#L128
  34. use-implicit-booleaness-not-comparison-to-string:
    "number == ''" can be simplified to "not number", if it is striclty a string, as an empty string is falsey
    https://github.com/django/django/blob/3b62d8c83e3e48d2ed61cfa32a61c56d9e030293/django/utils/numberformat.py#L28
  35. use-implicit-booleaness-not-comparison-to-zero:
    "grouping != 0" can be simplified to "grouping", if it is strictly an int, as 0 is falsey
    https://github.com/django/django/blob/3b62d8c83e3e48d2ed61cfa32a61c56d9e030293/django/utils/numberformat.py#L34
  36. use-implicit-booleaness-not-comparison-to-zero:
    "space == 0" can be simplified to "not space", if it is strictly an int, as 0 is falsey
    https://github.com/django/django/blob/3b62d8c83e3e48d2ed61cfa32a61c56d9e030293/django/utils/text.py#L52
  37. use-implicit-booleaness-not-comparison-to-zero:
    "space == 0" can be simplified to "not space", if it is strictly an int, as 0 is falsey
    https://github.com/django/django/blob/3b62d8c83e3e48d2ed61cfa32a61c56d9e030293/django/utils/text.py#L54
  38. use-implicit-booleaness-not-comparison-to-zero:
    "truncate_len == 0" can be simplified to "not truncate_len", if it is strictly an int, as 0 is falsey
    https://github.com/django/django/blob/3b62d8c83e3e48d2ed61cfa32a61c56d9e030293/django/utils/text.py#L107
  39. use-implicit-booleaness-not-comparison-to-zero:
    "count == 0" can be simplified to "not count", if it is strictly an int, as 0 is falsey
    https://github.com/django/django/blob/3b62d8c83e3e48d2ed61cfa32a61c56d9e030293/django/utils/inspect.py#L69
  40. use-implicit-booleaness-not-comparison-to-string:
    "text == ''" can be simplified to "not text", if it is striclty a string, as an empty string is falsey
    https://github.com/django/django/blob/3b62d8c83e3e48d2ed61cfa32a61c56d9e030293/django/utils/termcolors.py#L49
  41. use-implicit-booleaness-not-comparison-to-zero:
    "i != 0" can be simplified to "i", if it is strictly an int, as 0 is falsey
    https://github.com/django/django/blob/3b62d8c83e3e48d2ed61cfa32a61c56d9e030293/django/utils/http.py#L172
  42. use-implicit-booleaness-not-comparison-to-zero:
    "version[4] == 0" can be simplified to "not version[4]", if it is strictly an int, as 0 is falsey
    https://github.com/django/django/blob/3b62d8c83e3e48d2ed61cfa32a61c56d9e030293/django/utils/version.py#L34
  43. use-implicit-booleaness-not-comparison-to-zero:
    "version[2] == 0" can be simplified to "not version[2]", if it is strictly an int, as 0 is falsey
    https://github.com/django/django/blob/3b62d8c83e3e48d2ed61cfa32a61c56d9e030293/django/utils/version.py#L49
  44. use-implicit-booleaness-not-comparison-to-zero:
    "self.data.minute == 0" can be simplified to "not self.data.minute", if it is strictly an int, as 0 is falsey
    https://github.com/django/django/blob/3b62d8c83e3e48d2ed61cfa32a61c56d9e030293/django/utils/dateformat.py#L151
  45. use-implicit-booleaness-not-comparison-to-zero:
    "self.data.hour == 0" can be simplified to "not self.data.hour", if it is strictly an int, as 0 is falsey
    https://github.com/django/django/blob/3b62d8c83e3e48d2ed61cfa32a61c56d9e030293/django/utils/dateformat.py#L151
  46. use-implicit-booleaness-not-comparison-to-zero:
    "self.data.minute == 0" can be simplified to "not self.data.minute", if it is strictly an int, as 0 is falsey
    https://github.com/django/django/blob/3b62d8c83e3e48d2ed61cfa32a61c56d9e030293/django/utils/dateformat.py#L153
  47. use-implicit-booleaness-not-comparison-to-zero:
    "count == 0" can be simplified to "not count", if it is strictly an int, as 0 is falsey
    https://github.com/django/django/blob/3b62d8c83e3e48d2ed61cfa32a61c56d9e030293/django/utils/regex_helper.py#L166
  48. use-implicit-booleaness-not-comparison-to-zero:
    "i == 0" can be simplified to "not i", if it is strictly an int, as 0 is falsey
    https://github.com/django/django/blob/3b62d8c83e3e48d2ed61cfa32a61c56d9e030293/django/utils/lorem_ipsum.py#L262
  49. use-implicit-booleaness-not-comparison-to-string:
    "subpath == ''" can be simplified to "not subpath", if it is striclty a string, as an empty string is falsey
    https://github.com/django/django/blob/3b62d8c83e3e48d2ed61cfa32a61c56d9e030293/django/apps/registry.py#L265
  50. use-implicit-booleaness-not-comparison-to-zero:
    "token_type == 0" can be simplified to "not token_type", if it is strictly an int, as 0 is falsey
    https://github.com/django/django/blob/3b62d8c83e3e48d2ed61cfa32a61c56d9e030293/django/template/base.py#L470
  51. use-implicit-booleaness-not-comparison-to-zero:
    "i == 0" can be simplified to "not i", if it is strictly an int, as 0 is falsey
    https://github.com/django/django/blob/3b62d8c83e3e48d2ed61cfa32a61c56d9e030293/django/template/defaulttags.py#L213
  52. use-implicit-booleaness-not-comparison-to-zero:
    "int(value) % int(arg) == 0" can be simplified to "not int(value) % int(arg)", if it is strictly an int, as 0 is falsey
    https://github.com/django/django/blob/3b62d8c83e3e48d2ed61cfa32a61c56d9e030293/django/template/defaultfilters.py#L843
  53. use-implicit-booleaness-not-comparison-to-zero:
    "round(abs(self.val - other), self.places) == 0" can be simplified to "not round(abs(self.val - other), self.places)", if it is strictly an int, as 0 is falsey
    https://github.com/django/django/blob/3b62d8c83e3e48d2ed61cfa32a61c56d9e030293/django/test/utils.py#L67
  54. use-implicit-booleaness-not-comparison-to-zero:
    "real_count != 0" can be simplified to "real_count", if it is strictly an int, as 0 is falsey
    https://github.com/django/django/blob/3b62d8c83e3e48d2ed61cfa32a61c56d9e030293/django/test/testcases.py#L537
  55. use-implicit-booleaness-not-comparison-to-zero:
    "real_count != 0" can be simplified to "real_count", if it is strictly an int, as 0 is falsey
    https://github.com/django/django/blob/3b62d8c83e3e48d2ed61cfa32a61c56d9e030293/django/test/testcases.py#L903
  56. use-implicit-booleaness-not-comparison-to-zero:
    "self.port == 0" can be simplified to "not self.port", if it is strictly an int, as 0 is falsey
    https://github.com/django/django/blob/3b62d8c83e3e48d2ed61cfa32a61c56d9e030293/django/test/testcases.py#L1609
  57. use-implicit-booleaness-not-comparison-to-zero:
    "self._content_length == 0" can be simplified to "not self._content_length", if it is strictly an int, as 0 is falsey
    https://github.com/django/django/blob/3b62d8c83e3e48d2ed61cfa32a61c56d9e030293/django/http/multipartparser.py#L145
  58. use-implicit-booleaness-not-comparison-to-zero:
    "remaining != 0" can be simplified to "remaining", if it is strictly an int, as 0 is falsey
    https://github.com/django/django/blob/3b62d8c83e3e48d2ed61cfa32a61c56d9e030293/django/http/multipartparser.py#L308
  59. use-implicit-booleaness-not-comparison-to-zero:
    "remaining != 0" can be simplified to "remaining", if it is strictly an int, as 0 is falsey
    https://github.com/django/django/blob/3b62d8c83e3e48d2ed61cfa32a61c56d9e030293/django/http/multipartparser.py#L452
  60. use-implicit-booleaness-not-comparison-to-zero:
    "s == 0" can be simplified to "not s", if it is strictly an int, as 0 is falsey
    https://github.com/django/django/blob/3b62d8c83e3e48d2ed61cfa32a61c56d9e030293/django/core/signing.py#L67
  61. use-implicit-booleaness-not-comparison-to-zero:
    "self.count == 0" can be simplified to "not self.count", if it is strictly an int, as 0 is falsey
    https://github.com/django/django/blob/3b62d8c83e3e48d2ed61cfa32a61c56d9e030293/django/core/paginator.py#L116
  62. use-implicit-booleaness-not-comparison-to-zero:
    "self.paginator.count == 0" can be simplified to "not self.paginator.count", if it is strictly an int, as 0 is falsey
    https://github.com/django/django/blob/3b62d8c83e3e48d2ed61cfa32a61c56d9e030293/django/core/paginator.py#L226
  63. use-implicit-booleaness-not-comparison-to-zero:
    "len(path_segments) == 0" can be simplified to "not len(path_segments)", if it is strictly an int, as 0 is falsey
    https://github.com/django/django/blob/3b62d8c83e3e48d2ed61cfa32a61c56d9e030293/django/core/files/storage/memory.py#L122
  64. use-implicit-booleaness-not-comparison-to-zero:
    "timeout == 0" can be simplified to "not timeout", if it is strictly an int, as 0 is falsey
    https://github.com/django/django/blob/3b62d8c83e3e48d2ed61cfa32a61c56d9e030293/django/core/cache/backends/base.py#L92
  65. use-implicit-booleaness-not-comparison-to-zero:
    "self._cull_frequency == 0" can be simplified to "not self._cull_frequency", if it is strictly an int, as 0 is falsey
    https://github.com/django/django/blob/3b62d8c83e3e48d2ed61cfa32a61c56d9e030293/django/core/cache/backends/db.py#L257
  66. use-implicit-booleaness-not-comparison-to-zero:
    "int(timeout) == 0" can be simplified to "not int(timeout)", if it is strictly an int, as 0 is falsey
    https://github.com/django/django/blob/3b62d8c83e3e48d2ed61cfa32a61c56d9e030293/django/core/cache/backends/memcached.py#L53
  67. use-implicit-booleaness-not-comparison-to-zero:
    "timeout == 0" can be simplified to "not timeout", if it is strictly an int, as 0 is falsey
    https://github.com/django/django/blob/3b62d8c83e3e48d2ed61cfa32a61c56d9e030293/django/core/cache/backends/memcached.py#L163
  68. use-implicit-booleaness-not-comparison-to-zero:
    "self._cull_frequency == 0" can be simplified to "not self._cull_frequency", if it is strictly an int, as 0 is falsey
    https://github.com/django/django/blob/3b62d8c83e3e48d2ed61cfa32a61c56d9e030293/django/core/cache/backends/locmem.py#L92
  69. use-implicit-booleaness-not-comparison-to-zero:
    "self._cull_frequency == 0" can be simplified to "not self._cull_frequency", if it is strictly an int, as 0 is falsey
    https://github.com/django/django/blob/3b62d8c83e3e48d2ed61cfa32a61c56d9e030293/django/core/cache/backends/filebased.py#L109
  70. use-implicit-booleaness-not-comparison-to-zero:
    "timeout == 0" can be simplified to "not timeout", if it is strictly an int, as 0 is falsey
    https://github.com/django/django/blob/3b62d8c83e3e48d2ed61cfa32a61c56d9e030293/django/core/cache/backends/redis.py#L90
  71. use-implicit-booleaness-not-comparison-to-zero:
    "timeout == 0" can be simplified to "not timeout", if it is strictly an int, as 0 is falsey
    https://github.com/django/django/blob/3b62d8c83e3e48d2ed61cfa32a61c56d9e030293/django/core/cache/backends/redis.py#L105
  72. use-implicit-booleaness-not-comparison-to-zero:
    "visible_issue_count == 0" can be simplified to "not visible_issue_count", if it is strictly an int, as 0 is falsey
    https://github.com/django/django/blob/3b62d8c83e3e48d2ed61cfa32a61c56d9e030293/django/core/management/base.py#L547
  73. use-implicit-booleaness-not-comparison-to-zero:
    "s_opt.nargs != 0" can be simplified to "s_opt.nargs", if it is strictly an int, as 0 is falsey
    https://github.com/django/django/blob/3b62d8c83e3e48d2ed61cfa32a61c56d9e030293/django/core/management/__init__.py#L333
  74. use-implicit-booleaness-not-comparison-to-zero:
    "objects_in_fixture == 0" can be simplified to "not objects_in_fixture", if it is strictly an int, as 0 is falsey
    https://github.com/django/django/blob/3b62d8c83e3e48d2ed61cfa32a61c56d9e030293/django/core/management/commands/loaddata.py#L274
  75. use-implicit-booleaness-not-comparison-to-zero:
    "len(leaf_migration_nodes) == 0" can be simplified to "not len(leaf_migration_nodes)", if it is strictly an int, as 0 is falsey
    https://github.com/django/django/blob/3b62d8c83e3e48d2ed61cfa32a61c56d9e030293/django/core/management/commands/makemigrations.py#L268
  76. use-implicit-booleaness-not-comparison-to-zero:
    "i == 0" can be simplified to "not i", if it is strictly an int, as 0 is falsey
    https://github.com/django/django/blob/3b62d8c83e3e48d2ed61cfa32a61c56d9e030293/django/core/management/commands/compilemessages.py#L174
  77. use-implicit-booleaness-not-comparison-to-string:
    "lookup_value == ''" can be simplified to "not lookup_value", if it is striclty a string, as an empty string is falsey
    https://github.com/django/django/blob/3b62d8c83e3e48d2ed61cfa32a61c56d9e030293/django/db/models/base.py#L1314
  78. use-implicit-booleaness-not-comparison-to-zero:
    "self.start.value == 0" can be simplified to "not self.start.value", if it is strictly an int, as 0 is falsey
    https://github.com/django/django/blob/3b62d8c83e3e48d2ed61cfa32a61c56d9e030293/django/db/models/expressions.py#L1820
  79. use-implicit-booleaness-not-comparison-to-zero:
    "self.end.value == 0" can be simplified to "not self.end.value", if it is strictly an int, as 0 is falsey
    https://github.com/django/django/blob/3b62d8c83e3e48d2ed61cfa32a61c56d9e030293/django/db/models/expressions.py#L1827
  80. use-implicit-booleaness-not-comparison-to-string:
    "lookup_value == ''" can be simplified to "not lookup_value", if it is striclty a string, as an empty string is falsey
    https://github.com/django/django/blob/3b62d8c83e3e48d2ed61cfa32a61c56d9e030293/django/db/models/constraints.py#L385
  81. use-implicit-booleaness-not-comparison-to-string:
    "val == ''" can be simplified to "not val", if it is striclty a string, as an empty string is falsey
    https://github.com/django/django/blob/3b62d8c83e3e48d2ed61cfa32a61c56d9e030293/django/db/models/fields/related_descriptors.py#L680
  82. use-implicit-booleaness-not-comparison-to-string:
    "self.path != ''" can be simplified to "self.path", if it is striclty a string, as an empty string is falsey
    https://github.com/django/django/blob/3b62d8c83e3e48d2ed61cfa32a61c56d9e030293/django/db/models/fields/__init__.py#L1913
  83. use-implicit-booleaness-not-comparison-to-string:
    "default == ''" can be simplified to "not default", if it is striclty a string, as an empty string is falsey
    https://github.com/django/django/blob/3b62d8c83e3e48d2ed61cfa32a61c56d9e030293/django/db/models/fields/__init__.py#L2635
  84. use-implicit-booleaness-not-comparison-to-string:
    "value == ''" can be simplified to "not value", if it is striclty a string, as an empty string is falsey
    https://github.com/django/django/blob/3b62d8c83e3e48d2ed61cfa32a61c56d9e030293/django/db/models/fields/related.py#L1141
  85. use-implicit-booleaness-not-comparison-to-zero:
    "seen_from == 0" can be simplified to "not seen_from", if it is strictly an int, as 0 is falsey
    https://github.com/django/django/blob/3b62d8c83e3e48d2ed61cfa32a61c56d9e030293/django/db/models/fields/related.py#L1583
  86. use-implicit-booleaness-not-comparison-to-zero:
    "seen_to == 0" can be simplified to "not seen_to", if it is strictly an int, as 0 is falsey
    https://github.com/django/django/blob/3b62d8c83e3e48d2ed61cfa32a61c56d9e030293/django/db/models/fields/related.py#L1583
  87. use-implicit-booleaness-not-comparison:
    "inner_query.select == ()" can be simplified to "not inner_query.select", if it is strictly a sequence, as an empty tuple is falsey
    https://github.com/django/django/blob/3b62d8c83e3e48d2ed61cfa32a61c56d9e030293/django/db/models/sql/query.py#L497
  88. use-implicit-booleaness-not-comparison-to-string:
    "lookup.rhs == ''" can be simplified to "not lookup.rhs", if it is striclty a string, as an empty string is falsey
    https://github.com/django/django/blob/3b62d8c83e3e48d2ed61cfa32a61c56d9e030293/django/db/models/sql/query.py#L1311
  89. use-implicit-booleaness-not-comparison-to-zero:
    "pos == 0" can be simplified to "not pos", if it is strictly an int, as 0 is falsey
    https://github.com/django/django/blob/3b62d8c83e3e48d2ed61cfa32a61c56d9e030293/django/db/models/sql/query.py#L1639
  90. use-implicit-booleaness-not-comparison-to-zero:
    "self.low_mark != 0" can be simplified to "self.low_mark", if it is strictly an int, as 0 is falsey
    https://github.com/django/django/blob/3b62d8c83e3e48d2ed61cfa32a61c56d9e030293/django/db/models/sql/query.py#L2050
  91. use-implicit-booleaness-not-comparison-to-zero:
    "pos == 0" can be simplified to "not pos", if it is strictly an int, as 0 is falsey
    https://github.com/django/django/blob/3b62d8c83e3e48d2ed61cfa32a61c56d9e030293/django/db/models/sql/query.py#L2263
  92. use-implicit-booleaness-not-comparison-to-zero:
    "empty_needed == 0" can be simplified to "not empty_needed", if it is strictly an int, as 0 is falsey
    https://github.com/django/django/blob/3b62d8c83e3e48d2ed61cfa32a61c56d9e030293/django/db/models/sql/where.py#L161
  93. use-implicit-booleaness-not-comparison-to-zero:
    "full_needed == 0" can be simplified to "not full_needed", if it is strictly an int, as 0 is falsey
    https://github.com/django/django/blob/3b62d8c83e3e48d2ed61cfa32a61c56d9e030293/django/db/models/sql/where.py#L166
  94. use-implicit-booleaness-not-comparison-to-zero:
    "self.query.alias_refcount[a] == 0" can be simplified to "not self.query.alias_refcount[a]", if it is strictly an int, as 0 is falsey
    https://github.com/django/django/blob/3b62d8c83e3e48d2ed61cfa32a61c56d9e030293/django/db/models/sql/compiler.py#L71
  95. use-implicit-booleaness-not-comparison-to-zero:
    "index % 2 == 0" can be simplified to "not index % 2", if it is strictly an int, as 0 is falsey
    https://github.com/django/django/blob/3b62d8c83e3e48d2ed61cfa32a61c56d9e030293/django/db/models/functions/comparison.py#L165
  96. use-implicit-booleaness-not-comparison-to-zero:
    "braces_deep == 0" can be simplified to "not braces_deep", if it is strictly an int, as 0 is falsey
    https://github.com/django/django/blob/3b62d8c83e3e48d2ed61cfa32a61c56d9e030293/django/db/backends/sqlite3/introspection.py#L183
  97. use-implicit-booleaness-not-comparison-to-zero:
    "scale == 0" can be simplified to "not scale", if it is strictly an int, as 0 is falsey
    https://github.com/django/django/blob/3b62d8c83e3e48d2ed61cfa32a61c56d9e030293/django/db/backends/oracle/base.py#L446
  98. use-implicit-booleaness-not-comparison-to-zero:
    "precision == 0" can be simplified to "not precision", if it is strictly an int, as 0 is falsey
    https://github.com/django/django/blob/3b62d8c83e3e48d2ed61cfa32a61c56d9e030293/django/db/backends/oracle/base.py#L460
  99. use-implicit-booleaness-not-comparison-to-zero:
    "scale == 0" can be simplified to "not scale", if it is strictly an int, as 0 is falsey
    https://github.com/django/django/blob/3b62d8c83e3e48d2ed61cfa32a61c56d9e030293/django/db/backends/oracle/introspection.py#L57
  100. use-implicit-booleaness-not-comparison-to-string:
    "settings_dict['NAME'] == ''" can be simplified to "not settings_dict['NAME']", if it is striclty a string, as an empty string is falsey
    https://github.com/django/django/blob/3b62d8c83e3e48d2ed61cfa32a61c56d9e030293/django/db/backends/postgresql/base.py#L193
  101. use-implicit-booleaness-not-comparison-to-zero:
    "value == 0" can be simplified to "not value", if it is strictly an int, as 0 is falsey
    https://github.com/django/django/blob/3b62d8c83e3e48d2ed61cfa32a61c56d9e030293/django/db/backends/mysql/operations.py#L249
  102. use-implicit-booleaness-not-comparison-to-zero:
    "count == 0" can be simplified to "not count", if it is strictly an int, as 0 is falsey
    https://github.com/django/django/blob/3b62d8c83e3e48d2ed61cfa32a61c56d9e030293/django/db/backends/base/features.py#L391
  103. use-implicit-booleaness-not-comparison-to-zero:
    "start == 0" can be simplified to "not start", if it is strictly an int, as 0 is falsey
    https://github.com/django/django/blob/3b62d8c83e3e48d2ed61cfa32a61c56d9e030293/django/db/backends/base/operations.py#L712
  104. use-implicit-booleaness-not-comparison-to-zero:
    "end == 0" can be simplified to "not end", if it is strictly an int, as 0 is falsey
    https://github.com/django/django/blob/3b62d8c83e3e48d2ed61cfa32a61c56d9e030293/django/db/backends/base/operations.py#L723
  105. use-implicit-booleaness-not-comparison-to-zero:
    "i == 0" can be simplified to "not i", if it is strictly an int, as 0 is falsey
    https://github.com/django/django/blob/3b62d8c83e3e48d2ed61cfa32a61c56d9e030293/django/db/migrations/autodetector.py#L1714
  106. use-implicit-booleaness-not-comparison-to-zero:
    "i == 0" can be simplified to "not i", if it is strictly an int, as 0 is falsey
    https://github.com/django/django/blob/3b62d8c83e3e48d2ed61cfa32a61c56d9e030293/django/db/migrations/autodetector.py#L1719
  107. use-implicit-booleaness-not-comparison-to-string:
    "request_csrf_token == ''" can be simplified to "not request_csrf_token", if it is striclty a string, as an empty string is falsey
    https://github.com/django/django/blob/3b62d8c83e3e48d2ed61cfa32a61c56d9e030293/django/middleware/csrf.py#L375
  108. use-implicit-booleaness-not-comparison-to-zero:
    "timeout == 0" can be simplified to "not timeout", if it is strictly an int, as 0 is falsey
    https://github.com/django/django/blob/3b62d8c83e3e48d2ed61cfa32a61c56d9e030293/django/middleware/cache.py#L113

The following messages are no longer emitted:

  1. use-implicit-booleaness-not-comparison-to-string:
    "key == ''" can be simplified to "not key" as an empty string is falsey
    https://github.com/django/django/blob/3b62d8c83e3e48d2ed61cfa32a61c56d9e030293/django/views/i18n.py#L185
  2. use-implicit-booleaness-not-comparison-to-zero:
    "unmatched_open_brackets == 0" can be simplified to "not unmatched_open_brackets" as 0 is falsey
    https://github.com/django/django/blob/3b62d8c83e3e48d2ed61cfa32a61c56d9e030293/django/contrib/admindocs/utils.py#L184
  3. use-implicit-booleaness-not-comparison-to-zero:
    "i == 0" can be simplified to "not i" as 0 is falsey
    https://github.com/django/django/blob/3b62d8c83e3e48d2ed61cfa32a61c56d9e030293/django/contrib/admin/helpers.py#L150
  4. use-implicit-booleaness-not-comparison-to-zero:
    "i == 0" can be simplified to "not i" as 0 is falsey
    https://github.com/django/django/blob/3b62d8c83e3e48d2ed61cfa32a61c56d9e030293/django/contrib/admin/helpers.py#L153
  5. use-implicit-booleaness-not-comparison-to-string:
    "salt != ''" can be simplified to "salt" as an empty string is falsey
    https://github.com/django/django/blob/3b62d8c83e3e48d2ed61cfa32a61c56d9e030293/django/contrib/auth/hashers.py#L744
  6. use-implicit-booleaness-not-comparison-to-string:
    "salt != ''" can be simplified to "salt" as an empty string is falsey
    https://github.com/django/django/blob/3b62d8c83e3e48d2ed61cfa32a61c56d9e030293/django/contrib/auth/hashers.py#L799
  7. use-implicit-booleaness-not-comparison-to-string:
    "username == ''" can be simplified to "not username" as an empty string is falsey
    https://github.com/django/django/blob/3b62d8c83e3e48d2ed61cfa32a61c56d9e030293/django/contrib/auth/management/commands/createsuperuser.py#L117
  8. use-implicit-booleaness-not-comparison-to-string:
    "password.strip() == ''" can be simplified to "not password.strip()" as an empty string is falsey
    https://github.com/django/django/blob/3b62d8c83e3e48d2ed61cfa32a61c56d9e030293/django/contrib/auth/management/commands/createsuperuser.py#L178
  9. use-implicit-booleaness-not-comparison-to-string:
    "raw_value == ''" can be simplified to "not raw_value" as an empty string is falsey
    https://github.com/django/django/blob/3b62d8c83e3e48d2ed61cfa32a61c56d9e030293/django/contrib/auth/management/commands/createsuperuser.py#L256
  10. use-implicit-booleaness-not-comparison-to-zero:
    "delta.days == 0" can be simplified to "not delta.days" as 0 is falsey
    https://github.com/django/django/blob/3b62d8c83e3e48d2ed61cfa32a61c56d9e030293/django/contrib/humanize/templatetags/humanize.py#L187
  11. use-implicit-booleaness-not-comparison-to-zero:
    "delta.days != 0" can be simplified to "delta.days" as 0 is falsey
    https://github.com/django/django/blob/3b62d8c83e3e48d2ed61cfa32a61c56d9e030293/django/contrib/humanize/templatetags/humanize.py#L289
  12. use-implicit-booleaness-not-comparison-to-zero:
    "delta.seconds == 0" can be simplified to "not delta.seconds" as 0 is falsey
    https://github.com/django/django/blob/3b62d8c83e3e48d2ed61cfa32a61c56d9e030293/django/contrib/humanize/templatetags/humanize.py#L295
  13. use-implicit-booleaness-not-comparison-to-zero:
    "delta.days != 0" can be simplified to "delta.days" as 0 is falsey
    https://github.com/django/django/blob/3b62d8c83e3e48d2ed61cfa32a61c56d9e030293/django/contrib/humanize/templatetags/humanize.py#L307
  14. use-implicit-booleaness-not-comparison-to-zero:
    "delta.seconds == 0" can be simplified to "not delta.seconds" as 0 is falsey
    https://github.com/django/django/blob/3b62d8c83e3e48d2ed61cfa32a61c56d9e030293/django/contrib/humanize/templatetags/humanize.py#L313
  15. use-implicit-booleaness-not-comparison-to-string:
    "r.new_path == ''" can be simplified to "not r.new_path" as an empty string is falsey
    https://github.com/django/django/blob/3b62d8c83e3e48d2ed61cfa32a61c56d9e030293/django/contrib/redirects/middleware.py#L45
  16. use-implicit-booleaness-not-comparison-to-zero:
    "expiry == 0" can be simplified to "not expiry" as 0 is falsey
    https://github.com/django/django/blob/3b62d8c83e3e48d2ed61cfa32a61c56d9e030293/django/contrib/sessions/backends/base.py#L287
  17. use-implicit-booleaness-not-comparison-to-zero:
    "num_feat % progress_interval == 0" can be simplified to "not num_feat % progress_interval" as 0 is falsey
    https://github.com/django/django/blob/3b62d8c83e3e48d2ed61cfa32a61c56d9e030293/django/contrib/gis/utils/layermapping.py#L682
  18. use-implicit-booleaness-not-comparison-to-zero:
    "index == 0" can be simplified to "not index" as 0 is falsey
    https://github.com/django/django/blob/3b62d8c83e3e48d2ed61cfa32a61c56d9e030293/django/contrib/gis/geos/point.py#L109
  19. use-implicit-booleaness-not-comparison-to-zero:
    "s == 0" can be simplified to "not s" as 0 is falsey
    https://github.com/django/django/blob/3b62d8c83e3e48d2ed61cfa32a61c56d9e030293/django/contrib/gis/geos/geometry.py#L362
  20. use-implicit-booleaness-not-comparison-to-zero:
    "index == 0" can be simplified to "not index" as 0 is falsey
    https://github.com/django/django/blob/3b62d8c83e3e48d2ed61cfa32a61c56d9e030293/django/contrib/gis/geos/polygon.py#L139
  21. use-implicit-booleaness-not-comparison-to-zero:
    "result == 0" can be simplified to "not result" as 0 is falsey
    https://github.com/django/django/blob/3b62d8c83e3e48d2ed61cfa32a61c56d9e030293/django/contrib/gis/geos/prototypes/coordseq.py#L10
  22. use-implicit-booleaness-not-comparison-to-zero:
    "result == 0" can be simplified to "not result" as 0 is falsey
    https://github.com/django/django/blob/3b62d8c83e3e48d2ed61cfa32a61c56d9e030293/django/contrib/gis/geos/prototypes/errcheck.py#L53
  23. use-implicit-booleaness-not-comparison-to-string:
    "geo_value == ''" can be simplified to "not geo_value" as an empty string is falsey
    https://github.com/django/django/blob/3b62d8c83e3e48d2ed61cfa32a61c56d9e030293/django/contrib/gis/db/models/proxy.py#L40
  24. use-implicit-booleaness-not-comparison-to-zero:
    "z != 0.0" can be simplified to "z" as 0 is falsey
    https://github.com/django/django/blob/3b62d8c83e3e48d2ed61cfa32a61c56d9e030293/django/contrib/gis/db/models/functions.py#L518
  25. use-implicit-booleaness-not-comparison-to-string:
    "path == ''" can be simplified to "not path" as an empty string is falsey
    https://github.com/django/django/blob/3b62d8c83e3e48d2ed61cfa32a61c56d9e030293/django/contrib/staticfiles/views.py#L35
  26. use-implicit-booleaness-not-comparison-to-zero:
    "len(bits) % 2 == 0" can be simplified to "not len(bits) % 2" as 0 is falsey
    https://github.com/django/django/blob/3b62d8c83e3e48d2ed61cfa32a61c56d9e030293/django/contrib/flatpages/templatetags/flatpages.py#L81
  27. use-implicit-booleaness-not-comparison-to-string:
    "value == ''" can be simplified to "not value" as an empty string is falsey
    https://github.com/django/django/blob/3b62d8c83e3e48d2ed61cfa32a61c56d9e030293/django/forms/widgets.py#L253
  28. use-implicit-booleaness-not-comparison-to-string:
    "v == ''" can be simplified to "not v" as an empty string is falsey
    https://github.com/django/django/blob/3b62d8c83e3e48d2ed61cfa32a61c56d9e030293/django/forms/widgets.py#L546
  29. use-implicit-booleaness-not-comparison-to-string:
    "value == ''" can be simplified to "not value" as an empty string is falsey
    https://github.com/django/django/blob/3b62d8c83e3e48d2ed61cfa32a61c56d9e030293/django/forms/widgets.py#L561
  30. use-implicit-booleaness-not-comparison-to-string:
    "value == ''" can be simplified to "not value" as an empty string is falsey
    https://github.com/django/django/blob/3b62d8c83e3e48d2ed61cfa32a61c56d9e030293/django/forms/widgets.py#L739
  31. use-implicit-booleaness-not-comparison-to-string:
    "y == m == d == ''" can be simplified to "not d" as an empty string is falsey
    https://github.com/django/django/blob/3b62d8c83e3e48d2ed61cfa32a61c56d9e030293/django/forms/widgets.py#L1156
  32. use-implicit-booleaness-not-comparison-to-zero:
    "value != 0" can be simplified to "value" as 0 is falsey
    https://github.com/django/django/blob/3b62d8c83e3e48d2ed61cfa32a61c56d9e030293/django/utils/timesince.py#L119
  33. use-implicit-booleaness-not-comparison-to-zero:
    "value == 0" can be simplified to "not value" as 0 is falsey
    https://github.com/django/django/blob/3b62d8c83e3e48d2ed61cfa32a61c56d9e030293/django/utils/timesince.py#L128
  34. use-implicit-booleaness-not-comparison-to-string:
    "number == ''" can be simplified to "not number" as an empty string is falsey
    https://github.com/django/django/blob/3b62d8c83e3e48d2ed61cfa32a61c56d9e030293/django/utils/numberformat.py#L28
  35. use-implicit-booleaness-not-comparison-to-zero:
    "grouping != 0" can be simplified to "grouping" as 0 is falsey
    https://github.com/django/django/blob/3b62d8c83e3e48d2ed61cfa32a61c56d9e030293/django/utils/numberformat.py#L34
  36. use-implicit-booleaness-not-comparison-to-zero:
    "space == 0" can be simplified to "not space" as 0 is falsey
    https://github.com/django/django/blob/3b62d8c83e3e48d2ed61cfa32a61c56d9e030293/django/utils/text.py#L52
  37. use-implicit-booleaness-not-comparison-to-zero:
    "space == 0" can be simplified to "not space" as 0 is falsey
    https://github.com/django/django/blob/3b62d8c83e3e48d2ed61cfa32a61c56d9e030293/django/utils/text.py#L54
  38. use-implicit-booleaness-not-comparison-to-zero:
    "truncate_len == 0" can be simplified to "not truncate_len" as 0 is falsey
    https://github.com/django/django/blob/3b62d8c83e3e48d2ed61cfa32a61c56d9e030293/django/utils/text.py#L107
  39. use-implicit-booleaness-not-comparison-to-zero:
    "count == 0" can be simplified to "not count" as 0 is falsey
    https://github.com/django/django/blob/3b62d8c83e3e48d2ed61cfa32a61c56d9e030293/django/utils/inspect.py#L69
  40. use-implicit-booleaness-not-comparison-to-string:
    "text == ''" can be simplified to "not text" as an empty string is falsey
    https://github.com/django/django/blob/3b62d8c83e3e48d2ed61cfa32a61c56d9e030293/django/utils/termcolors.py#L49
  41. use-implicit-booleaness-not-comparison-to-zero:
    "i != 0" can be simplified to "i" as 0 is falsey
    https://github.com/django/django/blob/3b62d8c83e3e48d2ed61cfa32a61c56d9e030293/django/utils/http.py#L172
  42. use-implicit-booleaness-not-comparison-to-zero:
    "version[4] == 0" can be simplified to "not version[4]" as 0 is falsey
    https://github.com/django/django/blob/3b62d8c83e3e48d2ed61cfa32a61c56d9e030293/django/utils/version.py#L34
  43. use-implicit-booleaness-not-comparison-to-zero:
    "version[2] == 0" can be simplified to "not version[2]" as 0 is falsey
    https://github.com/django/django/blob/3b62d8c83e3e48d2ed61cfa32a61c56d9e030293/django/utils/version.py#L49
  44. use-implicit-booleaness-not-comparison-to-zero:
    "self.data.minute == 0" can be simplified to "not self.data.minute" as 0 is falsey
    https://github.com/django/django/blob/3b62d8c83e3e48d2ed61cfa32a61c56d9e030293/django/utils/dateformat.py#L151
  45. use-implicit-booleaness-not-comparison-to-zero:
    "self.data.hour == 0" can be simplified to "not self.data.hour" as 0 is falsey
    https://github.com/django/django/blob/3b62d8c83e3e48d2ed61cfa32a61c56d9e030293/django/utils/dateformat.py#L151
  46. use-implicit-booleaness-not-comparison-to-zero:
    "self.data.minute == 0" can be simplified to "not self.data.minute" as 0 is falsey
    https://github.com/django/django/blob/3b62d8c83e3e48d2ed61cfa32a61c56d9e030293/django/utils/dateformat.py#L153
  47. use-implicit-booleaness-not-comparison-to-zero:
    "count == 0" can be simplified to "not count" as 0 is falsey
    https://github.com/django/django/blob/3b62d8c83e3e48d2ed61cfa32a61c56d9e030293/django/utils/regex_helper.py#L166
  48. use-implicit-booleaness-not-comparison-to-zero:
    "i == 0" can be simplified to "not i" as 0 is falsey
    https://github.com/django/django/blob/3b62d8c83e3e48d2ed61cfa32a61c56d9e030293/django/utils/lorem_ipsum.py#L262
  49. use-implicit-booleaness-not-comparison-to-string:
    "subpath == ''" can be simplified to "not subpath" as an empty string is falsey
    https://github.com/django/django/blob/3b62d8c83e3e48d2ed61cfa32a61c56d9e030293/django/apps/registry.py#L265
  50. use-implicit-booleaness-not-comparison-to-zero:
    "token_type == 0" can be simplified to "not token_type" as 0 is falsey
    https://github.com/django/django/blob/3b62d8c83e3e48d2ed61cfa32a61c56d9e030293/django/template/base.py#L470
  51. use-implicit-booleaness-not-comparison-to-zero:
    "i == 0" can be simplified to "not i" as 0 is falsey
    https://github.com/django/django/blob/3b62d8c83e3e48d2ed61cfa32a61c56d9e030293/django/template/defaulttags.py#L213
  52. use-implicit-booleaness-not-comparison-to-zero:
    "int(value) % int(arg) == 0" can be simplified to "not int(value) % int(arg)" as 0 is falsey
    https://github.com/django/django/blob/3b62d8c83e3e48d2ed61cfa32a61c56d9e030293/django/template/defaultfilters.py#L843
  53. use-implicit-booleaness-not-comparison-to-zero:
    "round(abs(self.val - other), self.places) == 0" can be simplified to "not round(abs(self.val - other), self.places)" as 0 is falsey
    https://github.com/django/django/blob/3b62d8c83e3e48d2ed61cfa32a61c56d9e030293/django/test/utils.py#L67
  54. use-implicit-booleaness-not-comparison-to-zero:
    "real_count != 0" can be simplified to "real_count" as 0 is falsey
    https://github.com/django/django/blob/3b62d8c83e3e48d2ed61cfa32a61c56d9e030293/django/test/testcases.py#L537
  55. use-implicit-booleaness-not-comparison-to-zero:
    "real_count != 0" can be simplified to "real_count" as 0 is falsey
    https://github.com/django/django/blob/3b62d8c83e3e48d2ed61cfa32a61c56d9e030293/django/test/testcases.py#L903
  56. use-implicit-booleaness-not-comparison-to-zero:
    "self.port == 0" can be simplified to "not self.port" as 0 is falsey
    https://github.com/django/django/blob/3b62d8c83e3e48d2ed61cfa32a61c56d9e030293/django/test/testcases.py#L1609
  57. use-implicit-booleaness-not-comparison-to-zero:
    "self._content_length == 0" can be simplified to "not self._content_length" as 0 is falsey
    https://github.com/django/django/blob/3b62d8c83e3e48d2ed61cfa32a61c56d9e030293/django/http/multipartparser.py#L145
  58. use-implicit-booleaness-not-comparison-to-zero:
    "remaining != 0" can be simplified to "remaining" as 0 is falsey
    https://github.com/django/django/blob/3b62d8c83e3e48d2ed61cfa32a61c56d9e030293/django/http/multipartparser.py#L308
  59. use-implicit-booleaness-not-comparison-to-zero:
    "remaining != 0" can be simplified to "remaining" as 0 is falsey
    https://github.com/django/django/blob/3b62d8c83e3e48d2ed61cfa32a61c56d9e030293/django/http/multipartparser.py#L452
  60. use-implicit-booleaness-not-comparison-to-zero:
    "s == 0" can be simplified to "not s" as 0 is falsey
    https://github.com/django/django/blob/3b62d8c83e3e48d2ed61cfa32a61c56d9e030293/django/core/signing.py#L67
  61. use-implicit-booleaness-not-comparison-to-zero:
    "self.count == 0" can be simplified to "not self.count" as 0 is falsey
    https://github.com/django/django/blob/3b62d8c83e3e48d2ed61cfa32a61c56d9e030293/django/core/paginator.py#L116
  62. use-implicit-booleaness-not-comparison-to-zero:
    "self.paginator.count == 0" can be simplified to "not self.paginator.count" as 0 is falsey
    https://github.com/django/django/blob/3b62d8c83e3e48d2ed61cfa32a61c56d9e030293/django/core/paginator.py#L226
  63. use-implicit-booleaness-not-comparison-to-zero:
    "len(path_segments) == 0" can be simplified to "not len(path_segments)" as 0 is falsey
    https://github.com/django/django/blob/3b62d8c83e3e48d2ed61cfa32a61c56d9e030293/django/core/files/storage/memory.py#L122
  64. use-implicit-booleaness-not-comparison-to-zero:
    "timeout == 0" can be simplified to "not timeout" as 0 is falsey
    https://github.com/django/django/blob/3b62d8c83e3e48d2ed61cfa32a61c56d9e030293/django/core/cache/backends/base.py#L92
  65. use-implicit-booleaness-not-comparison-to-zero:
    "self._cull_frequency == 0" can be simplified to "not self._cull_frequency" as 0 is falsey
    https://github.com/django/django/blob/3b62d8c83e3e48d2ed61cfa32a61c56d9e030293/django/core/cache/backends/db.py#L257
  66. use-implicit-booleaness-not-comparison-to-zero:
    "int(timeout) == 0" can be simplified to "not int(timeout)" as 0 is falsey
    https://github.com/django/django/blob/3b62d8c83e3e48d2ed61cfa32a61c56d9e030293/django/core/cache/backends/memcached.py#L53
  67. use-implicit-booleaness-not-comparison-to-zero:
    "timeout == 0" can be simplified to "not timeout" as 0 is falsey
    https://github.com/django/django/blob/3b62d8c83e3e48d2ed61cfa32a61c56d9e030293/django/core/cache/backends/memcached.py#L163
  68. use-implicit-booleaness-not-comparison-to-zero:
    "self._cull_frequency == 0" can be simplified to "not self._cull_frequency" as 0 is falsey
    https://github.com/django/django/blob/3b62d8c83e3e48d2ed61cfa32a61c56d9e030293/django/core/cache/backends/locmem.py#L92
  69. use-implicit-booleaness-not-comparison-to-zero:
    "self._cull_frequency == 0" can be simplified to "not self._cull_frequency" as 0 is falsey
    https://github.com/django/django/blob/3b62d8c83e3e48d2ed61cfa32a61c56d9e030293/django/core/cache/backends/filebased.py#L109
  70. use-implicit-booleaness-not-comparison-to-zero:
    "timeout == 0" can be simplified to "not timeout" as 0 is falsey
    https://github.com/django/django/blob/3b62d8c83e3e48d2ed61cfa32a61c56d9e030293/django/core/cache/backends/redis.py#L90
  71. use-implicit-booleaness-not-comparison-to-zero:
    "timeout == 0" can be simplified to "not timeout" as 0 is falsey
    https://github.com/django/django/blob/3b62d8c83e3e48d2ed61cfa32a61c56d9e030293/django/core/cache/backends/redis.py#L105
  72. use-implicit-booleaness-not-comparison-to-zero:
    "visible_issue_count == 0" can be simplified to "not visible_issue_count" as 0 is falsey
    https://github.com/django/django/blob/3b62d8c83e3e48d2ed61cfa32a61c56d9e030293/django/core/management/base.py#L547
  73. use-implicit-booleaness-not-comparison-to-zero:
    "s_opt.nargs != 0" can be simplified to "s_opt.nargs" as 0 is falsey
    https://github.com/django/django/blob/3b62d8c83e3e48d2ed61cfa32a61c56d9e030293/django/core/management/__init__.py#L333
  74. use-implicit-booleaness-not-comparison-to-zero:
    "objects_in_fixture == 0" can be simplified to "not objects_in_fixture" as 0 is falsey
    https://github.com/django/django/blob/3b62d8c83e3e48d2ed61cfa32a61c56d9e030293/django/core/management/commands/loaddata.py#L274
  75. use-implicit-booleaness-not-comparison-to-zero:
    "len(leaf_migration_nodes) == 0" can be simplified to "not len(leaf_migration_nodes)" as 0 is falsey
    https://github.com/django/django/blob/3b62d8c83e3e48d2ed61cfa32a61c56d9e030293/django/core/management/commands/makemigrations.py#L268
  76. use-implicit-booleaness-not-comparison-to-zero:
    "i == 0" can be simplified to "not i" as 0 is falsey
    https://github.com/django/django/blob/3b62d8c83e3e48d2ed61cfa32a61c56d9e030293/django/core/management/commands/compilemessages.py#L174
  77. use-implicit-booleaness-not-comparison-to-string:
    "lookup_value == ''" can be simplified to "not lookup_value" as an empty string is falsey
    https://github.com/django/django/blob/3b62d8c83e3e48d2ed61cfa32a61c56d9e030293/django/db/models/base.py#L1314
  78. use-implicit-booleaness-not-comparison-to-zero:
    "self.start.value == 0" can be simplified to "not self.start.value" as 0 is falsey
    https://github.com/django/django/blob/3b62d8c83e3e48d2ed61cfa32a61c56d9e030293/django/db/models/expressions.py#L1820
  79. use-implicit-booleaness-not-comparison-to-zero:
    "self.end.value == 0" can be simplified to "not self.end.value" as 0 is falsey
    https://github.com/django/django/blob/3b62d8c83e3e48d2ed61cfa32a61c56d9e030293/django/db/models/expressions.py#L1827
  80. use-implicit-booleaness-not-comparison-to-string:
    "lookup_value == ''" can be simplified to "not lookup_value" as an empty string is falsey
    https://github.com/django/django/blob/3b62d8c83e3e48d2ed61cfa32a61c56d9e030293/django/db/models/constraints.py#L385
  81. use-implicit-booleaness-not-comparison-to-string:
    "val == ''" can be simplified to "not val" as an empty string is falsey
    https://github.com/django/django/blob/3b62d8c83e3e48d2ed61cfa32a61c56d9e030293/django/db/models/fields/related_descriptors.py#L680
  82. use-implicit-booleaness-not-comparison-to-string:
    "self.path != ''" can be simplified to "self.path" as an empty string is falsey
    https://github.com/django/django/blob/3b62d8c83e3e48d2ed61cfa32a61c56d9e030293/django/db/models/fields/__init__.py#L1913
  83. use-implicit-booleaness-not-comparison-to-string:
    *"default == ''" can be simplified to "n...

This comment was truncated because GitHub allows only 65536 characters in a comment.

This comment was generated for commit 616a234

@Pierre-Sassoulas Pierre-Sassoulas merged commit be15ae4 into pylint-dev:main May 3, 2023
@Pierre-Sassoulas Pierre-Sassoulas deleted the merge-compare-to-falsey branch May 3, 2023 20:01
@jacobtylerwalls jacobtylerwalls removed their request for review May 3, 2023 22:43
@Pierre-Sassoulas Pierre-Sassoulas modified the milestones: 3.0.0b1, 3.0.0a7 May 6, 2023
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Documentation πŸ“— Maintenance Discussion or action around maintaining pylint or the dev workflow
Projects
None yet
3 participants