Skip to content

Arduino cli tool hooks using the pre-commit framework.

License

Notifications You must be signed in to change notification settings

CreatingNull/Arduino-Hooks

Repository files navigation

NullTek Documentation Arduino Hooks

PyPI - Python Version PyPI - Release Version Format Tests License

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.
  • arduino-cli - Limited to compile calls for verifying arduino code can be compiled.

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.

To use any of the arduino hooks below you must have the respective executables installed and on path. 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 executable.

The hooked tools do not work with individual source files as is done with most pre-commit hooks, as these tools work against complete arduino projects. By default, the hooks will treat the root directory as the project root, as is typical in arduino repositories. In cases where this is not true, you can pass a --project-dir argument with the project root path to the hook.

Due to limitations in argparse, it is highly suggested that you pass all arguments with values using --key=value rather than --key value.