Skip to content

Commit

Permalink
Add flake8 configuration, run flake8:
Browse files Browse the repository at this point in the history
$ ./.venv/bin/flake8 --version
5.0.4 (Flake8-pyproject: 1.2.3, mccabe: 0.7.0, pycodestyle: 2.9.1, pyflakes:
2.5.0) CPython 3.6.15 on Linux
$ ./.venv/bin/flake8 flightgear_python/ scripts/ tests/
  • Loading branch information
julianneswinoga committed Dec 12, 2023
1 parent a73cf48 commit de9aecb
Show file tree
Hide file tree
Showing 3 changed files with 14 additions and 7 deletions.
6 changes: 6 additions & 0 deletions pyproject.toml
Expand Up @@ -41,3 +41,9 @@ flake8 = "==5.0.4"
[tool.black]
line-length = 120
skip-string-normalization = true

[tool.flake8]
max-line-length = 120
ignore = [
'E731',
]
8 changes: 4 additions & 4 deletions scripts/do_release.py
@@ -1,5 +1,7 @@
#!/usr/bin/env python3

import logging
import sys
import signal
import inspect
from collections import namedtuple
Expand Down Expand Up @@ -196,7 +198,7 @@ def main():
print(f'\t{item}')

git_amend_action = named_action(
f'Amend all changes to latest commit', lambda: git_info['repo'].git.commit('--all', '--amend', '--no-edit')
'Amend all changes to latest commit', lambda: git_info['repo'].git.commit('--all', '--amend', '--no-edit')
)
actions.append(git_amend_action)
if not apply_actions(actions):
Expand All @@ -218,12 +220,10 @@ def main():
clean_exit(0)

print_action_history('\r\nRan the following actions:')
print(f'\r\nYou should now run `git push origin master && git push origin $(git describe)`')
print('\r\nYou should now run `git push origin master && git push origin $(git describe)`')


if __name__ == '__main__':
import logging, sys

logging.basicConfig(level=logging.INFO, stream=sys.stdout)

signal.signal(signal.SIGINT, handler_stop_signals)
Expand Down
7 changes: 4 additions & 3 deletions tests/jsbsim_wrapper/jsbsim_wrapper.py
@@ -1,6 +1,5 @@
import math
import tempfile
import time
from typing import List, NamedTuple
from pathlib import Path

Expand Down Expand Up @@ -51,7 +50,8 @@ def test_jsb_over_world():
for requested_lon in frange(0, 1, 1):
jsbfdm = jsbsim.FGFDMExec(None) # Use JSBSim default aircraft data
jsbfdm.set_debug_level(0)
init_script_xml = fill_xml_template('jsbsim_wrapper/xml_templates/jsb_initialize_vehicle.xml', lat_deg=fix_jsb_latitude(requested_lat), lon_deg=requested_lon, alt_m=1000)
init_script_xml = fill_xml_template('jsbsim_wrapper/xml_templates/jsb_initialize_vehicle.xml',
lat_deg=fix_jsb_latitude(requested_lat), lon_deg=requested_lon, alt_m=1000)
wp_xml = build_wp_xml([], 100)
with tempfile.NamedTemporaryFile('w', suffix='.xml') as initialize_fp:
initialize_fp.write(init_script_xml)
Expand Down Expand Up @@ -79,7 +79,8 @@ def test_jsb_over_world():
kml.newpoint(name=f'{idx}a', coords=[from_loc], altitudemode=simplekml.AltitudeMode.clamptoground)
kml.newpoint(name=f'{idx}b', coords=[to_loc], altitudemode=simplekml.AltitudeMode.clamptoground)
kml.newlinestring(name=str(idx), coords=[from_loc, to_loc], altitudemode=simplekml.AltitudeMode.clamptoground)
kml.newlinestring(name=str(idx), coords=[from_loc, to_loc],
altitudemode=simplekml.AltitudeMode.clamptoground)
lat_diffs.append(requested_lat - actual_lat)
lon_diffs.append(requested_lon - actual_lon)
Expand Down

0 comments on commit de9aecb

Please sign in to comment.