Skip to content

Commit

Permalink
Fix some linting results
Browse files Browse the repository at this point in the history
  • Loading branch information
white-gecko committed Mar 20, 2023
1 parent 2b38431 commit 94c5509
Show file tree
Hide file tree
Showing 13 changed files with 11 additions and 33 deletions.
13 changes: 5 additions & 8 deletions quit/conf.py
Original file line number Diff line number Diff line change
@@ -1,19 +1,16 @@
import logging

import os
from pygit2 import Repository, GIT_OBJ_BLOB, GIT_OBJ_TREE
from os import walk
from os.path import join, isfile, relpath
from quit.exceptions import MissingConfigurationError, InvalidConfigurationError
from pygit2 import GIT_OBJ_BLOB, GIT_OBJ_TREE
from os.path import join, isfile
from quit.exceptions import InvalidConfigurationError
from quit.exceptions import UnknownConfigurationError
from quit.helpers import isAbsoluteUri
from rdflib import Graph, ConjunctiveGraph, Literal, Namespace, URIRef, BNode
from rdflib import Graph, Literal, Namespace, URIRef
from rdflib.plugins.parsers import notation3
from rdflib.namespace import RDF, NamespaceManager
from rdflib.util import guess_format
from urllib.parse import quote, urlencode
from urllib.parse import quote
from rdflib.term import _is_valid_uri
from uritools import urisplit

logger = logging.getLogger('quit.conf')

Expand Down
5 changes: 0 additions & 5 deletions quit/core.py
Original file line number Diff line number Diff line change
Expand Up @@ -4,11 +4,6 @@

from copy import copy

from pygit2 import GIT_MERGE_ANALYSIS_UP_TO_DATE
from pygit2 import GIT_MERGE_ANALYSIS_FASTFORWARD
from pygit2 import GIT_MERGE_ANALYSIS_NORMAL
from pygit2 import GIT_SORT_REVERSE, GIT_RESET_HARD, GIT_STATUS_CURRENT

from rdflib import Graph, ConjunctiveGraph, BNode, Literal, URIRef
import re

Expand Down
4 changes: 2 additions & 2 deletions quit/git.py
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,7 @@
import re
import logging

from pygit2._pygit2 import GitError, Oid
from pygit2._pygit2 import GitError
from os.path import expanduser, join
from quit.exceptions import RepositoryNotFound, RevisionNotFound, NodeNotFound, RemoteNotFound
from quit.exceptions import QuitGitRefNotFound, QuitGitRepoError, QuitGitPushError
Expand Down Expand Up @@ -399,7 +399,7 @@ def merge(self, target=None, branch=None, method=None):
if target_ref.type == pygit2.GIT_REF_SYMBOLIC:
target_ref = target_ref.resolve()
target_ref.set_target(self.lookup(branch))
except KeyError as e:
except KeyError:
# If HEAD is unborn
if target_ref.type == pygit2.GIT_REF_SYMBOLIC:
target = target_ref.target
Expand Down
1 change: 0 additions & 1 deletion quit/graphs.py
Original file line number Diff line number Diff line change
@@ -1,5 +1,4 @@
import functools
import logging
from itertools import chain
from rdflib import Graph, ConjunctiveGraph, URIRef
from rdflib.graph import ModificationException
Expand Down
1 change: 0 additions & 1 deletion quit/helpers.py
Original file line number Diff line number Diff line change
Expand Up @@ -286,7 +286,6 @@ def parse_sparql_request(request):
type = None
default_graph = []
named_graph = []
accept_header = None

if request.method == "GET":
default_graph = request.args.getlist('default-graph-uri')
Expand Down
1 change: 0 additions & 1 deletion quit/merge.py
Original file line number Diff line number Diff line change
@@ -1,4 +1,3 @@
import os
import pygit2
import rdflib
import logging
Expand Down
2 changes: 1 addition & 1 deletion quit/plugins/serializers/results/htmlresults.py
Original file line number Diff line number Diff line change
Expand Up @@ -56,7 +56,7 @@ def qname(ctx, term):
else:
label = nm.compute_qname(term, False)
return u'%s:%s' % (label[0], label[2])
except Exception as e:
except Exception:
return term


Expand Down
2 changes: 0 additions & 2 deletions quit/utils.py
Original file line number Diff line number Diff line change
@@ -1,5 +1,4 @@
from __future__ import with_statement
from flask import Response
import os
import contextlib
import signal
Expand Down Expand Up @@ -159,7 +158,6 @@ def handler(signum, frame):
# ===============================================================

import unittest
import os

class TestOnExit(unittest.TestCase):

Expand Down
2 changes: 1 addition & 1 deletion quit/web/app.py
Original file line number Diff line number Diff line change
Expand Up @@ -205,7 +205,7 @@ def qname(ctx, t):
config = ctx.get('config')
link = config['quit'].store.store.compute_qname(t, False)
return u'%s:%s' % (link[0], link[2])
except Exception as e:
except Exception:
return t

if isinstance(t, rdflib.URIRef):
Expand Down
7 changes: 0 additions & 7 deletions quit/web/extras/commits_graph.py
Original file line number Diff line number Diff line change
Expand Up @@ -9,13 +9,6 @@

import json

from itertools import islice
from pygit2 import (
GIT_SORT_TIME,
GIT_SORT_TOPOLOGICAL,
GIT_SORT_REVERSE
)


class CommitGraph(object):
def __init__(self, sha, parents):
Expand Down
3 changes: 1 addition & 2 deletions quit/web/modules/debug.py
Original file line number Diff line number Diff line change
@@ -1,8 +1,7 @@
import sys
import traceback

from werkzeug.http import parse_accept_header
from flask import Blueprint, flash, redirect, request, url_for, current_app, make_response, Markup
from flask import Blueprint, request, current_app, make_response
from quit.conf import Feature
from quit.web.app import render_template, feature_required

Expand Down
2 changes: 1 addition & 1 deletion quit/web/modules/endpoint.py
Original file line number Diff line number Diff line change
Expand Up @@ -120,7 +120,7 @@ def sparql(branch_or_ref):
tmp_branch.delete()
response = make_response('success', 200)
target_branch = branch_or_ref
except QuitMergeConflict as e:
except QuitMergeConflict:
response = make_response('merge failed', 400)
else:
response = make_response('branched', 200)
Expand Down
1 change: 0 additions & 1 deletion setup.py
Original file line number Diff line number Diff line change
Expand Up @@ -12,7 +12,6 @@
Git.
"""
from setuptools import setup
import os

setup(
name='quit-store',
Expand Down

0 comments on commit 94c5509

Please sign in to comment.