Skip to content

Commit

Permalink
chore(lint): Fix W0611 (unused imports)
Browse files Browse the repository at this point in the history
Activate PyLint rule W0611 (unused imports) and fix the errors. Thank you to Manual (@feman323) for this contribution.

Related to #1755

---------

Co-authored-by: buhtz <[email protected]>
  • Loading branch information
feman323 and buhtz authored Aug 11, 2024
1 parent c39ba93 commit 61550f7
Show file tree
Hide file tree
Showing 18 changed files with 4 additions and 31 deletions.
1 change: 0 additions & 1 deletion common/config.py
Original file line number Diff line number Diff line change
Expand Up @@ -32,7 +32,6 @@
import datetime
import socket
import random
import textwrap
import getpass
import shlex
# Workaround: Mostly relevant on TravisCI but not exclusively.
Expand Down
3 changes: 0 additions & 3 deletions common/doc-dev/conf.py
Original file line number Diff line number Diff line change
Expand Up @@ -10,9 +10,6 @@
sys.path.insert(0, os.path.abspath(os.path.join(os.pardir)))
sys.path.insert(0, os.path.abspath(os.path.join(os.pardir, "plugins")))

# Import to solve race conditions between config an mount.
import config

# -- General configuration ------------------------------------------------

extensions = [
Expand Down
1 change: 0 additions & 1 deletion common/encfstools.py
Original file line number Diff line number Diff line change
Expand Up @@ -15,7 +15,6 @@
# 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA.

import os
import grp
import subprocess
import re
import shutil
Expand Down
3 changes: 0 additions & 3 deletions common/password.py
Original file line number Diff line number Diff line change
Expand Up @@ -18,9 +18,6 @@
import time
import atexit
import signal
import subprocess
import re
import errno
import config
import configfile
import tools
Expand Down
1 change: 1 addition & 0 deletions common/qt_probing.py
Original file line number Diff line number Diff line change
Expand Up @@ -101,6 +101,7 @@
# os.seteuid(1000)
# logger.debug(f"New euid: {os.geteuid()}")

# pylint: disable-next=unused-import
from PyQt6 import QtCore
from PyQt6.QtWidgets import QApplication

Expand Down
1 change: 0 additions & 1 deletion common/snapshots.py
Original file line number Diff line number Diff line change
Expand Up @@ -15,7 +15,6 @@
# You should have received a copy of the GNU General Public License along
# with this program; if not, write to the Free Software Foundation, Inc.,
# 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA.
import json
import os
from pathlib import Path
import stat
Expand Down
1 change: 0 additions & 1 deletion common/test/test_applicationinstance.py
Original file line number Diff line number Diff line change
Expand Up @@ -18,7 +18,6 @@
import subprocess
import os
import sys
import unittest
from unittest.mock import patch
from threading import Thread
from test import generic
Expand Down
1 change: 0 additions & 1 deletion common/test/test_backup.py
Original file line number Diff line number Diff line change
Expand Up @@ -17,7 +17,6 @@

import os
import sys
import unittest
from unittest.mock import patch, ANY
from datetime import datetime
from test import generic
Expand Down
3 changes: 0 additions & 3 deletions common/test/test_config.py
Original file line number Diff line number Diff line change
Expand Up @@ -20,13 +20,10 @@
import stat
import sys
import getpass
import unittest
from unittest import mock
from test import generic
from tempfile import TemporaryDirectory
sys.path.append(os.path.join(os.path.dirname(__file__), '..'))
import config


class TestConfig(generic.TestCaseCfg):
def test_set_snapshots_path_test_writes(self):
Expand Down
2 changes: 1 addition & 1 deletion common/test/test_lint.py
Original file line number Diff line number Diff line change
Expand Up @@ -91,7 +91,7 @@ def test_with_pylint(self):
'E1101', # no-member
'W0311', # bad-indentation
'I0021', # useless-suppression
# 'W0611', # unused-import
'W0611', # unused-import
'W1301', # unused-format-string-key
'W1401', # anomalous-backslash-in-string (invalid escape sequence)
'W1515', # forgotten-debug-statement
Expand Down
5 changes: 1 addition & 4 deletions common/test/test_plugin_usercallback.py
Original file line number Diff line number Diff line change
Expand Up @@ -4,20 +4,17 @@
from pathlib import Path
import stat
import io
from datetime import datetime
import unittest
import unittest.mock as mock
import json
from contextlib import redirect_stdout, redirect_stderr
from ast import literal_eval

# This workaround will become obsolet when migrating to src-layout
sys.path.append(str(Path(__file__).parent))
sys.path.append(str(Path(__file__).parent / 'plugins'))
import logger
import pluginmanager
from config import Config
from snapshots import Snapshots, SID
from snapshots import Snapshots
from usercallbackplugin import UserCallbackPlugin


Expand Down
2 changes: 0 additions & 2 deletions common/test/test_restore.py
Original file line number Diff line number Diff line change
Expand Up @@ -25,8 +25,6 @@
from test import generic

sys.path.append(os.path.join(os.path.dirname(__file__), '..'))
import config
import snapshots
import mount

CURRENTUID = os.geteuid()
Expand Down
2 changes: 0 additions & 2 deletions common/test/test_sid.py
Original file line number Diff line number Diff line change
Expand Up @@ -19,15 +19,13 @@
import sys
import unittest
import stat
import re
from datetime import date, datetime
from test import generic
from unittest.mock import patch

sys.path.append(os.path.join(os.path.dirname(__file__), '..'))
import configfile
import snapshots
import logger
from snapshotlog import LogFilter, SnapshotLog

class TestSID(generic.SnapshotsTestCase):
Expand Down
3 changes: 0 additions & 3 deletions common/test/test_snapshotlog.py
Original file line number Diff line number Diff line change
Expand Up @@ -17,15 +17,12 @@

import os
import sys
import unittest
import re
from test import generic
from tempfile import TemporaryDirectory
from datetime import datetime

sys.path.append(os.path.join(os.path.dirname(__file__), '..'))
import snapshotlog
import config
import snapshots


Expand Down
1 change: 0 additions & 1 deletion common/test/test_snapshots.py
Original file line number Diff line number Diff line change
Expand Up @@ -28,7 +28,6 @@
import unittest
from unittest.mock import patch
from datetime import date, datetime
from threading import Thread
from tempfile import TemporaryDirectory
from test import generic

Expand Down
3 changes: 1 addition & 2 deletions common/test/test_takeSnapshot.py
Original file line number Diff line number Diff line change
Expand Up @@ -17,10 +17,9 @@

import os
import sys
import stat
import unittest
from unittest.mock import patch
from datetime import date, datetime, timedelta
from datetime import datetime, timedelta
from tempfile import TemporaryDirectory
from test import generic

Expand Down
1 change: 0 additions & 1 deletion common/test/test_tools.py
Original file line number Diff line number Diff line change
Expand Up @@ -23,7 +23,6 @@
import gzip
import stat
import signal
import unittest
from unittest.mock import patch
from copy import deepcopy
from tempfile import NamedTemporaryFile, TemporaryDirectory
Expand Down
1 change: 0 additions & 1 deletion common/tools.py
Original file line number Diff line number Diff line change
Expand Up @@ -26,7 +26,6 @@
import re
import errno
import gzip
import tempfile
import locale
import gettext
from collections.abc import MutableSet
Expand Down

0 comments on commit 61550f7

Please sign in to comment.