diff --git a/.flake8 b/.flake8 index 7c36ff61a5c..280d141fb5d 100644 --- a/.flake8 +++ b/.flake8 @@ -1,5 +1,14 @@ [flake8] max-line-length = 120 -select=E901,E999,F821,F822,F823,I100,I101,I201,I202,T001,T002,T003,T004 -ignore=E203,W503,C0330 -application-import-names=tribler,run_tribler +extend-ignore = + I202, # Additional newline in a group of imports + E127, # continuation line over-indented for visual indent + E128, # continuation line under-indented for visual indent + E131, # continuation line unaligned for hanging indent + F722, # syntax error in forward annotation '20s' + E731, # do not assign a lambda expression, use a def + F401, # Pylint-checked, module imported but unused + F841, # Pylint-checked, local variable is assigned to but never used + E722, # Pylint-checked, do not use bare 'except' + E501 # Pylint-checked, line too long +import-order-style=pycharm diff --git a/.isort.cfg b/.isort.cfg deleted file mode 100644 index 41aa578c58e..00000000000 --- a/.isort.cfg +++ /dev/null @@ -1,13 +0,0 @@ -[settings] -order_by_type = False -multi_line_output=3 -case_sensitive = True -include_trailing_comma=True -force_grid_wrap=0 -use_parentheses = True -combine_as_imports=True -force_sort_within_sections=True -line_length=120 -known_future_library=future -known_first_party=tribler,run_tribler -known_third_party=pony,twisted,six,anydex,ipv8,libtorrent,lz4,PyQt5,zope,aiohttp,psutil,configobj,ipv8_service,asynctest,numpy,networkx,async_timeout,cherrypy,nose,validate,check_os,matplotlib,pyqtgraph,_socket,aiohttp_apispec,marshmallow,PIL,anyio,freezegun,yaml diff --git a/.pre-commit-config.yaml b/.pre-commit-config.yaml deleted file mode 100644 index 92a6b8d97e9..00000000000 --- a/.pre-commit-config.yaml +++ /dev/null @@ -1,49 +0,0 @@ -default_language_version: - python: python3 -repos: -- repo: https://github.com/Tribler/mirrors-autoflake - rev: v1.4 - hooks: - - id: autoflake - args: ['--in-place', '--remove-all-unused-imports', '--remove-unused-variable'] - types: [file, python] - -- repo: https://github.com/Tribler/isort - rev: 4.3.21-3-tribler - hooks: - - id: isort - types: [file, python] - -- repo: https://github.com/ambv/black - rev: 20.8b1 - hooks: - - id: black - files: | - (?x)( - ^src/tribler/gui/ - ) - types: [file, python] - -- repo: https://gitlab.com/pycqa/flake8 - rev: 3.9.0 - hooks: - - id: flake8 - types: [file, python] - additional_dependencies: [ - 'flake8-import-order==0.18.1', - 'flake8-print', - ] - -- repo: local - hooks: - - id: pylint - name: pylint - entry: pylint - language: system - files: | - (?x)( - ^src/tribler/gui/| - ^src/tribler/core/ - ) - types: [file, python] - diff --git a/src/tribler/gui/upgrade_manager.py b/src/tribler/gui/upgrade_manager.py index a6e1bbadf2f..96feb808fe5 100644 --- a/src/tribler/gui/upgrade_manager.py +++ b/src/tribler/gui/upgrade_manager.py @@ -4,10 +4,9 @@ from PyQt5.QtCore import QObject, QThread, pyqtSignal from PyQt5.QtWidgets import QMessageBox -from tribler.run_tribler_upgrader import upgrade_state_dir from tribler.core.upgrade.version_manager import TriblerVersion, VersionHistory - from tribler.gui.utilities import connect, format_size, tr +from tribler.run_tribler_upgrader import upgrade_state_dir class StateDirUpgradeWorker(QObject):