Skip to content

Commit

Permalink
CI: move pylint configuration to pyproject.toml (#4411)
Browse files Browse the repository at this point in the history
This is supported by `pylint` as of v2.5.
  • Loading branch information
sphuber authored Sep 28, 2020
1 parent e2b5385 commit 65ad067
Show file tree
Hide file tree
Showing 59 changed files with 102 additions and 533 deletions.
437 changes: 0 additions & 437 deletions .pylintrc

This file was deleted.

Original file line number Diff line number Diff line change
Expand Up @@ -7,7 +7,7 @@
# For further information on the license, see the LICENSE.txt file #
# For further information please visit http://www.aiida.net #
###########################################################################
# pylint: disable=invalid-name,too-few-public-methods
# pylint: disable=invalid-name
"""Invalidating node hash - User should rehash nodes for caching."""

# Remove when https://github.com/PyCQA/pylint/issues/1931 is fixed
Expand Down
2 changes: 1 addition & 1 deletion aiida/backends/djsite/db/migrations/0018_django_1_11.py
Original file line number Diff line number Diff line change
Expand Up @@ -8,7 +8,7 @@
# For further information please visit http://www.aiida.net #
###########################################################################
# Generated by Django 1.11.16 on 2018-11-12 16:46
# pylint: disable=invalid-name,too-few-public-methods
# pylint: disable=invalid-name
"""Migration for upgrade to django 1.11"""

# Remove when https://github.com/PyCQA/pylint/issues/1931 is fixed
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -7,7 +7,7 @@
# For further information on the license, see the LICENSE.txt file #
# For further information please visit http://www.aiida.net #
###########################################################################
# pylint: disable=invalid-name,too-few-public-methods
# pylint: disable=invalid-name
"""Migration to reflect the name change of the built in calculation entry points in the database."""

# Remove when https://github.com/PyCQA/pylint/issues/1931 is fixed
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -7,7 +7,7 @@
# For further information on the license, see the LICENSE.txt file #
# For further information please visit http://www.aiida.net #
###########################################################################
# pylint: disable=invalid-name,too-few-public-methods,unused-argument
# pylint: disable=invalid-name,unused-argument
"""Migration after the provenance redesign"""

# Remove when https://github.com/PyCQA/pylint/issues/1931 is fixed
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -7,7 +7,7 @@
# For further information on the license, see the LICENSE.txt file #
# For further information please visit http://www.aiida.net #
###########################################################################
# pylint: disable=invalid-name,too-few-public-methods
# pylint: disable=invalid-name
"""Migration that renames name and type columns to label and type_string"""

# pylint: disable=no-name-in-module,import-error
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -7,7 +7,7 @@
# For further information on the license, see the LICENSE.txt file #
# For further information please visit http://www.aiida.net #
###########################################################################
# pylint: disable=invalid-name,too-few-public-methods
# pylint: disable=invalid-name
"""Migration after the update of group_types"""

# pylint: disable=no-name-in-module,import-error
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -7,7 +7,7 @@
# For further information on the license, see the LICENSE.txt file #
# For further information please visit http://www.aiida.net #
###########################################################################
# pylint: disable=invalid-name,too-few-public-methods
# pylint: disable=invalid-name
"""Migration of ProcessNode attributes for metadata options whose key changed."""

# Remove when https://github.com/PyCQA/pylint/issues/1931 is fixed
Expand Down
2 changes: 1 addition & 1 deletion aiida/backends/djsite/db/migrations/0024_dblog_update.py
Original file line number Diff line number Diff line change
Expand Up @@ -8,7 +8,7 @@
# For further information please visit http://www.aiida.net #
###########################################################################
# Generated by Django 1.11.16 on 2018-12-21 10:56
# pylint: disable=invalid-name,too-few-public-methods
# pylint: disable=invalid-name
"""Migration for the update of the DbLog table. Addition of uuids"""

import sys
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -7,7 +7,7 @@
# For further information on the license, see the LICENSE.txt file #
# For further information please visit http://www.aiida.net #
###########################################################################
# pylint: disable=invalid-name,too-few-public-methods
# pylint: disable=invalid-name
"""Data migration for `Data` nodes after it was moved in the `aiida.orm.node` module changing the type string."""

# Remove when https://github.com/PyCQA/pylint/issues/1931 is fixed
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -7,7 +7,7 @@
# For further information on the license, see the LICENSE.txt file #
# For further information please visit http://www.aiida.net #
###########################################################################
# pylint: disable=invalid-name,too-few-public-methods
# pylint: disable=invalid-name
"""Data migration for `TrajectoryData` nodes where symbol lists are moved from repository array to attribute.
This process has to be done in two separate consecutive migrations to prevent data loss in between.
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -7,7 +7,7 @@
# For further information on the license, see the LICENSE.txt file #
# For further information please visit http://www.aiida.net #
###########################################################################
# pylint: disable=invalid-name,too-few-public-methods
# pylint: disable=invalid-name
"""Data migration for `TrajectoryData` nodes where symbol lists are moved from repository array to attribute.
This process has to be done in two separate consecutive migrations to prevent data loss in between.
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -7,7 +7,7 @@
# For further information on the license, see the LICENSE.txt file #
# For further information please visit http://www.aiida.net #
###########################################################################
# pylint: disable=invalid-name,too-few-public-methods
# pylint: disable=invalid-name
"""Final data migration for `Nodes` after `aiida.orm.nodes` reorganization was finalized to remove the `node.` prefix"""

# Remove when https://github.com/PyCQA/pylint/issues/1931 is fixed
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -7,7 +7,7 @@
# For further information on the license, see the LICENSE.txt file #
# For further information please visit http://www.aiida.net #
###########################################################################
# pylint: disable=invalid-name,too-few-public-methods
# pylint: disable=invalid-name
"""Data migration for after `ParameterData` was renamed to `Dict`."""

# Remove when https://github.com/PyCQA/pylint/issues/1931 is fixed
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -7,7 +7,7 @@
# For further information on the license, see the LICENSE.txt file #
# For further information please visit http://www.aiida.net #
###########################################################################
# pylint: disable=invalid-name,too-few-public-methods
# pylint: disable=invalid-name
"""Renaming `DbNode.type` to `DbNode.node_type`"""

# Remove when https://github.com/PyCQA/pylint/issues/1931 is fixed
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -7,7 +7,7 @@
# For further information on the license, see the LICENSE.txt file #
# For further information please visit http://www.aiida.net #
###########################################################################
# pylint: disable=invalid-name,too-few-public-methods
# pylint: disable=invalid-name
"""Remove `DbComputer.enabled`"""

# Remove when https://github.com/PyCQA/pylint/issues/1931 is fixed
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -7,7 +7,7 @@
# For further information on the license, see the LICENSE.txt file #
# For further information please visit http://www.aiida.net #
###########################################################################
# pylint: disable=invalid-name,too-few-public-methods
# pylint: disable=invalid-name
"""Remove legacy workflow."""

import sys
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -7,7 +7,7 @@
# For further information on the license, see the LICENSE.txt file #
# For further information please visit http://www.aiida.net #
###########################################################################
# pylint: disable=invalid-name,too-few-public-methods
# pylint: disable=invalid-name
"""Replace use of text fields to store JSON data with builtin JSONField."""

# Remove when https://github.com/PyCQA/pylint/issues/1931 is fixed
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -7,7 +7,7 @@
# For further information on the license, see the LICENSE.txt file #
# For further information please visit http://www.aiida.net #
###########################################################################
# pylint: disable=invalid-name,too-few-public-methods
# pylint: disable=invalid-name
"""Drop the columns `nodeversion` and `public` from the `DbNode` model."""

# Remove when https://github.com/PyCQA/pylint/issues/1931 is fixed
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -7,7 +7,7 @@
# For further information on the license, see the LICENSE.txt file #
# For further information please visit http://www.aiida.net #
###########################################################################
# pylint: disable=invalid-name,too-few-public-methods
# pylint: disable=invalid-name
"""Simplify the `DbUser` model."""

# Remove when https://github.com/PyCQA/pylint/issues/1931 is fixed
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -7,7 +7,7 @@
# For further information on the license, see the LICENSE.txt file #
# For further information please visit http://www.aiida.net #
###########################################################################
# pylint: disable=invalid-name,too-few-public-methods
# pylint: disable=invalid-name
"""Drop the `transport_params` from the `Computer` database model."""

# Remove when https://github.com/PyCQA/pylint/issues/1931 is fixed
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -7,7 +7,7 @@
# For further information on the license, see the LICENSE.txt file #
# For further information please visit http://www.aiida.net #
###########################################################################
# pylint: disable=invalid-name,import-error,no-name-in-module,too-few-public-methods,no-member
# pylint: disable=invalid-name,import-error,no-name-in-module,no-member
"""Adding JSONB field for Node.attributes and Node.Extras"""

import math
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -7,7 +7,7 @@
# For further information on the license, see the LICENSE.txt file #
# For further information please visit http://www.aiida.net #
###########################################################################
# pylint: disable=invalid-name,too-few-public-methods
# pylint: disable=invalid-name
"""Data migration for legacy `JobCalculations`.
These old nodes have already been migrated to the correct `CalcJobNode` type in a previous migration, but they can
Expand Down
2 changes: 1 addition & 1 deletion aiida/backends/djsite/db/migrations/0039_reset_hash.py
Original file line number Diff line number Diff line change
Expand Up @@ -7,7 +7,7 @@
# For further information on the license, see the LICENSE.txt file #
# For further information please visit http://www.aiida.net #
###########################################################################
# pylint: disable=invalid-name,too-few-public-methods
# pylint: disable=invalid-name
"""
Invalidating node hash - User should rehash nodes for caching
"""
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -7,7 +7,7 @@
# For further information on the license, see the LICENSE.txt file #
# For further information please visit http://www.aiida.net #
###########################################################################
# pylint: disable=invalid-name,too-few-public-methods
# pylint: disable=invalid-name
"""Data migration for some legacy process attributes.
Attribute keys that are renamed:
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -7,7 +7,7 @@
# For further information on the license, see the LICENSE.txt file #
# For further information please visit http://www.aiida.net #
###########################################################################
# pylint: disable=invalid-name,too-few-public-methods
# pylint: disable=invalid-name
"""Seal any process nodes that have not yet been sealed but should.
This should have been accomplished by the last step in the previous migration, but because the WHERE clause was
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -7,7 +7,7 @@
# For further information on the license, see the LICENSE.txt file #
# For further information please visit http://www.aiida.net #
###########################################################################
# pylint: disable=invalid-name,too-few-public-methods
# pylint: disable=invalid-name
"""Prepare the schema reset."""

# Remove when https://github.com/PyCQA/pylint/issues/1931 is fixed
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -7,7 +7,7 @@
# For further information on the license, see the LICENSE.txt file #
# For further information please visit http://www.aiida.net #
###########################################################################
# pylint: disable=invalid-name,too-few-public-methods
# pylint: disable=invalid-name
"""Update all link labels with the value `_return` which is the legacy default single link label.
The old process functions used to use `_return` as the default link label, however, since labels that start or end with
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -7,7 +7,7 @@
# For further information on the license, see the LICENSE.txt file #
# For further information please visit http://www.aiida.net #
###########################################################################
# pylint: disable=invalid-name,too-few-public-methods
# pylint: disable=invalid-name
"""Migration after the `Group` class became pluginnable and so the group `type_string` changed."""

# pylint: disable=no-name-in-module,import-error
Expand Down
8 changes: 4 additions & 4 deletions aiida/backends/djsite/db/models.py
Original file line number Diff line number Diff line change
Expand Up @@ -7,7 +7,7 @@
# For further information on the license, see the LICENSE.txt file #
# For further information please visit http://www.aiida.net #
###########################################################################
# pylint: disable=import-error,no-name-in-module
# pylint: disable=import-error,no-name-in-module,no-member
"""Module that defines db models."""
import contextlib

Expand Down Expand Up @@ -63,7 +63,7 @@ def get_queryset(self):
return AiidaQuerySet(self.model, using=self._db)


class DbUser(m.Model): # pylint: disable=too-few-public-methods
class DbUser(m.Model):
"""Class that represents a user as the owner of a specific Node."""

is_anonymous = False
Expand Down Expand Up @@ -257,7 +257,7 @@ class DbGroup(m.Model):
# JSON Extras
extras = JSONField(default=dict, null=False)

class Meta: # pylint: disable=too-few-public-methods
class Meta:
unique_together = (('label', 'type_string'),)

def __str__(self):
Expand Down Expand Up @@ -325,7 +325,7 @@ class DbAuthInfo(m.Model):
# Whether this computer is enabled (user-level enabling feature)
enabled = m.BooleanField(default=True)

class Meta: # pylint: disable=too-few-public-methods
class Meta:
unique_together = (('aiidauser', 'dbcomputer'),)

def __str__(self):
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -7,7 +7,7 @@
# For further information on the license, see the LICENSE.txt file #
# For further information please visit http://www.aiida.net #
###########################################################################
# pylint: disable=invalid-name,too-few-public-methods,no-member
# pylint: disable=invalid-name
"""Invalidating node hash - User should rehash nodes for caching
Revision ID: 5d4d844852b6
Expand All @@ -33,7 +33,7 @@

def upgrade():
"""drop the hashes when upgrading"""
conn = op.get_bind()
conn = op.get_bind() # pylint: disable=no-member

# Invalidate all the hashes
statement = text("""UPDATE db_dbnode SET extras = extras #- '{""" + _HASH_EXTRA_KEY + """}'::text[];""")
Expand All @@ -42,7 +42,7 @@ def upgrade():

def downgrade():
"""drop the hashes also when downgrading"""
conn = op.get_bind()
conn = op.get_bind() # pylint: disable=no-member

# Invalidate all the hashes
statement = text("""UPDATE db_dbnode SET extras = extras #- '{""" + _HASH_EXTRA_KEY + """}'::text[];""")
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -7,7 +7,7 @@
# For further information on the license, see the LICENSE.txt file #
# For further information please visit http://www.aiida.net #
###########################################################################
# pylint: disable=invalid-name,too-few-public-methods,no-member
# pylint: disable=invalid-name
"""Invalidating node hash - User should rehash nodes for caching
Revision ID: e797afa09270
Expand Down Expand Up @@ -47,9 +47,9 @@ def drop_hashes(conn): # pylint: disable=unused-argument

def upgrade():
"""drop the hashes when upgrading"""
drop_hashes(op.get_bind())
drop_hashes(op.get_bind()) # pylint: disable=no-member


def downgrade():
"""drop the hashes also when downgrading"""
drop_hashes(op.get_bind())
drop_hashes(op.get_bind()) # pylint: disable=no-member
1 change: 0 additions & 1 deletion aiida/cmdline/commands/cmd_import.py
Original file line number Diff line number Diff line change
Expand Up @@ -25,7 +25,6 @@
COMMENT_MODE = ['newest', 'overwrite']


# pylint: disable=too-few-public-methods
class ExtrasImportCode(Enum):
"""Exit codes for the verdi command line."""
keep_existing = 'kcl'
Expand Down
2 changes: 0 additions & 2 deletions aiida/cmdline/params/arguments/overridable.py
Original file line number Diff line number Diff line change
Expand Up @@ -38,8 +38,6 @@ def print_code_pks(codes):
the function argument name is determined, can be overriden
"""

# pylint: disable=too-few-public-methods

def __init__(self, *args, **kwargs):
"""
Store the default args and kwargs
Expand Down
1 change: 0 additions & 1 deletion aiida/cmdline/utils/echo.py
Original file line number Diff line number Diff line change
Expand Up @@ -22,7 +22,6 @@
)


# pylint: disable=too-few-public-methods
class ExitCode(IntEnum):
"""Exit codes for the verdi command line."""
CRITICAL = 1
Expand Down
3 changes: 1 addition & 2 deletions aiida/cmdline/utils/repository.py
Original file line number Diff line number Diff line change
Expand Up @@ -22,5 +22,4 @@ def list_repository_contents(node, path, color):

for entry in node.list_objects(path):
bold = bool(entry.file_type == FileType.DIRECTORY)
fg = 'blue' if color and entry.file_type == FileType.DIRECTORY else None
click.secho(entry.name, bold=bold, fg=fg)
click.secho(entry.name, bold=bold, fg='blue' if color and entry.file_type == FileType.DIRECTORY else None)
2 changes: 1 addition & 1 deletion aiida/common/lang.py
Original file line number Diff line number Diff line change
Expand Up @@ -76,7 +76,7 @@ def wrapped_fn(self, *args, **kwargs): # pylint: disable=missing-docstring
override = override_decorator(check=False) # pylint: disable=invalid-name


class classproperty: # pylint: disable=too-few-public-methods,invalid-name
class classproperty: # pylint: disable=invalid-name
"""
A class that, when used as a decorator, works as if the
two decorators @property and @classmethod where applied together
Expand Down
2 changes: 1 addition & 1 deletion aiida/engine/daemon/client.py
Original file line number Diff line number Diff line change
Expand Up @@ -24,7 +24,7 @@
VIRTUALENV = os.environ.get('VIRTUAL_ENV', None)


class ControllerProtocol(enum.Enum): # pylint: disable=too-few-public-methods
class ControllerProtocol(enum.Enum):
"""
The protocol to use to for the controller of the Circus daemon
"""
Expand Down
Loading

0 comments on commit 65ad067

Please sign in to comment.