A RetroSearch Logo

Home - News ( United States | United Kingdom | Italy | Germany ) - Football scores

Search Query:

Showing content from https://arduino.github.io/arduino-lint/latest/CONTRIBUTING/ below:

How to contribute - Arduino Lint

How to contribute

First of all, thanks for contributing! This document provides some basic guidelines for contributing to this repository.

There are several ways you can get involved:

Issue Reports

Do you need help or have a question about using Arduino Lint? Support requests should be made to the Arduino forum.

High quality bug reports and feature requests are valuable contributions to the Arduino Lint project.

Before reporting an issue Qualities of an excellent report Pull Requests

To propose improvements or fix a bug, feel free to submit a PR.

Pull request checklist

In order to ease code reviews and have your contributions merged faster, here is a list of items you can check before submitting a PR:

Development prerequisites

To build Arduino Lint from sources you need the following tools to be available in your local environment:

If you want to run integration tests or work on documentation, you will also need:

Building the source code

From the project folder root, just run:

The project uses Go modules, so dependencies will be downloaded automatically. At the end of the build, you should find the arduino-lint executable in the same folder.

Running the checks

There are several checks and test suites in place to ensure the code works as expected and is written in a way that's consistent across the whole codebase. To avoid pushing changes that will cause the CI system to fail, you can run the checks locally by running this command:

Go unit tests

To run only the Go unit tests, run:

By default, all tests for all Arduino Lint's Go packages are run. To run unit tests for only one or more specific packages, you can set the TARGETS environment variable, e.g.:

TARGETS=./internal/rule task go:test

Alternatively, to run only some specific test(s), you can specify a regex to match against the test function name, e.g.:

TEST_REGEX='^TestLibraryProperties.*' task go:test

Both can be combined as well, typically to run only a specific test:

TEST_REGEX='^TestFindProjects$' TARGETS=./internal/project task go:test
Integration tests

Being a command line interface, Arduino Lint is heavily interactive and it has to stay consistent in accepting the user input and providing the expected output and proper exit codes.

For these reasons, in addition to regular unit tests the project has a suite of integration tests that actually run arduino-lint in a different process and assess the options are correctly understood and the output is what we expect.

Running tests

After the software requirements have been installed, you should be able to run the tests with:

This will automatically install the necessary dependencies, if not already installed, and run the integration tests automatically.

To run specific tests, you must run pytest from the virtual environment created by Poetry.

poetry run pytest tests/test_all.py::test_report_file

You can avoid writing the poetry run prefix each time by creating a new shell inside the virtual environment:

poetry shell
pytest test_lib.py
pytest test_lib.py::test_list
Dependency license metadata

Metadata about the license types of all dependencies is cached in the repository. To update this cache, run the following command from the repository root folder:

task general:cache-dep-licenses

The necessary Licensed tool can be installed by following these instructions.

Unfortunately, Licensed does not have Windows support.

An updated cache is also generated whenever the cache is found to be outdated by the by the "Check Go Dependencies" CI workflow and made available for download via the dep-licenses-cache workflow artifact.

Automated corrections

Tools are provided to automatically bring the project into compliance with some required checks. Run them all with this command:

Working on documentation

Documentation is provided to final users in form of static HTML content generated from a tool called MkDocs and hosted on GitHub Pages: https://arduino.github.io/arduino-lint/dev/

Local development

The documentation consists of static content written over several Markdown files under the docs subfolder of the Arduino Lint repository, as well as the dynamically generated command line reference.

When working on the documentation, it is useful to be able to see the effect the changes will have on the generated documentation website. You can build the documentation website and serve it from your personal computer by running the command:

The documentation will build. If you don't see any error, open http://127.0.0.1:8000 in your browser to view the local copy of the documentation.

Documentation publishing

The Arduino Lint git repository has a special branch called gh-pages that contains the generated HTML code for the documentation website. Every time a change is pushed to this special branch, GitHub automatically triggers a deployment to pull the change and publish a new version of the website. Do not open Pull Requests to push changes to the gh-pages branch; that will be done exclusively from the CI.

For details on the documentation publishing system, see: https://github.com/arduino/tooling-project-assets/blob/main/workflow-templates/deploy-cobra-mkdocs-versioned-poetry.md


RetroSearch is an open source project built by @garambo | Open a GitHub Issue

Search and Browse the WWW like it's 1997 | Search results from DuckDuckGo

HTML: 3.2 | Encoding: UTF-8 | Version: 0.7.4