Skip to content

Latest commit

 

History

History
29 lines (19 loc) · 2.71 KB

README.md

File metadata and controls

29 lines (19 loc) · 2.71 KB

Examples

Read this when you want to see code that passes the lab's configs, or you are changing a config and need to know what the check script runs against.

Small, realistic samples for each language. Every file outside a bad/ folder passes the formatter and linters in configs/; every file inside a bad/ folder is written to fail them, and scripts/check-configs.sh checks both. The one thing to remember: never copy code from a bad/ folder.

What each folder shows

Folder Good sample What it demonstrates
c-cpp/ teleop_velocity_limiter/: a ROS 2 component node (C++17) with a library class, gtest, launch file and parameter YAML; firmware/: a C ring buffer ROS 2 style, ament_lint_auto with ament_clang_format instead of uncrustify, clang-tidy with a compilation database
python/ src/teleop_episodes/stats.py: episode statistics with dataclasses, type hints and Google docstrings, plus pytest tests Ruff, mypy --strict, pyright and the same code passing ament_flake8 and ament_pep257
javascript-typescript/ src/robot-status.ts, src/status-summary.ts: parsing and summarizing robot status messages for a dashboard Strict TypeScript, typed ESLint rules, unknown instead of any
swift/ Sources/: an @Observable teleoperation view model, a SwiftUI status view and a watchOS model swift-format and SwiftLint together, Swift 6 concurrency annotations
kotlin/ src/main/kotlin/edu/kent/cs/atr/: a coroutine speech queue for a Pepper app and a Wear OS Compose card ktlint android_studio style, detekt with Compose settings
csharp-unity/ Assets/Scripts/Teleoperation/: a MonoBehaviour that follows the operator's hand with a speed limit, and a command struct Naming rules, Allman braces, Microsoft.Unity.Analyzers

The csharp-unity/check/ folder is only for the check script: a project file and small stand-ins for the UnityEngine types, so the scripts compile with the .NET SDK without Unity. Never copy it into a Unity project.

Bad samples

Each bad/ file has a comment on each line that names the rule it breaks. The check script requires every tool to reject it; if a tool accepts it, the config is not doing its job and the check fails. The EditorConfig and Markdown bad samples are generated by the script instead of committed.

Related

  • Configs: the files these samples are checked against, and the tested versions
  • All guides

Last reviewed: Sept. 30, 2026 · Sources checked on that date · Suggest a change