Skip to content
Merged
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
2 changes: 2 additions & 0 deletions .github/workflows/ai-translation.yml
Original file line number Diff line number Diff line change
Expand Up @@ -19,6 +19,8 @@ permissions:

jobs:
extract_strings:
# Do not run in forks; it only clutters fork repositories with unused branches.
if: ${{ !github.event.repository.fork }}
permissions:
contents: write # for creating branches and commits
pull-requests: write # for creating PRs
Expand Down
8 changes: 8 additions & 0 deletions .github/workflows/pylint.yml
Original file line number Diff line number Diff line change
Expand Up @@ -48,6 +48,14 @@ jobs:
run: |
uv pip install .[dev,scripts,pypi_dist]

- name: Install ty dependency
run: |
uv pip install ty

- name: Analyze the code with ty
run: |
ty check

- name: Analyze the code with pylint
run: |
pylint $(git ls-files '**/*.py')
2 changes: 2 additions & 0 deletions .github/workflows/update_codebase_chart.yml
Original file line number Diff line number Diff line change
Expand Up @@ -14,6 +14,8 @@ permissions:

jobs:
update-stats:
# Do not run in forks; it only clutters fork repositories with unused branches.
if: ${{ !github.event.repository.fork }}
runs-on: ubuntu-latest
permissions:
contents: write # for creating branches and commits
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -23,6 +23,8 @@ permissions:

jobs:
update-strings:
# Do not run in forks; it only clutters fork repositories with unused branches.
if: ${{ !github.event.repository.fork }}
permissions:
contents: write # for creating branches and commits
pull-requests: write # for creating PRs
Expand Down
2 changes: 2 additions & 0 deletions .github/workflows/update_copyright_year.yml
Original file line number Diff line number Diff line change
Expand Up @@ -17,6 +17,8 @@ permissions:

jobs:
update-copyright:
# Do not run in forks; it only clutters fork repositories with unused branches.
if: ${{ !github.event.repository.fork }}
permissions:
contents: write # for creating branches and commits
pull-requests: write # for creating PRs
Expand Down
2 changes: 2 additions & 0 deletions .github/workflows/update_flightcontroller_ids.yml
Original file line number Diff line number Diff line change
Expand Up @@ -10,6 +10,8 @@ permissions:

jobs:
update-ids:
# Do not run in forks; it only clutters fork repositories with unused branches.
if: ${{ !github.event.repository.fork }}
permissions:
contents: write # for Git to git push
pull-requests: write # for creating PRs
Expand Down
2 changes: 2 additions & 0 deletions .github/workflows/update_magfit_pdef_xml.yml
Original file line number Diff line number Diff line change
Expand Up @@ -12,6 +12,8 @@ permissions:

jobs:
update-magfit-pdef-xml:
# Do not run in forks; it only clutters fork repositories with unused branches.
if: ${{ !github.event.repository.fork }}
permissions:
contents: write # for creating branches and commits
pull-requests: write # for creating PRs
Expand Down
2 changes: 2 additions & 0 deletions .github/workflows/update_motor_diagrams.yml
Original file line number Diff line number Diff line change
Expand Up @@ -10,6 +10,8 @@ permissions:

jobs:
update-diagrams:
# Do not run in forks; it only clutters fork repositories with unused branches.
if: ${{ !github.event.repository.fork }}
permissions:
contents: write # for Git to git push
pull-requests: write # for creating PRs
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -25,6 +25,8 @@ permissions:

jobs:
update-strings:
# Do not run in forks; it only clutters fork repositories with unused branches.
if: ${{ !github.event.repository.fork }}
permissions:
contents: write # for creating branches and commits
pull-requests: write # for creating PRs
Expand Down
2 changes: 2 additions & 0 deletions .github/workflows/update_vehicle_templates.yml
Original file line number Diff line number Diff line change
Expand Up @@ -20,6 +20,8 @@ permissions:

jobs:
update-templates:
# Do not run in forks; it only clutters fork repositories with unused branches.
if: ${{ !github.event.repository.fork }}
runs-on: windows-latest
permissions:
contents: write # for creating branches and commits
Expand Down
5 changes: 4 additions & 1 deletion ardupilot_methodic_configurator/backend_filesystem.py
Original file line number Diff line number Diff line change
Expand Up @@ -568,15 +568,18 @@ def zip_files(self, files_to_zip: list[tuple[bool, str]], zip_file_name: str = "
"tempcal_gyro.png",
"tempcal_acc.png",
"tuning_report.csv",
"complete.param",
]
if include_apm_pdef:
specific_files.append("apm.pdef.xml")
for file_name in specific_files:
self.add_configuration_file_to_zip(zipf, file_name)
zipped_files = zipf.namelist()

# Add conditional files using generator expression filtering
for filename in (filename for wrote, filename in files_to_zip if wrote):
self.add_configuration_file_to_zip(zipf, filename)
if filename not in zipped_files: # avoid duplicating files
self.add_configuration_file_to_zip(zipf, filename)

logging_info(_("Intermediate parameter files and summary files zipped to %s"), zip_file_path)
return zip_file_path
Expand Down
8 changes: 4 additions & 4 deletions scripts/batch_convert_motor_diagrams.py
Original file line number Diff line number Diff line change
Expand Up @@ -27,10 +27,10 @@
from typing import Union

from PIL import Image
from selenium import webdriver # ty: ignore[unresolved-import]
from selenium.webdriver.firefox.options import Options as FirefoxOptions # ty: ignore[unresolved-import]
from selenium.webdriver.firefox.service import Service as FirefoxService # ty: ignore[unresolved-import]
from webdriver_manager.firefox import GeckoDriverManager # ty: ignore[unresolved-import]
from selenium import webdriver
from selenium.webdriver.firefox.options import Options as FirefoxOptions
from selenium.webdriver.firefox.service import Service as FirefoxService
from webdriver_manager.firefox import GeckoDriverManager

DEFAULT_RESIZE_WIDTH: int = 200
DEFAULT_RESIZE_HEIGHT: int = 200
Expand Down
2 changes: 1 addition & 1 deletion scripts/crawl_ardupilot_wiki.py
Original file line number Diff line number Diff line change
Expand Up @@ -23,7 +23,7 @@
from urllib.parse import urljoin, urlparse

import requests
from bs4 import BeautifulSoup, Tag # ty: ignore[unresolved-import]
from bs4 import BeautifulSoup, Tag

# Define the URL where to start crawling
URL = "https://ardupilot.org/ardupilot/"
Expand Down
6 changes: 3 additions & 3 deletions scripts/motor_diagrams_viewer_app.py
Original file line number Diff line number Diff line change
Expand Up @@ -26,9 +26,9 @@

from batch_convert_motor_diagrams import crop_whitespace
from PIL import Image
from selenium import webdriver # ty: ignore[unresolved-import]
from selenium.webdriver.firefox.options import Options # ty: ignore[unresolved-import]
from selenium.webdriver.firefox.service import Service # ty: ignore[unresolved-import]
from selenium import webdriver
from selenium.webdriver.firefox.options import Options
from selenium.webdriver.firefox.service import Service

DEFAULT_IMAGE_WIDTH: int = 200
DEFAULT_IMAGE_HEIGHT: int = 200
Expand Down
4 changes: 4 additions & 0 deletions tests/acceptance_zip_for_forum_help.py
Original file line number Diff line number Diff line change
Expand Up @@ -217,6 +217,9 @@ def vehicle_directory_with_files(tmp_path: Path) -> Path:
# Create 00_default.param (should now be included)
(vehicle_dir / "00_default.param").write_text("# Default params\nDEFAULT 0\n")

# Create complete.param (should now be included in AMC > 2.10.1)
(vehicle_dir / "complete.param").write_text("# Complete params\nPARAM66 0\nPARAM67 1\n")

return vehicle_dir


Expand Down Expand Up @@ -1121,6 +1124,7 @@ def test_user_can_complete_full_forum_help_workflow(
assert "tempcal_gyro.png" in file_list
assert "tempcal_acc.png" in file_list
assert "tuning_report.csv" in file_list
assert "complete.param" in file_list

mock_show_info.assert_called_once()
_, notification = mock_show_info.call_args[0]
Expand Down
Loading