GitHub Actions: Lint with ruff instead of flake8

pull/47/head
Christian Clauss 2023-11-27 18:09:26 +01:00
parent 9573327f65
commit ab1c75562f
5 changed files with 11 additions and 21 deletions

View File

@ -18,23 +18,17 @@ jobs:
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v3
- uses: actions/checkout@v4
- name: Set up Python 3.10
uses: actions/setup-python@v3
uses: actions/setup-python@v4
with:
python-version: "3.10"
- name: Install dependencies
run: |
python -m pip install --upgrade pip
pip install flake8 pytest tox
pip install pytest ruff tox
pip install -r requirements/test.txt
# Won't pass flake8 yet
# - name: Lint with flake8
# run: |
# # stop the build if there are Python syntax errors or undefined names
# flake8 . --count --select=E9,F63,F7,F82 --show-source --statistics
# # exit-zero treats all errors as warnings. The GitHub editor is 127 chars wide
# flake8 . --count --exit-zero --max-complexity=10 --max-line-length=127 --statistics
- name: Lint with ruff
run: ruff .
- name: Test with tox
run: |
tox
run: tox

View File

@ -156,7 +156,7 @@ def main():
if not args.C:
secure_socket.enable_crl(1)
secure_socket.load_crl_file(args.r, 1);
secure_socket.load_crl_file(args.r, 1)
secure_socket.connect((args.h, args.p))

View File

@ -21,10 +21,7 @@
# pylint: disable=wrong-import-position
import os
import sys
from setuptools import setup
from setuptools.command.build_ext import build_ext
import re
VERSIONFILE = "wolfssl/_version.py"

View File

@ -28,7 +28,7 @@ import sys
from functools import wraps
import errno
from socket import (
socket, AF_INET, SOCK_STREAM, SOL_SOCKET, SO_TYPE, error as socket_error
socket, AF_INET, SOCK_STREAM, error as socket_error
)
# pylint: disable=wildcard-import
@ -487,7 +487,7 @@ class SSLSocket(object):
"""
Returns True for server-side socket, otherwise False.
"""
return self._server_side;
return self._server_side
def dup(self):
raise NotImplementedError("Can't dup() %s instances" %
@ -998,5 +998,5 @@ class WolfsslPwd_cb(object):
for i in range(len(result)):
passwd[i] = result[i:i + 1]
return len(result)
except Exception as e:
except Exception:
raise ValueError("Problem getting password from callback")

View File

@ -22,7 +22,6 @@
# pylint: disable=missing-docstring, invalid-name
import argparse
from contextlib import contextmanager
from distutils.util import get_platform
from cffi import FFI
@ -105,7 +104,7 @@ def checkout_ref(ref):
current = subprocess.check_output(
["git", "describe", "--all", "--exact-match"]
).strip().decode().split('/')[-1]
except:
except Exception:
pass
if current != ref: