Skip to content

Introduce lint #289

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Merged
merged 121 commits into from
Mar 30, 2023
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
Show all changes
121 commits
Select commit Hold shift + click to select a range
e4d3f48
pylint: remove old ignores
DifferentialOrange Sep 9, 2022
a33d031
test: add pylint dependency
DifferentialOrange Sep 9, 2022
a3b9e87
make: add lint command
DifferentialOrange Mar 27, 2023
a23eaec
pylint: fix trailing-whitespace cases
DifferentialOrange Mar 27, 2023
df6df52
pylint: fix invalid-name cases
DifferentialOrange Mar 28, 2023
759ce2b
pylint: allow some short variables
DifferentialOrange Mar 28, 2023
c70bbee
pylint: treat tz as a good name
DifferentialOrange Mar 28, 2023
ff06e42
pylint: allow unittest naming
DifferentialOrange Mar 28, 2023
de83057
pylint: allow dbapi constants
DifferentialOrange Mar 28, 2023
23a444f
pylint: allow sphinx constants
DifferentialOrange Mar 30, 2023
e52e35e
pylint: fix singleton-comparison cases
DifferentialOrange Mar 28, 2023
77f529d
pylint: fix consider-using-f-string cases
DifferentialOrange Mar 28, 2023
baa704a
pylint: fix consider-using-dict-items cases
DifferentialOrange Mar 28, 2023
a003d02
pylint: fix consider-using-enumerate cases
DifferentialOrange Mar 28, 2023
7b54c34
pylint: fix consider-iterating-dictionary cases
DifferentialOrange Mar 28, 2023
093fe2e
pylint: fix bad-classmethod-argument cases
DifferentialOrange Mar 28, 2023
a990309
pylint: fix superfluous-parens cases
DifferentialOrange Mar 28, 2023
f2a2789
pylint: fix multiple-statements cases
DifferentialOrange Mar 28, 2023
9153426
pylint: fix trailing-newlines cases
DifferentialOrange Mar 28, 2023
c757a6f
pylint: disable too-many-lines cases
DifferentialOrange Mar 28, 2023
8b1813f
pylint: fix wrong-import-order cases
DifferentialOrange Mar 28, 2023
929fcdf
pylint: fix wrong-import-position cases
DifferentialOrange Mar 28, 2023
8decb50
pylint: fix import-outside-toplevel case
DifferentialOrange Mar 28, 2023
9837991
pylint: ignore setup dependency import issues
DifferentialOrange Mar 28, 2023
2f66cb2
pylint: fix missing-module-docstring cases
DifferentialOrange Mar 28, 2023
81dc3f7
internal: rework protocol greeting
DifferentialOrange Mar 28, 2023
c4a03b6
internal: rework join stages
DifferentialOrange Mar 28, 2023
98ea2fa
pylint: fix missing-class-docstring cases
DifferentialOrange Mar 28, 2023
8f47962
pylint: fix missing-function-docstring cases
DifferentialOrange Mar 28, 2023
c97048c
pylint: disable missing-class-docstring for tests
DifferentialOrange Mar 28, 2023
d0b676b
pylint: disable missing-function-docstring for tests
DifferentialOrange Mar 28, 2023
593e0c7
schema: make internals consistent
DifferentialOrange Mar 28, 2023
1099c69
pylint: fix dangerous-default-value cases
DifferentialOrange Mar 28, 2023
9208979
pylint: fix pointless-string-statement case
DifferentialOrange Mar 28, 2023
bf3eedc
pylint: fix unnecessary-pass cases
DifferentialOrange Mar 28, 2023
515e83b
pylint: fix unused-variable cases
DifferentialOrange Mar 28, 2023
7dd3537
pylint: fix unused-import cases
DifferentialOrange Mar 28, 2023
0a4257b
pylint: disable unused-argument cases
DifferentialOrange Mar 28, 2023
adc246d
api: only named on_push and on_push_ctx
DifferentialOrange Mar 28, 2023
8a7332e
pylint: fix arguments-differ case
DifferentialOrange Mar 28, 2023
46de153
pylint: fix attribute-defined-outside-init cases
DifferentialOrange Mar 28, 2023
6db3893
pylint: fix protected-access cases
DifferentialOrange Mar 28, 2023
5fd9949
pylint: disable protected-access for warning impl
DifferentialOrange Mar 28, 2023
a64cfb8
pylint: disable protected-access for unittest workaround
DifferentialOrange Mar 28, 2023
d66ef66
pylint: disable protected-access for tests
DifferentialOrange Mar 28, 2023
ba468f2
pylint: fix pointless-string-statement case
DifferentialOrange Mar 28, 2023
70afa1f
pylint: fix abstract-method cases
DifferentialOrange Mar 28, 2023
dd1ab29
pylint: fix bad-indentation cases
DifferentialOrange Mar 28, 2023
2b66007
pylint: fix unnecessary-semicolon cases
DifferentialOrange Mar 28, 2023
7cc1a68
pylint: disable fixme cases
DifferentialOrange Mar 28, 2023
d734e0a
api: migrate to built-in Warning
DifferentialOrange Mar 28, 2023
213bc24
api: migrate to built-in RecursionError
DifferentialOrange Mar 28, 2023
fdbfb23
pylint: disable redefined-builtin for sphinx
DifferentialOrange Mar 30, 2023
08c2e26
pylint: fix redefined-builtin case
DifferentialOrange Mar 28, 2023
037ea87
test: remove outdated workarounds
DifferentialOrange Mar 28, 2023
9dc1662
pylint: fix unused-wildcard-import case
DifferentialOrange Mar 28, 2023
cc878cf
pylint: disable cell-var-from-loop cases in tests
DifferentialOrange Mar 28, 2023
f390a76
pylint: fix raise-missing-from cases
DifferentialOrange Mar 29, 2023
fc50610
pylint: disable broad-exception-caught in code
DifferentialOrange Mar 29, 2023
2e5e064
pylint: disable broad-exception-caught in tests
DifferentialOrange Mar 29, 2023
c5fcbee
pylint: fix bare-except case
DifferentialOrange Mar 29, 2023
f82ff37
pylint: fix broad-exception-raised cases
DifferentialOrange Mar 29, 2023
79a34fb
pylint: fix useless-object-inheritance cases
DifferentialOrange Mar 29, 2023
a52f868
pylint: disable too-few-public-methods cases
DifferentialOrange Mar 29, 2023
5ea42e7
pylint: disable too-many-instance-attributes cases
DifferentialOrange Mar 29, 2023
15c22a1
pylint: disable too-many-public-methods cases
DifferentialOrange Mar 29, 2023
8fb26e9
pylint: fix too-many-return-statements case
DifferentialOrange Mar 29, 2023
ecd4cb0
pylint: disable too-many-return-statements case
DifferentialOrange Mar 29, 2023
db3c630
pylint: disable too-many-branches cases
DifferentialOrange Mar 29, 2023
8b05e2b
pylint: disable too-many-arguments cases
DifferentialOrange Mar 29, 2023
77cbf3d
pylint: disable too-many-locals cases
DifferentialOrange Mar 29, 2023
e85ef57
pylint: disable too-many-statements case in test
DifferentialOrange Mar 29, 2023
8df6454
pylint: disable too-many-boolean-expressions case
DifferentialOrange Mar 29, 2023
bc3422d
pylint: fix consider-using-from-import case
DifferentialOrange Mar 29, 2023
0426f9b
pylint: fix access-member-before-definition case
DifferentialOrange Mar 29, 2023
89aca2a
pylint: fix function-redefined case
DifferentialOrange Mar 29, 2023
24435c0
pylint: fix inconsistent-return-statements cases
DifferentialOrange Mar 29, 2023
17260aa
internal: move validate script to bash
DifferentialOrange Mar 29, 2023
b62110d
pylint: fix inconsistent-return-statements cases
DifferentialOrange Mar 29, 2023
7d731f2
pylint: fix consider-using-in cases
DifferentialOrange Mar 29, 2023
cce69dd
pylint: fix use-dict-literal cases
DifferentialOrange Mar 29, 2023
4d6ace5
pylint: fix super-with-arguments cases
DifferentialOrange Mar 29, 2023
8aa29ed
pylint: fix use-list-literal cases
DifferentialOrange Mar 29, 2023
c8e01bb
pylint: fix consider-merging-isinstance case
DifferentialOrange Mar 29, 2023
1f8a663
pylint: fix no-else-return cases
DifferentialOrange Mar 29, 2023
83fbffe
pylint: fix no-else-raise cases
DifferentialOrange Mar 29, 2023
8e172a3
pylint: disable consider-using-with cases
DifferentialOrange Mar 29, 2023
35ce3f5
pylint: fix keyword-arg-before-vararg cases
DifferentialOrange Mar 29, 2023
df28e85
pylint: fix redundant-u-string-prefix cases
DifferentialOrange Mar 29, 2023
55c0097
pylint: fix unspecified-encoding cases
DifferentialOrange Mar 29, 2023
37757a7
setup: migrate from distutils
DifferentialOrange Mar 29, 2023
663404a
pylint: fix unnecessary-lambda-assignment cases
DifferentialOrange Mar 29, 2023
4aba358
pylint: fix no-member case
DifferentialOrange Mar 29, 2023
6481107
pylint: fix unnecessary-dunder-call case
DifferentialOrange Mar 29, 2023
a9f6073
pylint: disable too-many-function-args cases in tests
DifferentialOrange Mar 29, 2023
654a7a2
pylint: allow long links and tables in docstrings
DifferentialOrange Mar 29, 2023
7f45688
pylint: fix line-too-long cases
DifferentialOrange Mar 29, 2023
9515c07
pylint: disable line-too-long cases
DifferentialOrange Mar 29, 2023
237c743
pylint: disable duplicate-code cases in code
DifferentialOrange Mar 29, 2023
9b88578
pylint: disable duplicate-code cases in tests
DifferentialOrange Mar 29, 2023
4f613c7
pylint: disable no-self-use cases
DifferentialOrange Mar 30, 2023
9e77009
pylint: compatibility workaround
DifferentialOrange Mar 30, 2023
f2e9592
test: add flake8 dependency
DifferentialOrange Mar 30, 2023
2d9e4b0
make: additional lint with flake8
DifferentialOrange Mar 30, 2023
b1a0e4f
flake8: ignore line too long cases
DifferentialOrange Mar 30, 2023
1dfc286
flake8: ignore rule in configuration template
DifferentialOrange Mar 30, 2023
aaf4985
flake8: ignore outdated rule
DifferentialOrange Mar 30, 2023
3dc0d75
flake8: fix local variable unused cases
DifferentialOrange Mar 30, 2023
151c8b7
flake8: fix style
DifferentialOrange Mar 30, 2023
022a18e
flake8: disable import unused in dbapi
DifferentialOrange Mar 30, 2023
d365bee
flake8: fix unused import cases
DifferentialOrange Mar 30, 2023
605d24e
test: add codespell dependency
DifferentialOrange Mar 30, 2023
702617c
make: additional lint with codespell
DifferentialOrange Mar 30, 2023
8851e3d
codespell: resolve spell issues
DifferentialOrange Mar 30, 2023
18da2b8
pylint: fix remaining compatibility issues
DifferentialOrange Mar 30, 2023
7c2c0a5
flake8: fix compatibility issues
DifferentialOrange Mar 30, 2023
6ec38b5
codespell: fix compatibility issues
DifferentialOrange Mar 30, 2023
21c4225
make: run lint before tests
DifferentialOrange Mar 30, 2023
4837024
test: fix lint reworks
DifferentialOrange Mar 30, 2023
c0f2fe2
setup: fix lint reworks
DifferentialOrange Mar 30, 2023
fc4d6e8
pylint: fix Windows compatibility
DifferentialOrange Mar 30, 2023
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
3 changes: 3 additions & 0 deletions .codespellrc
Original file line number Diff line number Diff line change
@@ -0,0 +1,3 @@
[codespell]
skip = tarantool/msgpack_ext/types/timezones/timezones.py
ignore-words-list = ans,gost,ro
3 changes: 3 additions & 0 deletions .flake8
Original file line number Diff line number Diff line change
@@ -0,0 +1,3 @@
[flake8]
# Use pylint for lines length check
ignore=E501,W503
2 changes: 1 addition & 1 deletion .github/workflows/testing.yml
Original file line number Diff line number Diff line change
Expand Up @@ -37,7 +37,7 @@ jobs:
- ''

# Adding too many elements to three-dimentional matrix results in
# too many test cases. It causes GitHub webpages to fail with
# too many test cases. It causes GitHub webpages to fail with
# "This page is taking too long to load." error. Thus we use
# pairwise testing.
include:
Expand Down
8 changes: 8 additions & 0 deletions .pylintrc
Original file line number Diff line number Diff line change
@@ -0,0 +1,8 @@
[BASIC]

# Good variable names which should always be accepted, separated by a comma
good-names=i,j,k,ex,Run,_,ok,t,tz

[FORMAT]
# Allow links in docstings, allow tables
ignore-long-lines=^(?:\s*(# )?(?:\.\.\s.+?:)?\s*<?https?://\S+>?)|(\s\+.+\+)|(\s\|.+\|)$
12 changes: 10 additions & 2 deletions CHANGELOG.md
Original file line number Diff line number Diff line change
Expand Up @@ -4,10 +4,18 @@ All notable changes to this project will be documented in this file.
The format is based on [Keep a Changelog](https://keepachangelog.com/en/1.0.0/),
and this project adheres to [Semantic Versioning](https://semver.org/spec/v2.0.0.html).

## Unreleased

### Changed
- **Breaking**: Allow only named `on_push` and `on_push_ctx` for `insert` and `replace`.
- Migrate to built-in `Warning` instead of a custom one.
- Migrate to built-in `RecursionError` instead of a custom one.
- Collect full exception traceback.

## 0.12.1 - 2023-02-28

### Changed
- Discovery iproto features only for Tarantools since version 2.10.0 (#283).
- Discovery iproto features only for Tarantools since version 2.10.0 (#283).

### Fixed
- Schema fetch for spaces with foreign keys (#282).
Expand Down Expand Up @@ -352,7 +360,7 @@ and this project adheres to [Semantic Versioning](https://semver.org/spec/v2.0.0
- Various improvements and fixes in README (PR #210, PR #215).

### Fixed
- json.dumps compatibility with Python 2 (PR #186).
- json.dumps compatibility with Python 2 (PR #186).
- Unix socket support in mesh_connection (PR #189, #111).
- Various fixes in tests (PR #189, #111, PR #195, #194).

Expand Down
11 changes: 10 additions & 1 deletion Makefile
Original file line number Diff line number Diff line change
Expand Up @@ -3,8 +3,17 @@ install:
pip3 install --editable .


PYTHON_FILES=tarantool test setup.py docs/source/conf.py
TEXT_FILES=README.rst docs/source/*.rst
.PHONY: lint
lint:
python3 -m pylint --recursive=y $(PYTHON_FILES)
python3 -m flake8 $(PYTHON_FILES)
codespell $(PYTHON_FILES) $(TEXT_FILES)


.PHONY: test
test:
test: lint
python3 setup.py test

.PHONY: test-pure-install
Expand Down
2 changes: 1 addition & 1 deletion README.rst
Original file line number Diff line number Diff line change
Expand Up @@ -86,7 +86,7 @@ You can also install the development version of the package using ``pip``.
What is Tarantool?
------------------

`Tarantool`_ is an in-memory computing platform originally designed by
`Tarantool`_ is an in-memory computing platform originally designed by
`VK`_ and released under the terms of `BSD license`_.

Features
Expand Down
4 changes: 2 additions & 2 deletions debian/changelog
Original file line number Diff line number Diff line change
Expand Up @@ -290,7 +290,7 @@ tarantool-python (0.9.0-0) unstable; urgency=medium
transport="ssl",
ssl_ca_file=client_ca_file)
```

If the server authenticates clients using certificates issued by
given CA, you must provide private SSL key file with `ssl_key_file`
parameter and SSL certificate file with `ssl_cert_file` parameter.
Expand Down Expand Up @@ -351,7 +351,7 @@ tarantool-python (0.9.0-0) unstable; urgency=medium
```

See [Tarantool Enterprise Edition manual](https://www.tarantool.io/en/enterprise_doc/security/#enterprise-iproto-encryption)
for details.
for details.

## Breaking changes

Expand Down
2 changes: 1 addition & 1 deletion debian/rules
Original file line number Diff line number Diff line change
Expand Up @@ -14,7 +14,7 @@ override_dh_auto_build:
python3 setup.py build --force

override_dh_auto_install:
python3 setup.py install --force --root=debian/python3-tarantool --no-compile -O0 --install-layout=deb --prefix=/usr
python3 setup.py install --force --root=debian/python3-tarantool --no-compile -O0 --install-layout=deb --prefix=/usr

override_dh_python2:
dh_python2 --no-guessing-versions
48 changes: 25 additions & 23 deletions docs/source/conf.py
Original file line number Diff line number Diff line change
@@ -1,15 +1,19 @@
# Tarantool python client library documentation build configuration file, created by
# sphinx-quickstart on Tue Nov 29 06:29:57 2011.
#
# This file is execfile()d with the current directory set to its containing dir.
#
# Note that not all possible configuration values are present in this
# autogenerated file.
#
# All configuration values have a default; values that are commented out
# serve to show the default.

import sys, os
"""
Tarantool python client library documentation build configuration file, created by
sphinx-quickstart on Tue Nov 29 06:29:57 2011.

This file is execfile()d with the current directory set to its containing dir.

Note that not all possible configuration values are present in this
autogenerated file.

All configuration values have a default; values that are commented out
serve to show the default.
"""
# pylint: disable=invalid-name,redefined-builtin,duplicate-code
# flake8: noqa: E265

import tarantool

# If extensions (or modules to document with autodoc) are in another directory,
# add these directories to sys.path here. If the directory is relative to the
Expand Down Expand Up @@ -45,15 +49,13 @@
master_doc = 'index'

# General information about the project.
project = u'Tarantool python client library'
copyright = u'2011-2022, tarantool-python AUTHORS'
project = 'Tarantool python client library'
copyright = '2011-2022, tarantool-python AUTHORS'

# The version info for the project you're documenting, acts as replacement for
# |version| and |release|, also used in various other places throughout the
# built documents.

import tarantool

# The short X.Y version.
version = tarantool.__version__
# The full version, including alpha/beta/rc tags.
Expand Down Expand Up @@ -126,7 +128,7 @@
# pixels large.
#html_favicon = None

# Set up favicons with sphinx_favicon.
# Set up favicons with sphinx_favicon.
favicons = [
{
"rel": "icon",
Expand Down Expand Up @@ -279,8 +281,8 @@
# Grouping the document tree into LaTeX files. List of tuples
# (source start file, target name, title, author, documentclass [howto/manual]).
latex_documents = [
('index', 'Tarantoolpythonclientlibrary.tex', u'Tarantool python client library Documentation',
u'tarantool-python AUTHORS', 'manual'),
('index', 'Tarantoolpythonclientlibrary.tex', 'Tarantool python client library Documentation',
'tarantool-python AUTHORS', 'manual'),
]

# The name of an image file (relative to this directory) to place at the top of
Expand Down Expand Up @@ -309,8 +311,8 @@
# One entry per manual page. List of tuples
# (source start file, name, description, authors, manual section).
man_pages = [
('index', 'tarantoolpythonclientlibrary', u'Tarantool python client library Documentation',
[u'tarantool-python AUTHORS'], 1)
('index', 'tarantoolpythonclientlibrary', 'Tarantool python client library Documentation',
['tarantool-python AUTHORS'], 1)
]

# If true, show URL addresses after external links.
Expand All @@ -323,8 +325,8 @@
# (source start file, target name, title, author,
# dir menu entry, description, category)
texinfo_documents = [
('index', 'Tarantoolpythonclientlibrary', u'Tarantool python client library Documentation',
u'tarantool-python AUTHORS', 'Tarantoolpythonclientlibrary', 'One line description of project.',
('index', 'Tarantoolpythonclientlibrary', 'Tarantool python client library Documentation',
'tarantool-python AUTHORS', 'Tarantoolpythonclientlibrary', 'One line description of project.',
'Miscellaneous'),
]

Expand Down
4 changes: 2 additions & 2 deletions docs/source/index.rst
Original file line number Diff line number Diff line change
Expand Up @@ -5,7 +5,7 @@ Python client library for Tarantool

:Version: |version|

`Tarantool`_ is an in-memory computing platform originally designed by
`Tarantool`_ is an in-memory computing platform originally designed by
`VK`_ and released under the terms of `BSD license`_.

Install Tarantool Python connector with ``pip`` (`PyPI`_ page):
Expand Down Expand Up @@ -78,7 +78,7 @@ API Reference

.. Indices and tables
.. ==================
..
..
.. * :ref:`genindex`
.. * :ref:`modindex`
.. * :ref:`search`
Expand Down
Loading