Skip to main content

Arduino tooling hooks for use with the pre-commit framework.

Project description

NullTek Documentation Arduino Hooks

PyPI - Python Version PyPI - Release Version Format Tests License Code Style

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 to compliance=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:

Support via buymeacoffee


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


Download files

Download the file for your platform. If you're not sure which to choose, learn more about installing packages.

Source Distribution

arduino_hooks-0.1.0.tar.gz (4.5 kB view hashes)

Uploaded Source

Built Distribution

arduino_hooks-0.1.0-py2.py3-none-any.whl (5.1 kB view hashes)

Uploaded Python 2 Python 3

Supported by

AWS AWS Cloud computing and Security Sponsor Datadog Datadog Monitoring Fastly Fastly CDN Google Google Download Analytics Microsoft Microsoft PSF Sponsor Pingdom Pingdom Monitoring Sentry Sentry Error logging StatusPage StatusPage Status page