Arduino tooling hooks for use with the pre-commit framework.
Project description
Arduino Hooks
This project provides pre-commit hooks for arduino command line tooling. This is an un-official project.
Currently, this includes:
- arduino-lint - Linter for checking arduino projects for problems and conformance to conventions.
This project uses CliPy-Hooks, to handle most of the cross-platform, sub-process nastiness.
Getting Started
To configure pre-commit see their official docs for instructions.
Arduino Lint
Sample .pre-commit-config.yaml
:
- repo: https://github.com/creatingnull/arduino-hooks
rev: v0.1.0
hooks:
- id: arduino-lint
To use the arduino lint hook you must already have the arduino-lint
executable installed and on path.
You can find instructions on how to install this and pre-compiled binaries in the official docs.
To test you have this installed correctly on your system, run arduino-lint --help
in your shell and verify this returns the help information.
If you are running in an environment where putting this on path is difficult, you may pass an --install-dir
argument to define the absolute path to the arduino-lint executable.
For convenience this hook recognises the following arguments:
--fail-on-warn
flag that will fail on any warning returned by arduino lint. Similar result tocompliance=strict
but even stricter.--project-dir
if your project doesn't exist at the root directory and you don't want to waste time with--recurse=true
.
Due to limitations in clipy-hooks
it is highly suggested that you pass all arguments with values using --key=value
rather than --key value
.
You also may pass in supported arduino-cli
arguments which will be handed through to the executable.
- repo: https://github.com/creatingnull/arduino-hooks
rev: v0.1.0
hooks:
- id: arduino-lint
- args: ["--install-dir=/opt/arduino/", "--fail-on-warn", "--project-dir=src/"]
Donations
I just do this stuff for fun in my spare time, but feel free to:
License
The source of this repo uses the MIT open-source license, for details on the current licensing see LICENSE or click the badge above.
Project details
Release history Release notifications | RSS feed
Download files
Download the file for your platform. If you're not sure which to choose, learn more about installing packages.
Source Distribution
Built Distribution
Hashes for arduino_hooks-0.1.0-py2.py3-none-any.whl
Algorithm | Hash digest | |
---|---|---|
SHA256 | 2dfb34ce0674ba8d4dced37842fe50b2683325dadc66ec7e91a28190ffc41c6d |
|
MD5 | b8b15fe75b0fe5a85003443df7e2837a |
|
BLAKE2b-256 | d8388c5488c1c571893efdedc6cf252f2d6409b630d7136c1101ba19248f3b49 |