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

Warn on incomplete concrete classes that inherit from abstract classes #7955

Open
wants to merge 20 commits into
base: main
Choose a base branch
from

Conversation

sshane
Copy link

@sshane sshane commented Dec 17, 2022

Fixes: #7950

TODO:

  • Update test refs
  • Make it detect the root abc module correctly

@Pierre-Sassoulas Pierre-Sassoulas added the False Negative 🦋 No message is emitted but something is wrong with the code label Dec 17, 2022
@Pierre-Sassoulas Pierre-Sassoulas modified the milestones: 2.16.0, 2.17.0 Dec 17, 2022
@sshane sshane changed the title Warn on concrete classes that inherit from abstract classes Warn on incomplete concrete classes that inherit from abstract classes Dec 17, 2022
@github-actions

This comment has been minimized.

pylint/checkers/utils.py Outdated Show resolved Hide resolved
@github-actions

This comment has been minimized.

@github-actions

This comment has been minimized.

@sshane
Copy link
Author

sshane commented Jan 1, 2023

Updated the test refs, but I'm not sure they're right. I'm getting lots of diffs for a lot of tests. Running pylint built from main on Windows 11 (astroid-2.12.13 pylint-2.16.0.dev0).

It appears I'm getting the correct output with Ubuntu 20.04, but python test_functional.py --update-functional-output is not writing any changes even though this test fails still. 🤔

@sshane sshane marked this pull request as ready for review January 1, 2023 01:20
@sshane
Copy link
Author

sshane commented Jan 1, 2023

Should be good now, let me know if there's any issues @DanielNoord! I had to add a print into the tester to get the results :/

@github-actions
Copy link
Contributor

github-actions bot commented Jan 1, 2023

🤖 Effect of this PR on checked open source code: 🤖

Effect on pandas:
The following messages are now emitted:

  1. abstract-method:
    Method 'read_table' is abstract in class 'PandasSQL' but is not overridden in child class 'SQLiteDatabase'
    https://github.com/pandas-dev/pandas/blob/d859ecc1b0e386a66a5e0650609a9e3154fa474c/pandas/io/sql.py#L2123
  2. abstract-method:
    Method 'bottom_separator' is abstract in class 'TableBuilderAbstract' but is not overridden in child class 'GenericTableBuilder'
    https://github.com/pandas-dev/pandas/blob/d859ecc1b0e386a66a5e0650609a9e3154fa474c/pandas/io/formats/latex.py#L403
  3. abstract-method:
    Method 'env_begin' is abstract in class 'TableBuilderAbstract' but is not overridden in child class 'GenericTableBuilder'
    https://github.com/pandas-dev/pandas/blob/d859ecc1b0e386a66a5e0650609a9e3154fa474c/pandas/io/formats/latex.py#L403
  4. abstract-method:
    Method 'env_end' is abstract in class 'TableBuilderAbstract' but is not overridden in child class 'GenericTableBuilder'
    https://github.com/pandas-dev/pandas/blob/d859ecc1b0e386a66a5e0650609a9e3154fa474c/pandas/io/formats/latex.py#L403
  5. abstract-method:
    Method 'reshape' is abstract in class 'ArrowExtensionArray' but is not overridden in child class 'ArrowStringArray'
    https://github.com/pandas-dev/pandas/blob/d859ecc1b0e386a66a5e0650609a9e3154fa474c/pandas/core/arrays/string_arrow.py#L61
  6. abstract-method:
    Method '_accumulate' is abstract in class 'ExtensionArray' but is not overridden in child class 'StringArray'
    https://github.com/pandas-dev/pandas/blob/d859ecc1b0e386a66a5e0650609a9e3154fa474c/pandas/core/arrays/string_.py#L225
  7. abstract-method:
    Method '_accumulate' is abstract in class 'ExtensionArray' but is not overridden in child class 'Categorical'
    https://github.com/pandas-dev/pandas/blob/d859ecc1b0e386a66a5e0650609a9e3154fa474c/pandas/core/arrays/categorical.py#L246
  8. abstract-method:
    Method '_accumulate' is abstract in class 'ExtensionArray' but is not overridden in child class 'PandasArray'
    https://github.com/pandas-dev/pandas/blob/d859ecc1b0e386a66a5e0650609a9e3154fa474c/pandas/core/arrays/numpy_.py#L34
  9. abstract-method:
    Method '_accumulate' is abstract in class 'ExtensionArray' but is not overridden in child class 'SubclassedCategorical'
    https://github.com/pandas-dev/pandas/blob/d859ecc1b0e386a66a5e0650609a9e3154fa474c/pandas/_testing/__init__.py#L815
  10. abstract-method:
    Method '_accumulate' is abstract in class 'ExtensionArray' but is not overridden in child class 'CapturingStringArray'
    https://github.com/pandas-dev/pandas/blob/d859ecc1b0e386a66a5e0650609a9e3154fa474c/pandas/tests/extension/base/getitem.py#L473

Effect on psycopg:
The following messages are now emitted:

  1. abstract-method:
    Method 'dump' is abstract in class 'Dumper' but is not overridden in child class 'RecursiveDumper'
    https://github.com/psycopg/psycopg/blob/1434fd42141214f6bfe73bf388bad8feb6bed672/psycopg/psycopg/adapt.py#L149
  2. abstract-method:
    Method 'load' is abstract in class 'Loader' but is not overridden in child class 'RecursiveLoader'
    https://github.com/psycopg/psycopg/blob/1434fd42141214f6bfe73bf388bad8feb6bed672/psycopg/psycopg/adapt.py#L157
  3. abstract-method:
    Method 'dump' is abstract in class 'NoneDumper' but is not overridden in child class 'CrdbNoneDumper'
    https://github.com/psycopg/psycopg/blob/1434fd42141214f6bfe73bf388bad8feb6bed672/psycopg/psycopg/crdb/_types.py#L30
  4. abstract-method:
    Method 'dump' is abstract in class 'Dumper' but is not overridden in child class 'BaseRangeDumper'
    https://github.com/psycopg/psycopg/blob/1434fd42141214f6bfe73bf388bad8feb6bed672/psycopg/psycopg/types/range.py#L248
  5. abstract-method:
    Method 'load' is abstract in class 'Loader' but is not overridden in child class 'BaseRangeLoader'
    https://github.com/psycopg/psycopg/blob/1434fd42141214f6bfe73bf388bad8feb6bed672/psycopg/psycopg/types/range.py#L408
  6. abstract-method:
    Method 'dump' is abstract in class 'Dumper' but is not overridden in child class 'SequenceDumper'
    https://github.com/psycopg/psycopg/blob/1434fd42141214f6bfe73bf388bad8feb6bed672/psycopg/psycopg/types/composite.py#L29
  7. abstract-method:
    Method 'load' is abstract in class 'Loader' but is not overridden in child class 'BaseCompositeLoader'
    https://github.com/psycopg/psycopg/blob/1434fd42141214f6bfe73bf388bad8feb6bed672/psycopg/psycopg/types/composite.py#L98
  8. abstract-method:
    Method 'upgrade' is abstract in class '_BaseTimeDumper' but is not overridden in child class '_BaseTimeTextDumper'
    https://github.com/psycopg/psycopg/blob/1434fd42141214f6bfe73bf388bad8feb6bed672/psycopg/psycopg/types/datetime.py#L73
  9. abstract-method:
    Method 'upgrade' is abstract in class '_BaseTimeDumper' but is not overridden in child class 'TimeTzDumper'
    https://github.com/psycopg/psycopg/blob/1434fd42141214f6bfe73bf388bad8feb6bed672/psycopg/psycopg/types/datetime.py#L89
  10. abstract-method:
    Method 'upgrade' is abstract in class '_BaseTimeDumper' but is not overridden in child class 'TimeTzBinaryDumper'
    https://github.com/psycopg/psycopg/blob/1434fd42141214f6bfe73bf388bad8feb6bed672/psycopg/psycopg/types/datetime.py#L112
  11. abstract-method:
    Method 'upgrade' is abstract in class '_BaseDatetimeDumper' but is not overridden in child class '_BaseDatetimeTextDumper'
    https://github.com/psycopg/psycopg/blob/1434fd42141214f6bfe73bf388bad8feb6bed672/psycopg/psycopg/types/datetime.py#L139
  12. abstract-method:
    Method 'upgrade' is abstract in class '_BaseDatetimeDumper' but is not overridden in child class 'DatetimeNoTzDumper'
    https://github.com/psycopg/psycopg/blob/1434fd42141214f6bfe73bf388bad8feb6bed672/psycopg/psycopg/types/datetime.py#L157
  13. abstract-method:
    Method 'upgrade' is abstract in class '_BaseDatetimeDumper' but is not overridden in child class 'DatetimeNoTzBinaryDumper'
    https://github.com/psycopg/psycopg/blob/1434fd42141214f6bfe73bf388bad8feb6bed672/psycopg/psycopg/types/datetime.py#L179
  14. abstract-method:
    Method 'dump' is abstract in class 'Dumper' but is not overridden in child class '_AIBinaryDumper'
    https://github.com/psycopg/psycopg/blob/1434fd42141214f6bfe73bf388bad8feb6bed672/psycopg/psycopg/types/net.py#L68
  15. abstract-method:
    Method 'load' is abstract in class 'Loader' but is not overridden in child class '_LazyIpaddressLoader'
    https://github.com/psycopg/psycopg/blob/1434fd42141214f6bfe73bf388bad8feb6bed672/psycopg/psycopg/types/net.py#L123
  16. abstract-method:
    Method 'dump' is abstract in class 'Dumper' but is not overridden in child class '_BaseStrDumper'
    https://github.com/psycopg/psycopg/blob/1434fd42141214f6bfe73bf388bad8feb6bed672/psycopg/psycopg/types/string.py#L20
  17. abstract-method:
    Method 'dump' is abstract in class 'Dumper' but is not overridden in child class 'BaseMultirangeDumper'
    https://github.com/psycopg/psycopg/blob/1434fd42141214f6bfe73bf388bad8feb6bed672/psycopg/psycopg/types/multirange.py#L143
  18. abstract-method:
    Method 'load' is abstract in class 'Loader' but is not overridden in child class 'BaseMultirangeLoader'
    https://github.com/psycopg/psycopg/blob/1434fd42141214f6bfe73bf388bad8feb6bed672/psycopg/psycopg/types/multirange.py#L254
  19. abstract-method:
    Method 'dump' is abstract in class 'Dumper' but is not overridden in child class 'BaseListDumper'
    https://github.com/psycopg/psycopg/blob/1434fd42141214f6bfe73bf388bad8feb6bed672/psycopg/psycopg/types/array.py#L35

Effect on sentry:
The following messages are now emitted:

  1. abstract-method:
    Method 'passes_activity' is abstract in class 'RuleBase' but is not overridden in child class 'AzureDevopsCreateTicketAction'
    https://github.com/getsentry/sentry/blob/77f33b1fdceeae6c4ebb96cc099d010a1d94d5da/src/sentry/integrations/vsts/actions/create_ticket.py#L9
  2. abstract-method:
    Method 'passes_activity' is abstract in class 'RuleBase' but is not overridden in child class 'MsTeamsNotifyServiceAction'
    https://github.com/getsentry/sentry/blob/77f33b1fdceeae6c4ebb96cc099d010a1d94d5da/src/sentry/integrations/msteams/actions/notification.py#L14
  3. abstract-method:
    Method 'passes_activity' is abstract in class 'RuleBase' but is not overridden in child class 'SlackNotifyServiceAction'
    https://github.com/getsentry/sentry/blob/77f33b1fdceeae6c4ebb96cc099d010a1d94d5da/src/sentry/integrations/slack/actions/notification.py#L20
  4. abstract-method:
    Method 'passes_activity' is abstract in class 'RuleBase' but is not overridden in child class 'PagerDutyNotifyServiceAction'
    https://github.com/getsentry/sentry/blob/77f33b1fdceeae6c4ebb96cc099d010a1d94d5da/src/sentry/integrations/pagerduty/actions/notification.py#L13
  5. abstract-method:
    Method 'passes_activity' is abstract in class 'RuleBase' but is not overridden in child class 'JiraCreateTicketAction'
    https://github.com/getsentry/sentry/blob/77f33b1fdceeae6c4ebb96cc099d010a1d94d5da/src/sentry/integrations/jira/actions/create_ticket.py#L11
  6. abstract-method:
    Method 'get_activity' is abstract in class 'EventCondition' but is not overridden in child class 'EventFrequencyCondition'
    https://github.com/getsentry/sentry/blob/77f33b1fdceeae6c4ebb96cc099d010a1d94d5da/src/sentry/rules/conditions/event_frequency.py#L223
  7. abstract-method:
    Method 'passes_activity' is abstract in class 'RuleBase' but is not overridden in child class 'EventFrequencyCondition'
    https://github.com/getsentry/sentry/blob/77f33b1fdceeae6c4ebb96cc099d010a1d94d5da/src/sentry/rules/conditions/event_frequency.py#L223
  8. abstract-method:
    Method 'get_activity' is abstract in class 'EventCondition' but is not overridden in child class 'EventUniqueUserFrequencyCondition'
    https://github.com/getsentry/sentry/blob/77f33b1fdceeae6c4ebb96cc099d010a1d94d5da/src/sentry/rules/conditions/event_frequency.py#L245
  9. abstract-method:
    Method 'passes_activity' is abstract in class 'RuleBase' but is not overridden in child class 'EventUniqueUserFrequencyCondition'
    https://github.com/getsentry/sentry/blob/77f33b1fdceeae6c4ebb96cc099d010a1d94d5da/src/sentry/rules/conditions/event_frequency.py#L245
  10. abstract-method:
    Method 'get_activity' is abstract in class 'EventCondition' but is not overridden in child class 'LevelCondition'
    https://github.com/getsentry/sentry/blob/77f33b1fdceeae6c4ebb96cc099d010a1d94d5da/src/sentry/rules/conditions/level.py#L26
  11. abstract-method:
    Method 'passes_activity' is abstract in class 'RuleBase' but is not overridden in child class 'RegressionEventCondition'
    https://github.com/getsentry/sentry/blob/77f33b1fdceeae6c4ebb96cc099d010a1d94d5da/src/sentry/rules/conditions/regression_event.py#L12
  12. abstract-method:
    Method 'get_activity' is abstract in class 'EventCondition' but is not overridden in child class 'TaggedEventCondition'
    https://github.com/getsentry/sentry/blob/77f33b1fdceeae6c4ebb96cc099d010a1d94d5da/src/sentry/rules/conditions/tagged_event.py#L34
  13. abstract-method:
    Method 'passes_activity' is abstract in class 'RuleBase' but is not overridden in child class 'FirstSeenEventCondition'
    https://github.com/getsentry/sentry/blob/77f33b1fdceeae6c4ebb96cc099d010a1d94d5da/src/sentry/rules/conditions/first_seen_event.py#L11
  14. abstract-method:
    Method 'get_activity' is abstract in class 'EventCondition' but is not overridden in child class 'EveryEventCondition'
    https://github.com/getsentry/sentry/blob/77f33b1fdceeae6c4ebb96cc099d010a1d94d5da/src/sentry/rules/conditions/every_event.py#L6
  15. abstract-method:
    Method 'passes_activity' is abstract in class 'RuleBase' but is not overridden in child class 'EveryEventCondition'
    https://github.com/getsentry/sentry/blob/77f33b1fdceeae6c4ebb96cc099d010a1d94d5da/src/sentry/rules/conditions/every_event.py#L6
  16. abstract-method:
    Method 'passes_activity' is abstract in class 'RuleBase' but is not overridden in child class 'ReappearedEventCondition'
    https://github.com/getsentry/sentry/blob/77f33b1fdceeae6c4ebb96cc099d010a1d94d5da/src/sentry/rules/conditions/reappeared_event.py#L12
  17. abstract-method:
    Method 'get_activity' is abstract in class 'EventCondition' but is not overridden in child class 'EventAttributeCondition'
    https://github.com/getsentry/sentry/blob/77f33b1fdceeae6c4ebb96cc099d010a1d94d5da/src/sentry/rules/conditions/event_attribute.py#L45
  18. abstract-method:
    Method 'get_activity' is abstract in class 'EventCondition' but is not overridden in child class 'ActiveReleaseEventCondition'
    https://github.com/getsentry/sentry/blob/77f33b1fdceeae6c4ebb96cc099d010a1d94d5da/src/sentry/rules/conditions/active_release.py#L13
  19. abstract-method:
    Method 'passes_activity' is abstract in class 'RuleBase' but is not overridden in child class 'ActiveReleaseEventCondition'
    https://github.com/getsentry/sentry/blob/77f33b1fdceeae6c4ebb96cc099d010a1d94d5da/src/sentry/rules/conditions/active_release.py#L13
  20. abstract-method:
    Method 'passes_activity' is abstract in class 'RuleBase' but is not overridden in child class 'NotifyEventAction'
    https://github.com/getsentry/sentry/blob/77f33b1fdceeae6c4ebb96cc099d010a1d94d5da/src/sentry/rules/actions/notify_event.py#L13
  21. abstract-method:
    Method 'passes_activity' is abstract in class 'RuleBase' but is not overridden in child class 'NotifyEventServiceAction'
    https://github.com/getsentry/sentry/blob/77f33b1fdceeae6c4ebb96cc099d010a1d94d5da/src/sentry/rules/actions/notify_event_service.py#L152
  22. abstract-method:
    Method 'passes_activity' is abstract in class 'RuleBase' but is not overridden in child class 'NotifyEventSentryAppAction'
    https://github.com/getsentry/sentry/blob/77f33b1fdceeae6c4ebb96cc099d010a1d94d5da/src/sentry/rules/actions/sentry_apps/notify_event.py#L32
  23. abstract-method:
    Method 'get_activity' is abstract in class 'EventCondition' but is not overridden in child class 'LevelFilter'
    https://github.com/getsentry/sentry/blob/77f33b1fdceeae6c4ebb96cc099d010a1d94d5da/src/sentry/rules/filters/level.py#L4
  24. abstract-method:
    Method 'passes_activity' is abstract in class 'RuleBase' but is not overridden in child class 'LatestReleaseFilter'
    https://github.com/getsentry/sentry/blob/77f33b1fdceeae6c4ebb96cc099d010a1d94d5da/src/sentry/rules/filters/latest_release.py#L49
  25. abstract-method:
    Method 'passes_activity' is abstract in class 'RuleBase' but is not overridden in child class 'AssignedToFilter'
    https://github.com/getsentry/sentry/blob/77f33b1fdceeae6c4ebb96cc099d010a1d94d5da/src/sentry/rules/filters/assigned_to.py#L18
  26. abstract-method:
    Method 'get_activity' is abstract in class 'EventCondition' but is not overridden in child class 'TaggedEventFilter'
    https://github.com/getsentry/sentry/blob/77f33b1fdceeae6c4ebb96cc099d010a1d94d5da/src/sentry/rules/filters/tagged_event.py#L4
  27. abstract-method:
    Method 'get_activity' is abstract in class 'EventCondition' but is not overridden in child class 'EventAttributeFilter'
    https://github.com/getsentry/sentry/blob/77f33b1fdceeae6c4ebb96cc099d010a1d94d5da/src/sentry/rules/filters/event_attribute.py#L4
  28. abstract-method:
    Method 'has_project_access' is abstract in class 'Access' but is not overridden in child class 'DbAccess'
    https://github.com/getsentry/sentry/blob/77f33b1fdceeae6c4ebb96cc099d010a1d94d5da/src/sentry/auth/access.py#L182
  29. abstract-method:
    Method 'has_team_access' is abstract in class 'Access' but is not overridden in child class 'DbAccess'
    https://github.com/getsentry/sentry/blob/77f33b1fdceeae6c4ebb96cc099d010a1d94d5da/src/sentry/auth/access.py#L182
  30. abstract-method:
    Method 'stored_problems' is abstract in class 'PerformanceDetector' but is not overridden in child class 'SlowSpanDetector'
    https://github.com/getsentry/sentry/blob/77f33b1fdceeae6c4ebb96cc099d010a1d94d5da/src/sentry/utils/performance_issues/performance_detection.py#L564
  31. abstract-method:
    Method 'stored_problems' is abstract in class 'PerformanceDetector' but is not overridden in child class 'RenderBlockingAssetSpanDetector'
    https://github.com/getsentry/sentry/blob/77f33b1fdceeae6c4ebb96cc099d010a1d94d5da/src/sentry/utils/performance_issues/performance_detection.py#L605
  32. abstract-method:
    Method 'stored_problems' is abstract in class 'PerformanceDetector' but is not overridden in child class 'NPlusOneAPICallsDetector'
    https://github.com/getsentry/sentry/blob/77f33b1fdceeae6c4ebb96cc099d010a1d94d5da/src/sentry/utils/performance_issues/performance_detection.py#L672
  33. abstract-method:
    Method 'stored_problems' is abstract in class 'PerformanceDetector' but is not overridden in child class 'ConsecutiveDBSpanDetector'
    https://github.com/getsentry/sentry/blob/77f33b1fdceeae6c4ebb96cc099d010a1d94d5da/src/sentry/utils/performance_issues/performance_detection.py#L828
  34. abstract-method:
    Method 'stored_problems' is abstract in class 'PerformanceDetector' but is not overridden in child class 'NPlusOneDBSpanDetector'
    https://github.com/getsentry/sentry/blob/77f33b1fdceeae6c4ebb96cc099d010a1d94d5da/src/sentry/utils/performance_issues/performance_detection.py#L957
  35. abstract-method:
    Method 'stored_problems' is abstract in class 'PerformanceDetector' but is not overridden in child class 'NPlusOneDBSpanDetectorExtended'
    https://github.com/getsentry/sentry/blob/77f33b1fdceeae6c4ebb96cc099d010a1d94d5da/src/sentry/utils/performance_issues/performance_detection.py#L1173
  36. abstract-method:
    Method 'stored_problems' is abstract in class 'PerformanceDetector' but is not overridden in child class 'FileIOMainThreadDetector'
    https://github.com/getsentry/sentry/blob/77f33b1fdceeae6c4ebb96cc099d010a1d94d5da/src/sentry/utils/performance_issues/performance_detection.py#L1188
  37. abstract-method:
    Method 'stored_problems' is abstract in class 'PerformanceDetector' but is not overridden in child class 'MNPlusOneDBSpanDetector'
    https://github.com/getsentry/sentry/blob/77f33b1fdceeae6c4ebb96cc099d010a1d94d5da/src/sentry/utils/performance_issues/performance_detection.py#L1462
  38. abstract-method:
    Method 'build_attachment_title' is abstract in class 'BaseNotification' but is not overridden in child class 'UserReportNotification'
    https://github.com/getsentry/sentry/blob/77f33b1fdceeae6c4ebb96cc099d010a1d94d5da/src/sentry/notifications/notifications/user_report.py#L23
  39. abstract-method:
    Method 'determine_recipients' is abstract in class 'BaseNotification' but is not overridden in child class 'UserReportNotification'
    https://github.com/getsentry/sentry/blob/77f33b1fdceeae6c4ebb96cc099d010a1d94d5da/src/sentry/notifications/notifications/user_report.py#L23
  40. abstract-method:
    Method 'get_title_link' is abstract in class 'BaseNotification' but is not overridden in child class 'UserReportNotification'
    https://github.com/getsentry/sentry/blob/77f33b1fdceeae6c4ebb96cc099d010a1d94d5da/src/sentry/notifications/notifications/user_report.py#L23
  41. abstract-method:
    Method 'determine_recipients' is abstract in class 'BaseNotification' but is not overridden in child class 'IntegrationNudgeNotification'
    https://github.com/getsentry/sentry/blob/77f33b1fdceeae6c4ebb96cc099d010a1d94d5da/src/sentry/notifications/notifications/integration_nudge.py#L44
  42. abstract-method:
    Method 'determine_recipients' is abstract in class 'BaseNotification' but is not overridden in child class 'DigestNotification'
    https://github.com/getsentry/sentry/blob/77f33b1fdceeae6c4ebb96cc099d010a1d94d5da/src/sentry/notifications/notifications/digest.py#L41
  43. abstract-method:
    Method 'build_attachment_title' is abstract in class 'BaseNotification' but is not overridden in child class 'AlertRuleNotification'
    https://github.com/getsentry/sentry/blob/77f33b1fdceeae6c4ebb96cc099d010a1d94d5da/src/sentry/notifications/notifications/rules.py#L38
  44. abstract-method:
    Method 'determine_recipients' is abstract in class 'BaseNotification' but is not overridden in child class 'AlertRuleNotification'
    https://github.com/getsentry/sentry/blob/77f33b1fdceeae6c4ebb96cc099d010a1d94d5da/src/sentry/notifications/notifications/rules.py#L38
  45. abstract-method:
    Method 'get_title_link' is abstract in class 'BaseNotification' but is not overridden in child class 'AlertRuleNotification'
    https://github.com/getsentry/sentry/blob/77f33b1fdceeae6c4ebb96cc099d010a1d94d5da/src/sentry/notifications/notifications/rules.py#L38
  46. abstract-method:
    Method 'build_attachment_title' is abstract in class 'BaseNotification' but is not overridden in child class 'AutoSyncNotification'
    https://github.com/getsentry/sentry/blob/77f33b1fdceeae6c4ebb96cc099d010a1d94d5da/src/sentry/notifications/notifications/codeowners_auto_sync.py#L17
  47. abstract-method:
    Method 'get_notification_title' is abstract in class 'BaseNotification' but is not overridden in child class 'AutoSyncNotification'
    https://github.com/getsentry/sentry/blob/77f33b1fdceeae6c4ebb96cc099d010a1d94d5da/src/sentry/notifications/notifications/codeowners_auto_sync.py#L17
  48. abstract-method:
    Method 'get_title_link' is abstract in class 'BaseNotification' but is not overridden in child class 'AutoSyncNotification'
    https://github.com/getsentry/sentry/blob/77f33b1fdceeae6c4ebb96cc099d010a1d94d5da/src/sentry/notifications/notifications/codeowners_auto_sync.py#L17
  49. abstract-method:
    Method 'build_attachment_title' is abstract in class 'BaseNotification' but is not overridden in child class 'ActiveReleaseIssueNotification'
    https://github.com/getsentry/sentry/blob/77f33b1fdceeae6c4ebb96cc099d010a1d94d5da/src/sentry/notifications/notifications/active_release.py#L33
  50. abstract-method:
    Method 'determine_recipients' is abstract in class 'BaseNotification' but is not overridden in child class 'ActiveReleaseIssueNotification'
    https://github.com/getsentry/sentry/blob/77f33b1fdceeae6c4ebb96cc099d010a1d94d5da/src/sentry/notifications/notifications/active_release.py#L33
  51. abstract-method:
    Method 'get_title_link' is abstract in class 'BaseNotification' but is not overridden in child class 'ActiveReleaseIssueNotification'
    https://github.com/getsentry/sentry/blob/77f33b1fdceeae6c4ebb96cc099d010a1d94d5da/src/sentry/notifications/notifications/active_release.py#L33
  52. abstract-method:
    Method 'determine_recipients' is abstract in class 'BaseNotification' but is not overridden in child class 'NewProcessingIssuesActivityNotification'
    https://github.com/getsentry/sentry/blob/77f33b1fdceeae6c4ebb96cc099d010a1d94d5da/src/sentry/notifications/notifications/activity/new_processing_issues.py#L14
  53. abstract-method:
    Method 'determine_recipients' is abstract in class 'BaseNotification' but is not overridden in child class 'ResolvedActivityNotification'
    https://github.com/getsentry/sentry/blob/77f33b1fdceeae6c4ebb96cc099d010a1d94d5da/src/sentry/notifications/notifications/activity/resolved.py#L8
  54. abstract-method:
    Method 'determine_recipients' is abstract in class 'BaseNotification' but is not overridden in child class 'UnassignedActivityNotification'
    https://github.com/getsentry/sentry/blob/77f33b1fdceeae6c4ebb96cc099d010a1d94d5da/src/sentry/notifications/notifications/activity/unassigned.py#L10
  55. abstract-method:
    Method 'determine_recipients' is abstract in class 'BaseNotification' but is not overridden in child class 'ReleaseActivityNotification'
    https://github.com/getsentry/sentry/blob/77f33b1fdceeae6c4ebb96cc099d010a1d94d5da/src/sentry/notifications/notifications/activity/release.py#L33
  56. abstract-method:
    Method 'determine_recipients' is abstract in class 'BaseNotification' but is not overridden in child class 'AssignedActivityNotification'
    https://github.com/getsentry/sentry/blob/77f33b1fdceeae6c4ebb96cc099d010a1d94d5da/src/sentry/notifications/notifications/activity/assigned.py#L55
  57. abstract-method:
    Method 'determine_recipients' is abstract in class 'BaseNotification' but is not overridden in child class 'ReleaseSummaryActivityNotification'
    https://github.com/getsentry/sentry/blob/77f33b1fdceeae6c4ebb96cc099d010a1d94d5da/src/sentry/notifications/notifications/activity/release_summary.py#L34
  58. abstract-method:
    Method 'determine_recipients' is abstract in class 'BaseNotification' but is not overridden in child class 'ResolvedInReleaseActivityNotification'
    https://github.com/getsentry/sentry/blob/77f33b1fdceeae6c4ebb96cc099d010a1d94d5da/src/sentry/notifications/notifications/activity/resolved_in_release.py#L12
  59. abstract-method:
    Method 'determine_recipients' is abstract in class 'BaseNotification' but is not overridden in child class 'NoteActivityNotification'
    https://github.com/getsentry/sentry/blob/77f33b1fdceeae6c4ebb96cc099d010a1d94d5da/src/sentry/notifications/notifications/activity/note.py#L13
  60. abstract-method:
    Method 'determine_recipients' is abstract in class 'BaseNotification' but is not overridden in child class 'RegressionActivityNotification'
    https://github.com/getsentry/sentry/blob/77f33b1fdceeae6c4ebb96cc099d010a1d94d5da/src/sentry/notifications/notifications/activity/regression.py#L15
  61. abstract-method:
    Method 'get_oauth_refresh_token_url' is abstract in class 'OAuth2Provider' but is not overridden in child class 'GoogleIdentityProvider'
    https://github.com/getsentry/sentry/blob/77f33b1fdceeae6c4ebb96cc099d010a1d94d5da/src/sentry/identity/google/provider.py#L15
  62. abstract-method:
    Method 'get_oauth_refresh_token_url' is abstract in class 'OAuth2Provider' but is not overridden in child class 'VstsExtensionIdentityProvider'
    https://github.com/getsentry/sentry/blob/77f33b1fdceeae6c4ebb96cc099d010a1d94d5da/src/sentry/identity/vsts_extension/provider.py#L4
  63. abstract-method:
    Method 'get_oauth_refresh_token_url' is abstract in class 'OAuth2Provider' but is not overridden in child class 'VSTSIdentityProvider'
    https://github.com/getsentry/sentry/blob/77f33b1fdceeae6c4ebb96cc099d010a1d94d5da/src/sentry/identity/vsts/provider.py#L39
  64. abstract-method:
    Method 'get_oauth_refresh_token_url' is abstract in class 'OAuth2Provider' but is not overridden in child class 'GitHubEnterpriseIdentityProvider'
    https://github.com/getsentry/sentry/blob/77f33b1fdceeae6c4ebb96cc099d010a1d94d5da/src/sentry/identity/github_enterprise/provider.py#L21
  65. abstract-method:
    Method 'get_oauth_refresh_token_url' is abstract in class 'OAuth2Provider' but is not overridden in child class 'SlackIdentityProvider'
    https://github.com/getsentry/sentry/blob/77f33b1fdceeae6c4ebb96cc099d010a1d94d5da/src/sentry/identity/slack/provider.py#L5
  66. abstract-method:
    Method 'build_identity' is abstract in class 'Provider' but is not overridden in child class 'VercelIdentityProvider'
    https://github.com/getsentry/sentry/blob/77f33b1fdceeae6c4ebb96cc099d010a1d94d5da/src/sentry/identity/vercel/provider.py#L5
  67. abstract-method:
    Method 'get_oauth_refresh_token_url' is abstract in class 'OAuth2Provider' but is not overridden in child class 'VercelIdentityProvider'
    https://github.com/getsentry/sentry/blob/77f33b1fdceeae6c4ebb96cc099d010a1d94d5da/src/sentry/identity/vercel/provider.py#L5
  68. abstract-method:
    Method 'get_oauth_refresh_token_url' is abstract in class 'OAuth2Provider' but is not overridden in child class 'GitHubIdentityProvider'
    https://github.com/getsentry/sentry/blob/77f33b1fdceeae6c4ebb96cc099d010a1d94d5da/src/sentry/identity/github/provider.py#L26
  69. abstract-method:
    Method 'build_identity' is abstract in class 'Provider' but is not overridden in child class 'BitbucketIdentityProvider'
    https://github.com/getsentry/sentry/blob/77f33b1fdceeae6c4ebb96cc099d010a1d94d5da/src/sentry/identity/bitbucket/provider.py#L6
  70. abstract-method:
    Method 'refresh_identity' is abstract in class 'Provider' but is not overridden in child class 'BitbucketIdentityProvider'
    https://github.com/getsentry/sentry/blob/77f33b1fdceeae6c4ebb96cc099d010a1d94d5da/src/sentry/identity/bitbucket/provider.py#L6
  71. abstract-method:
    Method 'get_oauth_refresh_token_url' is abstract in class 'OAuth2Provider' but is not overridden in child class 'GitlabIdentityProvider'
    https://github.com/getsentry/sentry/blob/77f33b1fdceeae6c4ebb96cc099d010a1d94d5da/src/sentry/identity/gitlab/provider.py#L58
  72. abstract-method:
    Method 'defer' is abstract in class 'BaseQuerySet' but is not overridden in child class 'ReleaseQuerySet'
    https://github.com/getsentry/sentry/blob/77f33b1fdceeae6c4ebb96cc099d010a1d94d5da/src/sentry/models/release.py#L161
  73. abstract-method:
    Method 'only' is abstract in class 'BaseQuerySet' but is not overridden in child class 'ReleaseQuerySet'
    https://github.com/getsentry/sentry/blob/77f33b1fdceeae6c4ebb96cc099d010a1d94d5da/src/sentry/models/release.py#L161
  74. abstract-method:
    Method 'get_snql_aggregations' is abstract in class 'BaseMetricsEntitySubscription' but is not overridden in child class 'BaseCrashRateMetricsEntitySubscription'
    https://github.com/getsentry/sentry/blob/77f33b1fdceeae6c4ebb96cc099d010a1d94d5da/src/sentry/snuba/entity_subscription.py#L389
  75. abstract-method:
    Method 'passes_activity' is abstract in class 'RuleBase' but is not overridden in child class 'NotifyEmailAction'
    https://github.com/getsentry/sentry/blob/77f33b1fdceeae6c4ebb96cc099d010a1d94d5da/src/sentry/mail/actions.py#L20
  76. abstract-method:
    Method 'passes_activity' is abstract in class 'RuleBase' but is not overridden in child class 'NotifyActiveReleaseEmailAction'
    https://github.com/getsentry/sentry/blob/77f33b1fdceeae6c4ebb96cc099d010a1d94d5da/src/sentry/mail/actions.py#L85

This comment was generated for commit afd9500

Comment on lines +1180 to +1181
and inferred_base.root().name in ABC_MODULES
and inferred_base.name == "ABC"
Copy link
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Suggested change
and inferred_base.root().name in ABC_MODULES
and inferred_base.name == "ABC"
and inferred_base.root().name in ABC_MODULES
and inferred_base.name == "ABC"

I think this works fine. Note that you could also call .qname() for a similar result.

Copy link
Author

@sshane sshane Jan 4, 2023

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Yes, but do we not care about checking all the modules in ABC_MODULES to preserve behavior? You suggested no change btw

@sshane
Copy link
Author

sshane commented Jan 11, 2023

@DanielNoord is there anything else needing to be done?

@DanielNoord
Copy link
Collaborator

@DanielNoord is there anything else needing to be done?

The CI fails so we would first need to fix that before this can be merged.

@sshane
Copy link
Author

sshane commented Jan 11, 2023

For whatever reason, both Python 3.8 and 3.10 do not work to update the abstract method file. I'm running python test_functional.py --update-functional-tests, but it just fails and doesn't update the file (it updates other files that we don't want).

-e git+https://github.com/sshane/pylint@c8564bb99a393621341851acaa3ed042b3c53c3d#egg=pylint
astroid==2.12.14
Python 3.10.0
Ubuntu 20.04
self = <pylint.testutils.functional.lint_module_output_update.LintModuleOutputUpdate object at 0x7fa1e3c6d690>

    def runTest(self) -> None:
>       self._runTest()
E       AssertionError: Wrong results for file "abstract_method":
E       
E       Unexpected in testdata:
E         47: abstract-method

../pylint/testutils/lint_module_test.py:145: AssertionError
=========================================================================================================================================== short test summary info ===========================================================================================================================================
FAILED test_functional.py::test_functional[abstract_method] - AssertionError: Wrong results for file "abstract_method":
============================================================================================================================ 1 failed, 779 passed, 25 skipped in 62.76s (0:01:02) =============================================================================================================================

@DanielNoord
Copy link
Collaborator

Could it be that the test simply fails? If haven't checked that myself locally

@sshane
Copy link
Author

sshane commented Jan 21, 2023

Do you have any docs for what the comments do? For example, I'm not sure if # [abstract-method] means we're asserting an abstract method error from pylint, or we're catching an error to not fail the tests.

Are the functional tests a sort of blend of replay with the file outputs and unit tests?

@DanielNoord
Copy link
Collaborator

Do you have any docs for what the comments do? For example, I'm not sure if # [abstract-method] means we're asserting an abstract method error from pylint, or we're catching an error to not fail the tests.

Are the functional tests a sort of blend of replay with the file outputs and unit tests?

https://pylint.readthedocs.io/en/latest/development_guide/contributor_guide/tests/writing_test.html#functional-tests

This (attempts to) describe the functional test framework. Basically it tries to lint the file and sees where we expect messages to be raised and compares that against the actual output of the linting.

@Pierre-Sassoulas Pierre-Sassoulas modified the milestones: 2.17.0, 3.0.0 Mar 7, 2023
@Pierre-Sassoulas Pierre-Sassoulas removed this from the 3.0.0 milestone Sep 24, 2023
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
False Negative 🦋 No message is emitted but something is wrong with the code Work in progress
Projects
None yet
Development

Successfully merging this pull request may close these issues.

Subclasses of abstract class that do not inherit abc.ABC are considered abstract
3 participants