Skip to content

Commit

Permalink
Remove __implements__ attributes for pylint checker classes
Browse files Browse the repository at this point in the history
  • Loading branch information
atodorov committed Nov 6, 2023
1 parent 70ffce9 commit 5d79ad9
Show file tree
Hide file tree
Showing 19 changed files with 28 additions and 78 deletions.
6 changes: 2 additions & 4 deletions kiwi_lint/api_distinct.py
Original file line number Diff line number Diff line change
@@ -1,8 +1,8 @@
# Copyright (c) 2021 Alexander Todorov <[email protected]>
# Copyright (c) 2021,2023 Alexander Todorov <[email protected]>

# Licensed under the GPL 2.0: https://www.gnu.org/licenses/old-licenses/gpl-2.0.html

from pylint import checkers, interfaces
from pylint import checkers

from .utils import is_api_function

Expand All @@ -15,8 +15,6 @@ class APIDistinctChecker(checkers.BaseChecker):
current_api_method = None
distinct_found = False

__implements__ = (interfaces.IAstroidChecker,)

name = "api-distinct-checker"

msgs = {
Expand Down
4 changes: 1 addition & 3 deletions kiwi_lint/auto_field.py
Original file line number Diff line number Diff line change
@@ -1,10 +1,8 @@
from pylint import checkers, interfaces
from pylint import checkers
from pylint.checkers import utils


class AutoFieldChecker(checkers.BaseChecker):
__implements__ = (interfaces.IAstroidChecker,)

name = "auto-field-checker"

msgs = {
Expand Down
6 changes: 2 additions & 4 deletions kiwi_lint/bulk_create.py
Original file line number Diff line number Diff line change
@@ -1,14 +1,12 @@
# Copyright (c) 2018 Alexander Todorov <[email protected]>
# Copyright (c) 2018,2023 Alexander Todorov <[email protected]>

# Licensed under the GPL 2.0: https://www.gnu.org/licenses/old-licenses/gpl-2.0.html

from pylint import checkers, interfaces
from pylint import checkers
from pylint.checkers import utils


class BulkCreateChecker(checkers.BaseChecker):
__implements__ = (interfaces.IAstroidChecker,)

name = "bulk-create-checker"

msgs = {
Expand Down
4 changes: 1 addition & 3 deletions kiwi_lint/datetime.py
Original file line number Diff line number Diff line change
Expand Up @@ -5,12 +5,10 @@
"""

from astroid import nodes
from pylint import checkers, interfaces
from pylint import checkers


class DatetimeChecker(checkers.BaseChecker):
__implements__ = (interfaces.IAstroidChecker,)

name = "datetime-checker"

msgs = {
Expand Down
4 changes: 1 addition & 3 deletions kiwi_lint/db_column.py
Original file line number Diff line number Diff line change
@@ -1,10 +1,8 @@
from pylint import checkers, interfaces
from pylint import checkers
from pylint.checkers import utils


class DbColumnChecker(checkers.BaseChecker):
__implements__ = (interfaces.IAstroidChecker,)

name = "db-column-used"

msgs = {
Expand Down
9 changes: 2 additions & 7 deletions kiwi_lint/docstring.py
Original file line number Diff line number Diff line change
@@ -1,19 +1,14 @@
# Copyright (c) 2018 Alexander Todorov <[email protected]>
# Copyright (c) 2018,2023 Alexander Todorov <[email protected]>

# Licensed under the GPL 2.0: https://www.gnu.org/licenses/old-licenses/gpl-2.0.html

import tokenize

from pylint import checkers, interfaces
from pylint import checkers
from pylint.checkers import utils


class DocstringChecker(checkers.BaseTokenChecker):
__implements__ = (
interfaces.ITokenChecker,
interfaces.IAstroidChecker,
)

name = "docstring-checker"

msgs = {
Expand Down
6 changes: 2 additions & 4 deletions kiwi_lint/dunder_attributes.py
Original file line number Diff line number Diff line change
@@ -1,15 +1,13 @@
# Copyright (c) 2018 Alexander Todorov <[email protected]>
# Copyright (c) 2018,2023 Alexander Todorov <[email protected]>

# Licensed under the GPL 2.0: https://www.gnu.org/licenses/old-licenses/gpl-2.0.html

import astroid
from pylint import checkers, interfaces
from pylint import checkers
from pylint.checkers import utils


class DunderClassAttributeChecker(checkers.BaseChecker):
__implements__ = (interfaces.IAstroidChecker,)

name = "dunder-class-attribute-checker"

msgs = {
Expand Down
10 changes: 2 additions & 8 deletions kiwi_lint/empty.py
Original file line number Diff line number Diff line change
@@ -1,17 +1,15 @@
# Copyright (c) 2018 Alexander Todorov <[email protected]>
# Copyright (c) 2018,2023 Alexander Todorov <[email protected]>

# Licensed under the GPL 2.0: https://www.gnu.org/licenses/old-licenses/gpl-2.0.html

import os

import astroid
from pylint import checkers, interfaces
from pylint import checkers
from pylint.checkers import utils


class EmptyModuleChecker(checkers.BaseChecker):
__implements__ = (interfaces.IAstroidChecker,)

name = "empty-module-checker"

msgs = {
Expand All @@ -30,8 +28,6 @@ def visit_module(self, node):


class ModuleInDirectoryWithoutInitChecker(checkers.BaseChecker):
__implements__ = (interfaces.IAstroidChecker,)

name = "dir-without-init-checker"

msgs = {
Expand Down Expand Up @@ -86,8 +82,6 @@ def close(self):


class EmptyClassChecker(checkers.BaseChecker):
__implements__ = (interfaces.IAstroidChecker,)

name = "empty-class-checker"

msgs = {
Expand Down
6 changes: 1 addition & 5 deletions kiwi_lint/forms.py
Original file line number Diff line number Diff line change
@@ -1,10 +1,8 @@
from pylint import checkers, interfaces
from pylint import checkers
from pylint_django.utils import node_is_subclass


class FormFieldChecker(checkers.BaseChecker):
__implements__ = (interfaces.IAstroidChecker,)

name = "form-field-label-checker"

msgs = {
Expand Down Expand Up @@ -38,8 +36,6 @@ class ModelFormChecker(checkers.BaseChecker):
Check to ensure that all forms inherit from ModelForm.
"""

__implements__ = (interfaces.IAstroidChecker,)

name = "model-form-checker"

msgs = {
Expand Down
3 changes: 0 additions & 3 deletions kiwi_lint/generic_foreign_key.py
Original file line number Diff line number Diff line change
@@ -1,11 +1,8 @@
import astroid
from pylint.checkers import BaseChecker, utils
from pylint.interfaces import IAstroidChecker


class GenericForeignKeyChecker(BaseChecker):
__implements__ = (IAstroidChecker,)

name = "generic-foreign-key-checker"

msgs = {
Expand Down
6 changes: 2 additions & 4 deletions kiwi_lint/list_comprehension.py
Original file line number Diff line number Diff line change
@@ -1,14 +1,12 @@
# Copyright (c) 2018 Alexander Todorov <[email protected]>
# Copyright (c) 2018,2023 Alexander Todorov <[email protected]>

# Licensed under the GPL 2.0: https://www.gnu.org/licenses/old-licenses/gpl-2.0.html

from pylint import checkers, interfaces
from pylint import checkers
from pylint.checkers import utils


class ListComprehensionChecker(checkers.BaseChecker):
__implements__ = (interfaces.IAstroidChecker,)

name = "list-comprehension-checker"

msgs = {
Expand Down
8 changes: 2 additions & 6 deletions kiwi_lint/missing_permissions.py
Original file line number Diff line number Diff line change
@@ -1,9 +1,9 @@
# Copyright (c) 2019-2021 Alexander Todorov <[email protected]>
# Copyright (c) 2019-2021,2023 Alexander Todorov <[email protected]>

# Licensed under the GPL 2.0: https://www.gnu.org/licenses/old-licenses/gpl-2.0.html

import astroid
from pylint import checkers, interfaces
from pylint import checkers

from .utils import is_api_function

Expand All @@ -22,8 +22,6 @@ class MissingPermissionsChecker(checkers.BaseChecker):
]
inside_views_module = False

__implements__ = (interfaces.IAstroidChecker,)

name = "mising-permissions-checker"

msgs = {
Expand Down Expand Up @@ -96,8 +94,6 @@ class MissingAPIPermissionsChecker(checkers.BaseChecker):
Will inspect API functions for the presence of permissions decorator!
"""

__implements__ = (interfaces.IAstroidChecker,)

name = "mising-api-permissions-checker"

msgs = {
Expand Down
6 changes: 2 additions & 4 deletions kiwi_lint/nested_definition.py
Original file line number Diff line number Diff line change
@@ -1,15 +1,13 @@
# Copyright (c) 2019 Alexander Todorov <[email protected]>
# Copyright (c) 2019,2023 Alexander Todorov <[email protected]>

# Licensed under the GPL 2.0: https://www.gnu.org/licenses/old-licenses/gpl-2.0.html

import astroid
from pylint import checkers, interfaces
from pylint import checkers
from pylint.checkers import utils


class NestedDefinitionChecker(checkers.BaseChecker):
__implements__ = (interfaces.IAstroidChecker,)

name = "nested-definition-checker"

msgs = {
Expand Down
6 changes: 2 additions & 4 deletions kiwi_lint/objects_update.py
Original file line number Diff line number Diff line change
@@ -1,14 +1,12 @@
# Copyright (c) 2018 Alexander Todorov <[email protected]>
# Copyright (c) 2018,2023 Alexander Todorov <[email protected]>

# Licensed under the GPL 2.0: https://www.gnu.org/licenses/old-licenses/gpl-2.0.html

from pylint import checkers, interfaces
from pylint import checkers
from pylint.checkers import utils


class ObjectsUpdateChecker(checkers.BaseChecker):
__implements__ = (interfaces.IAstroidChecker,)

name = "objects-update-checker"

msgs = {
Expand Down
4 changes: 1 addition & 3 deletions kiwi_lint/one_to_one_field.py
Original file line number Diff line number Diff line change
@@ -1,10 +1,8 @@
from pylint import checkers, interfaces
from pylint import checkers
from pylint.checkers import utils


class OneToOneFieldChecker(checkers.BaseChecker):
__implements__ = (interfaces.IAstroidChecker,)

name = "one-to-one-field-checker"

msgs = {
Expand Down
6 changes: 2 additions & 4 deletions kiwi_lint/raw_sql.py
Original file line number Diff line number Diff line change
@@ -1,15 +1,13 @@
# Copyright (c) 2018 Alexander Todorov <[email protected]>
# Copyright (c) 2018,2023 Alexander Todorov <[email protected]>

# Licensed under the GPL 2.0: https://www.gnu.org/licenses/old-licenses/gpl-2.0.html

import astroid
from pylint import checkers, interfaces
from pylint import checkers
from pylint.checkers import utils


class RawSQLChecker(checkers.BaseChecker):
__implements__ = (interfaces.IAstroidChecker,)

name = "raw-sql-checker"

msgs = {
Expand Down
2 changes: 0 additions & 2 deletions kiwi_lint/similar_string.py
Original file line number Diff line number Diff line change
Expand Up @@ -4,12 +4,10 @@

import astroid
from pylint.checkers import BaseChecker, utils
from pylint.interfaces import IAstroidChecker
from textdistance import levenshtein


class SimilarStringChecker(BaseChecker):
__implements__ = (IAstroidChecker,)
name = "similar-string-checker"

msgs = {
Expand Down
6 changes: 2 additions & 4 deletions kiwi_lint/tags.py
Original file line number Diff line number Diff line change
@@ -1,15 +1,13 @@
# Copyright (c) 2018 Alexander Todorov <[email protected]>
# Copyright (c) 2018,2023 Alexander Todorov <[email protected]>

# Licensed under the GPL 2.0: https://www.gnu.org/licenses/old-licenses/gpl-2.0.html

import astroid
from pylint import checkers, interfaces
from pylint import checkers
from pylint.checkers import utils


class TagsChecker(checkers.BaseChecker):
__implements__ = (interfaces.IAstroidChecker,)

name = "tags-checker"

msgs = {
Expand Down
4 changes: 1 addition & 3 deletions kiwi_lint/views.py
Original file line number Diff line number Diff line change
Expand Up @@ -8,7 +8,7 @@
import django
from django.conf import settings
from django.urls.resolvers import URLPattern, URLResolver
from pylint import checkers, interfaces
from pylint import checkers


class DjangoViewsChecker(checkers.BaseChecker):
Expand Down Expand Up @@ -89,8 +89,6 @@ class ClassBasedViewChecker(DjangoViewsChecker):
this project be class based!
"""

__implements__ = (interfaces.IAstroidChecker,)

name = "class-based-view-checker"

msgs = {
Expand Down

0 comments on commit 5d79ad9

Please sign in to comment.