From 01a509d3480d4fdbff250c7164cb3d435a2c5ec0 Mon Sep 17 00:00:00 2001 From: Alexis Lahouze Date: Fri, 19 May 2017 16:58:20 +0200 Subject: [PATCH] Pylint. --- accountant/models/accounts.py | 4 +--- accountant/models/operations.py | 6 ++---- accountant/models/scheduled_operations.py | 5 ++--- accountant/models/users.py | 4 ++-- 4 files changed, 7 insertions(+), 12 deletions(-) diff --git a/accountant/models/accounts.py b/accountant/models/accounts.py index b592f5f..d8f768b 100644 --- a/accountant/models/accounts.py +++ b/accountant/models/accounts.py @@ -2,15 +2,14 @@ # vim: set tw=80 ts=4 sw=4 sts=4: -# pylint: disable=no-member,too-few-public-methods from . import db from .operations import Operation +# pylint: disable=no-member,invalid-name,too-few-public-methods,no-self-use class Account(db.Model): """Model class to handle accounts.""" - # pylint: disable=invalid-name id = db.Column(db.Integer, primary_key=True) name = db.Column(db.String(200), nullable=False) authorized_overdraft = db.Column(db.Integer, nullable=True, default=0) @@ -87,7 +86,6 @@ class Account(db.Model): return query.one() @db.validates('authorized_overdraft') - # pylint: disable=no-self-use def validate_authorized_overdraft(self, key, authorized_overdraft): """Validator for authorized_overdraft : must be negative.""" del key diff --git a/accountant/models/operations.py b/accountant/models/operations.py index ce6cbd9..4e8f5d0 100644 --- a/accountant/models/operations.py +++ b/accountant/models/operations.py @@ -6,14 +6,13 @@ from datetime import date import arrow -# pylint: disable=no-member,too-few-public-methods from . import db -# pylint: disable=too-many-instance-attributes +# pylint: disable=no-member,invalid-name,too-many-arguments +# pylint: disable=too-few-public-methods,too-many-instance-attributes class Operation(db.Model): """Class used to handle operations.""" - # pylint: disable=invalid-name id = db.Column(db.Integer, primary_key=True) operation_date = db.Column( @@ -82,7 +81,6 @@ class Operation(db.Model): ).label("sold") ) - # pylint: disable=too-many-arguments def __init__(self, label, value, account_id, operation_date=None, category=None, pointed=False, confirmed=True, canceled=False, scheduled_operation_id=None): diff --git a/accountant/models/scheduled_operations.py b/accountant/models/scheduled_operations.py index d4bd8f7..eaf8643 100644 --- a/accountant/models/scheduled_operations.py +++ b/accountant/models/scheduled_operations.py @@ -6,16 +6,16 @@ from calendar import monthrange import arrow -# pylint: disable=no-member,too-few-public-methods,too-many-instance-attributes from . import db from .accounts import Account from .operations import Operation +# pylint: disable=no-member,invalid-name,too-many-arguments +# pylint: disable=too-few-public-methods,too-many-instance-attributes class ScheduledOperation(db.Model): """Class used to handle scheduled operations.""" - # pylint: disable=invalid-name id = db.Column(db.Integer, primary_key=True) start_date = db.Column(db.Date, nullable=False) @@ -39,7 +39,6 @@ class ScheduledOperation(db.Model): backref=db.backref('scheduled_operation', lazy="dynamic") ) - # pylint: disable=too-many-arguments def __init__(self, start_date, stop_date, day, frequency, label, value, account_id, category=None): self.start_date = start_date diff --git a/accountant/models/users.py b/accountant/models/users.py index 4cc514c..d4ca9dd 100644 --- a/accountant/models/users.py +++ b/accountant/models/users.py @@ -7,10 +7,10 @@ from passlib.hash import sha256_crypt as crypt from . import db -# pylint: disable=no-member,too-few-public-methods +# pylint: disable=no-member,invalid-name +# pylint: disable=too-few-public-methods,too-many-instance-attributes class User(db.Model): """Class used to handle users.""" - # pylint: disable=invalid-name id = db.Column(db.Integer, primary_key=True) email = db.Column(db.String(200), nullable=False, unique=True, index=True) password = db.Column(db.String(100), nullable=True)