-
-
Notifications
You must be signed in to change notification settings - Fork 914
Code formatting
For this we are using clang format version 18. All the config for this is in the .clang-format file.
Pre-built clang-format 18 binaries are provided for all platforms. To indent the entire project, run the appropriate script from the root of the repository:
Linux/Mac:
./format-code.shWindows (PowerShell):
.\format-code.ps1
⚠️ Before pushing, always run the provided script above. IDE-integrated clang-format (VS Code, CLion, etc.) may produce different formatting results even at the same version and with the same.clang-formatfile, which can cause the GitHub format-check pipeline to fail.
Make sure you have C/C++ extension by Microsoft installed and it should automatically pick up your .clang-format file. You can use the IDE's auto-indent while developing, but do not rely on it as a substitute for the provided script before committing.
CLion has built in clang-format, just press Ctrl + Shift + L (Windows and Linux) to auto-indent while developing with the .clang-format configure file within project directory. However, do not rely on it as a substitute for the provided script before committing.
Note: KDE default keymap is Alt + Shift + L
The pre-built binaries are stored under tools/clang-format-bin/<version>/ with one subdirectory per supported platform:
tools/clang-format-bin/
└── 18.1.8/
├── linux-x86_64/
│ ├── clang-format
│ └── lib/libtinfo.so.5
├── linux-arm64/
│ ├── clang-format
│ └── lib/libtinfo.so.5
├── macos-arm64/
│ └── clang-format
└── windows-x86_64/
└── clang-format.exe
The root format-code.sh and format-code.ps1 scripts delegate to tools/clang-format.sh and tools/clang-format.ps1 respectively, which automatically select the correct binary for the current OS and architecture.
- Edit
tools/fetch-clang-format.shand update the version number. - Run the script, it will download the binaries and create the appropriate versioned directories under
tools/clang-format-bin/. Note that downloading from the LLVM project servers can take a while. - Test each downloaded binary. Some platforms may require additional libraries (e.g.
libtinfo.so.5for Linux). If so, provide the library in alib/subdirectory alongside the binary.tools/get_libtinfo_linux_x86_64_arm64.shhas been left as a reference example, you can copy and adjust it for any future library needs. - Edit
tools/clang-format.shandtools/clang-format.ps1and set the version to the newly downloaded one.
Multiple versions of the binaries can coexist under
tools/clang-format-bin/. The active version is whichever is set intools/clang-format.shandtools/clang-format.ps1, making it easy to switch between versions as needed.
How to collaborate
Contributing Guidelines
Trusted contributors
How to ask questions correctly
- PortaPack Versions (which one to buy)
- Features
- HackRF Versions
-
Description of the hardware
- Enclosure/cases
- Repairs
- Mods
- Usage cautions
- First steps
- Firmware update procedure
- User interface
- Powering the PortaPack
-
Troubleshooting
- Won't boot
- Config Menu
- Firmware upgrade
- Diagnose firmware update in Windows
- Receive Quality Issues
- No TX/RX
- TX Carrier Only
- Dead Coin Cell Battery
- Factory Defaults
- SD card not recognized by PC with the SD-card over USB selected
- DFU overlay
- Full reset
- SolveBoard
- How to Format SDCard
- What if I don't like some of the apps
- 📥 Receivers
- 2-Tone-RX
- ACARS
- ADS-B
- AFSK
- AIS Boats
- Analog TV
- APRS RX
- Audio
- BLE RX
- Detector
- EPIRB RX
- ERT Meter
- Flex RX
- Radio
- Fox-Hunt
- FPV-Detect
- gfxEQ
- Level
- Meteor
- Morse RX
- NOAA
- NRF
- POCSAG
- ProtoView
- Radiosonde
- RTTY RX
- Scanner
- Search
- Signal Hunter
- SSTV RX
- SubCar
- SubGhzD
- Tetra RX
- Time Sink
- TPMS RX
- Weather
- WeFax
- VOR RX
- 📤 Transmitters
- 2-Tone-TX
- ADS-B(S) TX
- Adult Toys
- APRS TX
- BHT Xy/EP
- BLE TX
- BLESpam
- Burger Pager
- CVS Spam
- EPIRB TX
- Flex TX
- FlipperTX
- GPS Sim
- Hopper
- Jammer
- KeeLoq TX
- Key fob TX
- LGE Tool
- MDC-1200 TX
- Morse TX
- OOK
- OOK Brute
- OOK Editor
- P25 TX
- POCSAG TX
- RDS
- RTTY TX
- SAME TX
- Security+ TX
- Signal gen
- Soundboard
- Spectrum Painter
- SSTV
- TEDI/LCR
- TouchTunes
- TPMS TX
- VOR TX
- 🔄 Transceivers
- 🟡 Recon
- 🔴 Capture
▶️ Replay- 🖲️ Remote
- 🔍 Looking Glass
- 🛠️ Utilities
- 🎮 Games
- ⚙️ Settings
- 💻 HackRF Mode
-
Compilation of the firmware
- Compile on WSL with ninja
- How to compile on Windows faster with WSL 2
- Using Docker and Kitematic
- Docker command-line reference
- Using Buddyworks and other CI platforms
- Notes for Buddy.Works (and other CI platforms)
- Using ARM on Debian host
- All in one script for ARM on Debian host
- Compile on Arch based distro (exclude Asahi), or other weird distros
- Dev build versions
- Notes About ccache
- Create a custom map
- Code formatting
- PR process
- Description of the Structure
- Software Dev Guides
- Tools
- Research
- UI Screenshots
-
Maintaining
- Creating a prod/stable release (Maintainers only)
- Maintaining rules
- Development States Notes