mirror of
https://github.com/Hopiu/linkchecker.git
synced 2026-05-04 04:44:42 +00:00
commit
6ada5d9517
12 changed files with 29 additions and 11 deletions
2
.github/workflows/build.yml
vendored
2
.github/workflows/build.yml
vendored
|
|
@ -149,6 +149,8 @@ jobs:
|
|||
matrix:
|
||||
toxenv:
|
||||
- flake8
|
||||
- check-python-versions
|
||||
- pylint
|
||||
- yamllint
|
||||
|
||||
steps:
|
||||
|
|
|
|||
5
.pylintrc
Normal file
5
.pylintrc
Normal file
|
|
@ -0,0 +1,5 @@
|
|||
[TYPECHECK]
|
||||
ignored-modules=meliae, win32com.client, yappi
|
||||
|
||||
[VARIABLES]
|
||||
additional-builtins=_, _n
|
||||
|
|
@ -234,9 +234,7 @@ def better_exchook(etype, value, tb, out=sys.stdout):
|
|||
else:
|
||||
line = f"{etype}: {valuestr}"
|
||||
return line
|
||||
if (isinstance(etype, BaseException) or
|
||||
(hasattr(types, "InstanceType") and isinstance(etype, types.InstanceType)) or
|
||||
etype is None or type(etype) is str):
|
||||
if isinstance(etype, BaseException) or etype is None or type(etype) is str:
|
||||
output(_format_final_exc_line(etype, value), out=out)
|
||||
else:
|
||||
output(_format_final_exc_line(etype.__name__, value), out=out)
|
||||
|
|
|
|||
|
|
@ -41,7 +41,7 @@ ExcCacheList = [
|
|||
EOFError,
|
||||
# http errors
|
||||
requests.exceptions.RequestException,
|
||||
requests.packages.urllib3.exceptions.HTTPError,
|
||||
requests.packages.urllib3.exceptions.HTTPError, # pylint: disable=no-member
|
||||
# ftp errors
|
||||
ftplib.Error,
|
||||
# idna.encode(), called from socket.create_connection()
|
||||
|
|
|
|||
|
|
@ -26,6 +26,7 @@ import requests
|
|||
import warnings
|
||||
|
||||
warnings.simplefilter(
|
||||
# pylint: disable=no-member
|
||||
'ignore', requests.packages.urllib3.exceptions.InsecureRequestWarning
|
||||
)
|
||||
|
||||
|
|
|
|||
|
|
@ -16,6 +16,8 @@
|
|||
"""
|
||||
Base URL handler.
|
||||
"""
|
||||
# pylint: disable=assignment-from-none, catching-non-exception, no-member
|
||||
|
||||
import sys
|
||||
import os
|
||||
import urllib.parse
|
||||
|
|
|
|||
|
|
@ -397,9 +397,8 @@ class ArgParser(LCArgumentParser):
|
|||
group.add_argument(
|
||||
"-p",
|
||||
"--password",
|
||||
action="store_false",
|
||||
action="store_true",
|
||||
dest="password",
|
||||
default=False,
|
||||
help=_(
|
||||
"Read a password from console and use it for HTTP and FTP authorization.\n"
|
||||
"For FTP the default password is 'anonymous@'. For HTTP there is\n"
|
||||
|
|
|
|||
|
|
@ -28,7 +28,6 @@ from .. import LOG_CMDLINE
|
|||
from .. import get_link_pat, log
|
||||
|
||||
from ..cmdline import print_version, print_usage, print_plugins
|
||||
from ..director import console
|
||||
|
||||
|
||||
def has_encoding(encoding):
|
||||
|
|
@ -164,7 +163,7 @@ def setup_config(config, options):
|
|||
}
|
||||
else:
|
||||
msg = _("Enter LinkChecker HTTP/FTP password:")
|
||||
_password = getpass.getpass(console.encode(msg))
|
||||
_password = getpass.getpass(msg)
|
||||
constructauth = True
|
||||
if options.quiet:
|
||||
config["logger"] = config.logger_new("none")
|
||||
|
|
|
|||
|
|
@ -304,8 +304,7 @@ class Configuration(dict):
|
|||
|
||||
def sanitize_ssl(self):
|
||||
"""Use local installed certificate file if available.
|
||||
Tries to get system, then certifi, then the own
|
||||
installed certificate file."""
|
||||
Tries to get system, then certifi certificate file."""
|
||||
if self["sslverify"] is True:
|
||||
try:
|
||||
self["sslverify"] = get_system_cert_file()
|
||||
|
|
|
|||
|
|
@ -138,7 +138,7 @@ class WordParser(_ParserPlugin):
|
|||
raise Error("could not open word file %r" % filename)
|
||||
try:
|
||||
for link in doc.Hyperlinks:
|
||||
line = get_line_number(link.Range)
|
||||
line = get_line_number(doc, link.Range)
|
||||
name = link.TextToDisplay
|
||||
url_data.add_url(link.Address, name=name, line=line)
|
||||
finally:
|
||||
|
|
|
|||
|
|
@ -16,6 +16,7 @@
|
|||
"""
|
||||
Test dummy object.
|
||||
"""
|
||||
# pylint: disable=no-member, not-callable
|
||||
|
||||
import unittest
|
||||
|
||||
|
|
|
|||
12
tox.ini
12
tox.ini
|
|
@ -28,6 +28,18 @@ deps = flake8
|
|||
skip_install = true
|
||||
commands = flake8 {posargs}
|
||||
|
||||
[testenv:check-python-versions]
|
||||
deps = check-python-versions
|
||||
skip_install = true
|
||||
commands = check-python-versions {posargs}
|
||||
|
||||
[testenv:pylint]
|
||||
deps =
|
||||
pylint
|
||||
-rrequirements.txt
|
||||
skip_install = true
|
||||
commands = pylint {posargs} -E linkcheck
|
||||
|
||||
[testenv:yamllint]
|
||||
deps = yamllint
|
||||
skip_install = true
|
||||
|
|
|
|||
Loading…
Reference in a new issue