From b4160a6f84ca5c19c228aca3282dc181027ab4c3 Mon Sep 17 00:00:00 2001 From: David Barnett Date: Thu, 22 Aug 2024 22:01:21 -0600 Subject: [PATCH] Clean up flake8 config and fix violations (long lines, unused imports, etc) --- gcalcli/argparsers.py | 3 ++- gcalcli/gcal.py | 17 ++++++++--------- setup.cfg | 6 ++++++ tox.ini | 6 ------ 4 files changed, 16 insertions(+), 16 deletions(-) diff --git a/gcalcli/argparsers.py b/gcalcli/argparsers.py index a0aeb9b..e38e383 100644 --- a/gcalcli/argparsers.py +++ b/gcalcli/argparsers.py @@ -286,7 +286,8 @@ def get_argument_parser(): sub.add_parser( 'search', parents=[details_parser, output_parser, search_parser], help='search for events within an optional time period', - description='Provides case insensitive search for calendar events.') + description='Provides case insensitive search for calendar ' + 'events.') sub.add_parser( 'edit', parents=[details_parser, output_parser, search_parser], help='edit calendar events', diff --git a/gcalcli/gcal.py b/gcalcli/gcal.py index b95e9e5..ebc50f9 100644 --- a/gcalcli/gcal.py +++ b/gcalcli/gcal.py @@ -13,17 +13,15 @@ from typing import List from unicodedata import east_asian_width -from googleapiclient.discovery import build -from googleapiclient.errors import HttpError from dateutil.parser import parse from dateutil.relativedelta import relativedelta from dateutil.tz import tzlocal -import httplib2 from google_auth_oauthlib.flow import InstalledAppFlow from googleapiclient.discovery import build +from googleapiclient.errors import HttpError from google.auth.transport.requests import Request -from . import __program__, __version__, actions, utils +from . import actions, utils from ._types import Cache, CalendarListEntry from .actions import ACTIONS from .conflicts import ShowConflicts @@ -132,7 +130,6 @@ def _retry_with_backoff(self, method): return None def _google_auth(self): - from argparse import Namespace if not self.credentials: if self.options['config_folder']: oauth_filepath = os.path.expanduser( @@ -149,10 +146,12 @@ def _google_auth(self): "installed": { "client_id": self.options['client_id'], "client_secret": self.options['client_secret'], - "auth_uri":"https://accounts.google.com/o/oauth2/auth", - "token_uri":"https://oauth2.googleapis.com/token", - "auth_provider_x509_cert_url":"https://www.googleapis.com/oauth2/v1/certs", - "redirect_uris":["http://localhost"] + "auth_uri": + "https://accounts.google.com/o/oauth2/auth", + "token_uri": "https://oauth2.googleapis.com/token", + "auth_provider_x509_cert_url": + "https://www.googleapis.com/oauth2/v1/certs", + "redirect_uris": ["http://localhost"] } }, scopes=['https://www.googleapis.com/auth/calendar'] diff --git a/setup.cfg b/setup.cfg index fdeac0e..7814c3e 100644 --- a/setup.cfg +++ b/setup.cfg @@ -1,2 +1,8 @@ [flake8] import-order-style = google +exclude = + .git, + __pycache__, + venv, + .tox, + .venv diff --git a/tox.ini b/tox.ini index 9b19a30..34afb90 100644 --- a/tox.ini +++ b/tox.ini @@ -12,9 +12,3 @@ deps = pytest commands=py.test -vv --cov=./gcalcli --pyargs tests {posargs} coverage html flake8 - -[flake8] -exclude=.git,__pycache__,venv,.tox,.venv -per-file-ignores=details.py:D102 - -# don't want to create a docstring for every implementation of a virtual base method