Skip to content
Closed
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
8 changes: 5 additions & 3 deletions .github/workflows/python-cleanliness.yml
Original file line number Diff line number Diff line change
Expand Up @@ -11,15 +11,17 @@ jobs:
runs-on: ubuntu-22.04

steps:
# git checkout the PR
- uses: actions/checkout@v5
with:
submodules: 'recursive'

# Run flake8 but exclude git submodules and third-party libraries
- run: pipx run flake8 --show-source --exclude=MAVProxy/modules/mavproxy_cesium

- name: Install dependencies
run: |
python -m pip install -U flake8
python -m pip install --upgrade flake8

- name: Check Python with Flake8
run: |
scripts/run_flake8.py MAVProxy
scripts/run_flake8.py MAVProxy
1 change: 1 addition & 0 deletions MAVProxy/modules/lib/ANUGA/geo_reference.py
Original file line number Diff line number Diff line change
Expand Up @@ -4,6 +4,7 @@

"""

# flake8: noqa

#FIXME: Ensure that all attributes of a georef are treated everywhere
#and unit test
Expand Down
2 changes: 2 additions & 0 deletions MAVProxy/modules/lib/ANUGA/lat_long_UTM_conversion.py
Original file line number Diff line number Diff line change
Expand Up @@ -5,6 +5,8 @@
# see http://www.pygps.org
#

# flake8: noqa

from math import pi, sin, cos, tan, sqrt

#LatLong- UTM conversion..h
Expand Down
2 changes: 2 additions & 0 deletions MAVProxy/modules/lib/ANUGA/redfearn.py
Original file line number Diff line number Diff line change
Expand Up @@ -12,6 +12,8 @@
http://www.icsm.gov.au/icsm/

"""
# flake8: noqa

from MAVProxy.modules.lib.ANUGA.geo_reference import Geo_reference, DEFAULT_ZONE


Expand Down
2 changes: 2 additions & 0 deletions MAVProxy/modules/lib/LowPassFilter2p.py
Original file line number Diff line number Diff line change
@@ -1,5 +1,7 @@
#!/usr/bin/env python3

# flake8: noqa

from math import *

class LowPassFilter2p:
Expand Down
1 change: 0 additions & 1 deletion MAVProxy/modules/lib/MacOS/__init__.py
Original file line number Diff line number Diff line change
@@ -1,2 +1 @@
# version of matplotlib backends modified to work with MacOS

2 changes: 2 additions & 0 deletions MAVProxy/modules/lib/MacOS/backend_agg.py
Original file line number Diff line number Diff line change
Expand Up @@ -19,6 +19,8 @@
* integrate screen dpi w/ ppi and text

"""
# flake8: noqa

import threading
import numpy as np

Expand Down
2 changes: 2 additions & 0 deletions MAVProxy/modules/lib/MacOS/backend_wx.py
Original file line number Diff line number Diff line change
Expand Up @@ -14,6 +14,8 @@

"""

# flake8: noqa

import sys
import os
import os.path
Expand Down
2 changes: 2 additions & 0 deletions MAVProxy/modules/lib/MacOS/backend_wxagg.py
Original file line number Diff line number Diff line change
@@ -1,3 +1,5 @@
# flake8: noqa

import matplotlib
from matplotlib.figure import Figure

Expand Down
2 changes: 2 additions & 0 deletions MAVProxy/modules/lib/MacOS/wxversion.py
Original file line number Diff line number Diff line change
Expand Up @@ -74,6 +74,8 @@

"""

# flake8: noqa

import re, sys, os, glob, fnmatch


Expand Down
2 changes: 2 additions & 0 deletions MAVProxy/modules/lib/camera_projection.py
Original file line number Diff line number Diff line change
Expand Up @@ -3,6 +3,8 @@
class to project a camera view onto the map
'''

# flake8: noqa

import json
import math
import time
Expand Down
3 changes: 1 addition & 2 deletions MAVProxy/modules/lib/dumpstacks.py
Original file line number Diff line number Diff line change
@@ -1,5 +1,4 @@


# flake8: noqa

import threading, sys, traceback

Expand Down
2 changes: 2 additions & 0 deletions MAVProxy/modules/lib/geodesic_grid.py
Original file line number Diff line number Diff line change
Expand Up @@ -20,6 +20,8 @@
as reference for defining the geodesic sections and implementing almost all
functions. Those files should be consulted for implementation details.
'''
# flake8: noqa

import math

from pymavlink.rotmat import Matrix3, Vector3
Expand Down
2 changes: 2 additions & 0 deletions MAVProxy/modules/lib/graph_ui.py
Original file line number Diff line number Diff line change
@@ -1,3 +1,5 @@
# flake8: noqa

from MAVProxy.modules.lib import grapher
from MAVProxy.modules.lib import multiproc

Expand Down
2 changes: 2 additions & 0 deletions MAVProxy/modules/lib/graphdefinition.py
Original file line number Diff line number Diff line change
Expand Up @@ -2,6 +2,8 @@
GraphDefinition class
'''

# flake8: noqa

class GraphDefinition(object):
'''a pre-defined graph'''
def __init__(self, name, expression, description, expressions, filename):
Expand Down
2 changes: 2 additions & 0 deletions MAVProxy/modules/lib/grapher.py
Original file line number Diff line number Diff line change
Expand Up @@ -4,6 +4,8 @@
core library for graphing in mavexplorer
'''

# flake8: noqa

import ast
import sys, struct, time, os, datetime, platform
import math, re
Expand Down
2 changes: 2 additions & 0 deletions MAVProxy/modules/lib/live_graph.py
Original file line number Diff line number Diff line change
Expand Up @@ -8,6 +8,8 @@
http://eli.thegreenplace.net/files/prog_code/wx_mpl_dynamic_graph.py.txt
"""

# flake8: noqa

import platform
from MAVProxy.modules.lib import mp_util
from MAVProxy.modules.lib import multiproc
Expand Down
2 changes: 2 additions & 0 deletions MAVProxy/modules/lib/live_graph_ui.py
Original file line number Diff line number Diff line change
@@ -1,3 +1,5 @@
# flake8: noqa

from MAVProxy.modules.lib.wx_loader import wx
from MAVProxy.modules.lib import icon
import time
Expand Down
2 changes: 2 additions & 0 deletions MAVProxy/modules/lib/magfit.py
Original file line number Diff line number Diff line change
Expand Up @@ -4,6 +4,8 @@
fit best estimate of magnetometer offsets, diagonals, off-diagonals, cmot and scaling using WMM target
'''

# flake8: noqa

from MAVProxy.modules.lib import wx_processguard
from MAVProxy.modules.lib.wx_loader import wx

Expand Down
2 changes: 2 additions & 0 deletions MAVProxy/modules/lib/mav_fft.py
Original file line number Diff line number Diff line change
Expand Up @@ -4,6 +4,8 @@
extract ISBH and ISBD messages from AP_Logging files and produce FFT plots
'''

# flake8: noqa

import numpy
import os
import pylab
Expand Down
2 changes: 2 additions & 0 deletions MAVProxy/modules/lib/mp_checklist.py
Original file line number Diff line number Diff line change
Expand Up @@ -5,6 +5,8 @@
Created by Stephen Dade ([email protected])
"""

# flake8: noqa

import sys
import os
import time
Expand Down
2 changes: 2 additions & 0 deletions MAVProxy/modules/lib/mp_elevation.py
Original file line number Diff line number Diff line change
Expand Up @@ -5,6 +5,8 @@
Created by Stephen Dade ([email protected])
'''

# flake8: noqa

import os
import sys
import time
Expand Down
2 changes: 2 additions & 0 deletions MAVProxy/modules/lib/mp_image.py
Original file line number Diff line number Diff line change
Expand Up @@ -6,6 +6,8 @@
June 2012
'''

# flake8: noqa

import time
from MAVProxy.modules.lib.wx_loader import wx
import cv2
Expand Down
2 changes: 2 additions & 0 deletions MAVProxy/modules/lib/mp_instructor.py
Original file line number Diff line number Diff line change
Expand Up @@ -5,6 +5,8 @@
André Kjellstrup @ NORCE
"""

# flake8: noqa

from MAVProxy.modules.lib import mp_util
from MAVProxy.modules.lib import multiproc
from MAVProxy.modules.lib.wx_loader import wx
Expand Down
2 changes: 2 additions & 0 deletions MAVProxy/modules/lib/mp_menu.py
Original file line number Diff line number Diff line change
Expand Up @@ -6,6 +6,8 @@
November 2013
'''

# flake8: noqa

from MAVProxy.modules.lib import mp_util
from MAVProxy.modules.lib import multiproc
import platform
Expand Down
2 changes: 2 additions & 0 deletions MAVProxy/modules/lib/mp_module.py
Original file line number Diff line number Diff line change
@@ -1,3 +1,5 @@
# flake8: noqa

import time
from pymavlink import mavutil
import traceback
Expand Down
2 changes: 2 additions & 0 deletions MAVProxy/modules/lib/mp_settings.py
Original file line number Diff line number Diff line change
@@ -1,6 +1,8 @@
#!/usr/bin/env python3
'''settings object for MAVProxy modules'''

# flake8: noqa

import time
import fnmatch

Expand Down
2 changes: 2 additions & 0 deletions MAVProxy/modules/lib/mp_substitute.py
Original file line number Diff line number Diff line change
Expand Up @@ -2,6 +2,8 @@
variable substitution in strings using a dictionary
'''

# flake8: noqa

import sys

class MAVSubstituteError(Exception):
Expand Down
2 changes: 2 additions & 0 deletions MAVProxy/modules/lib/mp_util.py
Original file line number Diff line number Diff line change
Expand Up @@ -2,6 +2,8 @@
# -*- coding: utf-8 -*-
'''common mavproxy utility functions'''

# flake8: noqa

import gzip
import math
import os
Expand Down
2 changes: 2 additions & 0 deletions MAVProxy/modules/lib/mp_widgets.py
Original file line number Diff line number Diff line change
Expand Up @@ -6,6 +6,8 @@
June 2012
'''

# flake8: noqa

from MAVProxy.modules.lib.wx_loader import wx
import cv2
import numpy as np
Expand Down
2 changes: 2 additions & 0 deletions MAVProxy/modules/lib/msgstats.py
Original file line number Diff line number Diff line change
Expand Up @@ -4,6 +4,8 @@
show stats on messages in a log in MAVExplorer
'''

# flake8: noqa

import fnmatch
from MAVProxy.modules.lib.multiproc_util import MPDataLogChildTask

Expand Down
2 changes: 2 additions & 0 deletions MAVProxy/modules/lib/multiproc.py
Original file line number Diff line number Diff line change
Expand Up @@ -10,6 +10,8 @@
make things work on MacOS
'''

# flake8: noqa

class PipeQueue(object):
'''simulate a queue using a pipe. This is used to avoid a problem with
pipes on MacOS, while still keeping similar syntax'''
Expand Down
2 changes: 2 additions & 0 deletions MAVProxy/modules/lib/multiproc_util.py
Original file line number Diff line number Diff line change
Expand Up @@ -4,6 +4,8 @@
custom pickle functions and class wrappers
'''

# flake8: noqa

from MAVProxy.modules.lib import multiproc

import copyreg
Expand Down
2 changes: 2 additions & 0 deletions MAVProxy/modules/lib/ntrip.py
Original file line number Diff line number Diff line change
Expand Up @@ -4,6 +4,8 @@
based on client from http://github.com/jcmb/NTRIP
"""

# flake8: noqa

import socket
import sys
import datetime
Expand Down
2 changes: 2 additions & 0 deletions MAVProxy/modules/lib/opengl.py
Original file line number Diff line number Diff line change
Expand Up @@ -15,6 +15,8 @@
'''
Module with helpers for OpenGL rendering.
'''
# flake8: noqa

import math

from ctypes import *
Expand Down
2 changes: 2 additions & 0 deletions MAVProxy/modules/lib/optparse_gui/__init__.py
Original file line number Diff line number Diff line change
Expand Up @@ -5,6 +5,8 @@
options/args, instead of parsing command line arguments
'''

# flake8: noqa

import os
import sys
import re
Expand Down
2 changes: 2 additions & 0 deletions MAVProxy/modules/lib/param_ftp.py
Original file line number Diff line number Diff line change
Expand Up @@ -3,6 +3,8 @@
decode ftp parameter protocol data
'''

# flake8: noqa

import struct
import sys

Expand Down
2 changes: 2 additions & 0 deletions MAVProxy/modules/lib/param_help.py
Original file line number Diff line number Diff line change
@@ -1,3 +1,5 @@
# flake8: noqa

import time, os
from pymavlink import mavutil, mavparm
from MAVProxy.modules.lib import mp_util
Expand Down
2 changes: 2 additions & 0 deletions MAVProxy/modules/lib/rline.py
Original file line number Diff line number Diff line change
Expand Up @@ -2,6 +2,8 @@
readline handling for mavproxy
'''

# flake8: noqa

import sys, glob, os, platform
import re

Expand Down
2 changes: 2 additions & 0 deletions MAVProxy/modules/lib/rtcm3.py
Original file line number Diff line number Diff line change
@@ -1,6 +1,8 @@
#!/usr/bin/env python3
'''Decode RTCM v3 messages'''

# flake8: noqa

RTCMv3_PREAMBLE = 0xD3
POLYCRC24 = 0x1864CFB

Expand Down
2 changes: 2 additions & 0 deletions MAVProxy/modules/lib/srtm.py
Original file line number Diff line number Diff line change
@@ -1,5 +1,7 @@
#!/usr/bin/env python3

# flake8: noqa

# Pylint: Disable name warnings
# pylint: disable-msg=C0103

Expand Down
2 changes: 2 additions & 0 deletions MAVProxy/modules/lib/textconsole.py
Original file line number Diff line number Diff line change
Expand Up @@ -3,6 +3,8 @@
"""
MAVProxy default console
"""
# flake8: noqa

import sys

class SimpleConsole():
Expand Down
2 changes: 2 additions & 0 deletions MAVProxy/modules/lib/wavefront.py
Original file line number Diff line number Diff line change
Expand Up @@ -33,6 +33,8 @@
Unsupported directives found while parsing are stored in the parser's
ignored_directives attribute.
'''
# flake8: noqa

import os
try:
import cPickle as pickle
Expand Down
2 changes: 2 additions & 0 deletions MAVProxy/modules/lib/win_layout.py
Original file line number Diff line number Diff line change
@@ -1,5 +1,7 @@
#!/usr/bin/env python3

# flake8: noqa

import os, wx, pickle
from MAVProxy.modules.lib import mp_util

Expand Down
2 changes: 2 additions & 0 deletions MAVProxy/modules/lib/wx_addlink.py
Original file line number Diff line number Diff line change
Expand Up @@ -3,6 +3,8 @@
GUI for adding new links to MAVProxy
'''

# flake8: noqa

import wx
from pymavlink import mavutil

Expand Down
2 changes: 2 additions & 0 deletions MAVProxy/modules/lib/wx_loader.py
Original file line number Diff line number Diff line change
@@ -1,3 +1,5 @@
# flake8: noqa

from MAVProxy.modules.lib import wx_util

if not wx_util.safe:
Expand Down
Loading
Loading