Add flake8

This commit is contained in:
Quantum 2020-02-20 08:15:32 +00:00
parent 18f5e3873e
commit d6a08d43cb
3 changed files with 28 additions and 6 deletions

7
.flake8 Normal file
View file

@ -0,0 +1,7 @@
[flake8]
max-line-length = 120
import-order-style = pycharm
enable-extensions = G
ignore =
W504, # line break occurred after a binary operator
C814 # missing trailing comma in Python 2 only

18
.github/workflows/flake8.yml vendored Normal file
View file

@ -0,0 +1,18 @@
name: flake8
on: [push, pull_request]
jobs:
build:
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v1
- name: Set up Python 3.8
uses: actions/setup-python@v1
with:
python-version: 3.8
- name: Install flake8
run: |
pip install flake8 flake8-import-order flake8-commas flake8-logging-format
- name: Run flake8
run: |
flake8 --version
flake8

View file

@ -4,16 +4,13 @@ import hashlib
import hmac import hmac
import logging import logging
import os import os
import time
import socket
import struct import struct
import sys import time
from urllib.parse import quote
import gssapi import gssapi
import ldap import ldap
from flask import Flask, request, redirect, url_for, Response from flask import Flask, Response, redirect, request
from gssapi.exceptions import GSSError, GeneralError, BadMechanismError from gssapi.exceptions import BadMechanismError, GSSError, GeneralError
app = Flask(__name__) app = Flask(__name__)
app.logger.setLevel(logging.INFO) app.logger.setLevel(logging.INFO)