Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
59 changes: 7 additions & 52 deletions .pylintrc
Original file line number Diff line number Diff line change
Expand Up @@ -34,15 +34,6 @@ unsafe-load-any-extension=no
# run arbitrary code
extension-pkg-whitelist=lxml

# Allow optimization of some AST trees. This will activate a peephole AST
# optimizer, which will apply various small optimizations. For instance, it can
# be used to obtain the result of joining multiple strings with the addition
# operator. Joining a lot of strings can lead to a maximum recursion error in
# Pylint and this flag can prevent that. It has one side effect, the resulting
# AST will be different than the one from reality. This option is deprecated
# and it will be removed in Pylint 2.0.
optimize-ast=no


[MESSAGES CONTROL]

Expand All @@ -65,7 +56,13 @@ confidence=
# --enable=similarities". If you want to run only the classes checker, but have
# no Warning level messages displayed, use"--disable=all --enable=classes
# --disable=W"
disable=locally-disabled, super-with-arguments, raise-missing-from
disable=locally-disabled, super-with-arguments, raise-missing-from,
consider-using-f-string,
use-dict-literal,
use-list-literal,
global-variable-not-assigned,
unrecognized-option,
useless-option-value


[REPORTS]
Expand All @@ -75,12 +72,6 @@ disable=locally-disabled, super-with-arguments, raise-missing-from
# mypackage.mymodule.MyReporterClass.
output-format=text

# Put messages in a separate file for each module / package specified on the
# command line instead of printing them on stdout. Reports (if any) will be
# written in a file name "pylint_global.[txt|html]". This option is deprecated
# and it will be removed in Pylint 2.0.
files-output=no

# Tells whether to display a full report or only the messages
reports=no

Expand Down Expand Up @@ -118,63 +109,33 @@ property-classes=abc.abstractproperty
# Regular expression matching correct function names
function-rgx=[a-z_][a-z0-9_]{2,30}$

# Naming hint for function names
function-name-hint=[a-z_][a-z0-9_]{2,30}$

# Regular expression matching correct variable names
variable-rgx=[a-z_][a-z0-9_]{2,30}$

# Naming hint for variable names
variable-name-hint=[a-z_][a-z0-9_]{2,30}$

# Regular expression matching correct constant names
const-rgx=(([A-Z_][A-Z0-9_]*)|(__.*__))$

# Naming hint for constant names
const-name-hint=(([A-Z_][A-Z0-9_]*)|(__.*__))$

# Regular expression matching correct attribute names
attr-rgx=[a-z_][a-z0-9_]{2,30}$

# Naming hint for attribute names
attr-name-hint=[a-z_][a-z0-9_]{2,30}$

# Regular expression matching correct argument names
argument-rgx=[a-z_][a-z0-9_]{2,30}$

# Naming hint for argument names
argument-name-hint=[a-z_][a-z0-9_]{2,30}$

# Regular expression matching correct class attribute names
class-attribute-rgx=([A-Za-z_][A-Za-z0-9_]{2,30}|(__.*__))$

# Naming hint for class attribute names
class-attribute-name-hint=([A-Za-z_][A-Za-z0-9_]{2,30}|(__.*__))$

# Regular expression matching correct inline iteration names
inlinevar-rgx=[A-Za-z_][A-Za-z0-9_]*$

# Naming hint for inline iteration names
inlinevar-name-hint=[A-Za-z_][A-Za-z0-9_]*$

# Regular expression matching correct class names
class-rgx=[A-Z_][a-zA-Z0-9]+$

# Naming hint for class names
class-name-hint=[A-Z_][a-zA-Z0-9]+$

# Regular expression matching correct module names
module-rgx=(([a-z_][a-z0-9_-]*)|([A-Z][a-zA-Z0-9]+))$

# Naming hint for module names
module-name-hint=(([a-z_][a-z0-9_]*)|([A-Z][a-zA-Z0-9]+))$

# Regular expression matching correct method names
method-rgx=[a-z_][a-z0-9_]{2,42}$

# Naming hint for method names
method-name-hint=[a-z_][a-z0-9_]{2,42}$

# Regular expression which should only match function or class names that do
# not require a docstring.
no-docstring-rgx=^_
Expand Down Expand Up @@ -202,12 +163,6 @@ ignore-long-lines=^\s*(# )?<?https?://\S+>?$
# else.
single-line-if-stmt=no

# List of optional constructs for which whitespace checking is disabled. `dict-
# separator` is used to allow tabulation in dicts, etc.: {1 : 1,\n222: 2}.
# `trailing-comma` allows a space between comma and closing bracket: (a, ).
# `empty-line` allows space-only lines.
no-space-check=trailing-comma,dict-separator

# Maximum number of lines in a module
max-module-lines=1000

Expand Down
2 changes: 1 addition & 1 deletion dev-requirements.txt
Original file line number Diff line number Diff line change
Expand Up @@ -6,7 +6,7 @@ httpx>=0.23.0
respx>=0.19.2
setuptools>=38.2.4
setuptools-scm>=1.15.6
pylint==2.8.3
pylint==2.15.0
pytest-cov>=3.0.0
flake8==3.8.4
bandit==1.7.5
Expand Down
19 changes: 0 additions & 19 deletions pyodata/v2/model.py
Original file line number Diff line number Diff line change
Expand Up @@ -282,7 +282,6 @@ class EdmStructTypeSerializer:
@staticmethod
def to_literal(edm_type, value):

# pylint: disable=no-self-use
if not edm_type:
raise PyODataException(f'Cannot encode value {value} without complex type information')

Expand All @@ -296,7 +295,6 @@ def to_literal(edm_type, value):
@staticmethod
def from_json(edm_type, value):

# pylint: disable=no-self-use
if not edm_type:
raise PyODataException(f'Cannot decode value {value} without complex type information')

Expand All @@ -310,7 +308,6 @@ def from_json(edm_type, value):
@staticmethod
def from_literal(edm_type, value):

# pylint: disable=no-self-use
if not edm_type:
raise PyODataException(f'Cannot decode value {value} without complex type information')

Expand All @@ -328,11 +325,9 @@ class TypTraits:
def __repr__(self):
return self.__class__.__name__

# pylint: disable=no-self-use
def to_literal(self, value):
return value

# pylint: disable=no-self-use
def from_json(self, value):
return value

Expand Down Expand Up @@ -568,11 +563,9 @@ def from_literal(self, value):
class EdmStringTypTraits(TypTraits):
"""Edm.String traits"""

# pylint: disable=no-self-use
def to_literal(self, value):
return '\'%s\'' % (str(value).replace("'", "''"))

# pylint: disable=no-self-use
def from_json(self, value):
return value

Expand All @@ -585,11 +578,9 @@ def from_literal(self, value):
class EdmBooleanTypTraits(TypTraits):
"""Edm.Boolean traits"""

# pylint: disable=no-self-use
def to_literal(self, value):
return 'true' if value else 'false'

# pylint: disable=no-self-use
def from_json(self, value):
return value

Expand All @@ -600,11 +591,9 @@ def from_literal(self, value):
class EdmIntTypTraits(TypTraits):
"""All Edm Integer traits"""

# pylint: disable=no-self-use
def to_literal(self, value):
return '%d' % (value)

# pylint: disable=no-self-use
def from_json(self, value):
return int(value)

Expand All @@ -615,11 +604,9 @@ def from_literal(self, value):
class EdmLongIntTypTraits(TypTraits):
"""All Edm Integer for big numbers traits"""

# pylint: disable=no-self-use
def to_literal(self, value):
return '%dL' % (value)

# pylint: disable=no-self-use
def from_json(self, value):
if value[-1] == 'L':
return int(value[:-1])
Expand Down Expand Up @@ -655,14 +642,12 @@ def edm_double():
def edm_single():
return EdmFPNumTypTraits(7, 'f', '{:f}')

# pylint: disable=no-self-use
def to_literal(self, value):
return self.conversion.format(value)

def to_json(self, value):
return self.to_literal(value)

# pylint: disable=no-self-use
def from_json(self, value):
if not isinstance(value, str) or value[-1] != self.suffix:
return float(value)
Expand All @@ -680,11 +665,9 @@ def __init__(self, edm_type=None):
super().__init__()
self._edm_type = edm_type

# pylint: disable=no-self-use
def to_literal(self, value):
return EdmStructTypeSerializer.to_literal(self._edm_type, value)

# pylint: disable=no-self-use
def from_json(self, value):
return EdmStructTypeSerializer.from_json(self._edm_type, value)

Expand Down Expand Up @@ -761,14 +744,12 @@ def item_type(self):
def traits(self):
return self

# pylint: disable=no-self-use
def to_literal(self, value):
if not isinstance(value, list):
raise PyODataException(f'Bad format: invalid list value {value}')

return [self._item_type.traits.to_literal(v) for v in value]

# pylint: disable=no-self-use
def from_json(self, value):
if not isinstance(value, list):
raise PyODataException(f'Bad format: invalid list value {value}')
Expand Down
Loading
Loading