Skip to content

Commit

Permalink
Update version of dependency pylint
Browse files Browse the repository at this point in the history
Newer version of pylint have deprecated the __implements__ class
attribute, but removing that causes earlier versions of pylint to miss
checkers. https://github.com/pylint-dev/pylint/blob/f815e9f5fcdd5caffc04e335fc4590a65989ef21/doc/whatsnew/2/2.14/full.rst#L196
  • Loading branch information
jmcgill298 committed Jul 7, 2023
1 parent 03d1a98 commit 21540c3
Show file tree
Hide file tree
Showing 7 changed files with 316 additions and 416 deletions.
713 changes: 314 additions & 399 deletions poetry.lock

Large diffs are not rendered by default.

3 changes: 0 additions & 3 deletions pylint_nautobot/code_location_changes.py
Original file line number Diff line number Diff line change
@@ -1,14 +1,11 @@
"""Check for imports whose paths have changed in 2.0."""
from pylint.checkers import BaseChecker
from pylint.interfaces import IAstroidChecker
from pylint_nautobot.utils import MAP_CODE_LOCATION_CHANGES


class NautobotCodeLocationChangesChecker(BaseChecker):
"""Visit 'import from' statements to find import locations that have moved in 2.0."""

__implements__ = IAstroidChecker

version_specifier = ">=2,<3"

name = "nautobot-code-location-changes"
Expand Down
3 changes: 0 additions & 3 deletions pylint_nautobot/incorrect_base_class.py
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,6 @@

from astroid import ClassDef, Assign, Const
from pylint.checkers import BaseChecker
from pylint.interfaces import IAstroidChecker


def to_path(obj):
Expand Down Expand Up @@ -36,8 +35,6 @@ class NautobotIncorrectBaseClassChecker(BaseChecker):
Example: Every model that you define in the Nautobot ecosystem should inherit from 'nautobot.core.models.BaseModel'.
"""

__implements__ = IAstroidChecker

version_specifier = ">=1,<3"

# Maps a non-Nautobot-specific base class to a Nautobot-specific base class which has to be in the class hierarchy
Expand Down
3 changes: 0 additions & 3 deletions pylint_nautobot/replaced_models.py
Original file line number Diff line number Diff line change
@@ -1,13 +1,10 @@
"""Check for usage of models that were replaced in 2.0."""
from pylint.checkers import BaseChecker
from pylint.interfaces import IAstroidChecker


class NautobotReplacedModelsImportChecker(BaseChecker):
"""Visit 'import from' statements to find usage of models that have been replaced in 2.0."""

__implements__ = IAstroidChecker

version_specifier = ">=2,<3"

name = "nautobot-replaced-models"
Expand Down
3 changes: 0 additions & 3 deletions pylint_nautobot/status_field_instead_of_status_model.py
Original file line number Diff line number Diff line change
@@ -1,13 +1,10 @@
"""Check for deprecated StatusModel usage and encourage the usage of StatusField instead."""
from pylint.checkers import BaseChecker
from pylint.interfaces import IAstroidChecker


class NautobotDeprecatedStatusModelChecker(BaseChecker):
"""Discourage the usage of deprecated StatusModel and encourage the usage of StatusField."""

__implements__ = IAstroidChecker

version_specifier = ">=2,<3"

name = "nautobot-status-field-instead-of-status-model"
Expand Down
3 changes: 0 additions & 3 deletions pylint_nautobot/string_field_null_blank.py
Original file line number Diff line number Diff line change
@@ -1,14 +1,11 @@
"""Check for CharField's or TextField's on models where null=True and blank=True."""
from astroid import ClassDef, Assign, Call
from pylint.checkers import BaseChecker
from pylint.interfaces import IAstroidChecker


class NautobotStringFieldBlankNull(BaseChecker):
"""Visit classes to find class children on models who are CharField's or TextField's and check whether they are configured well."""

__implements__ = IAstroidChecker

version_specifier = ">=1,<3"

name = "nautobot-string-field-blank-null"
Expand Down
4 changes: 2 additions & 2 deletions pyproject.toml
Original file line number Diff line number Diff line change
Expand Up @@ -6,8 +6,8 @@ authors = ["Cristian Sirbu <[email protected]>", "Leo Kirchner <l
readme = "README.md"

[tool.poetry.dependencies]
python = "^3.7"
pylint = "^2.13"
python = "^3.7.2"
pylint = "^2.17"
pyyaml = "^6.0"
importlib-resources = "^5.12.0"
tomli = "^2.0.1"
Expand Down

0 comments on commit 21540c3

Please sign in to comment.