Skip to content

Latest commit

 

History

History
88 lines (57 loc) · 2.45 KB

development.md

File metadata and controls

88 lines (57 loc) · 2.45 KB

← back to docs

Development

This document contains development instructions. Read it to learn how to develop this project.

Table of Contents

Prerequisites

Helper scripts may introduce additional dependencies. However, all helper scripts support the INSTALL_DEPS environment variable flag. By default, this flag is set to false. This way, the scripts will try to use the tools installed on your local machine. This helps speed up the development process. If you do not want to install any additional tools, or you want to ensure reproducible script results, export INSTALL_DEPS=true. This way, the proper tool version will be automatically installed and used.

Dependency management

This project uses go modules for dependency management. To install all required dependencies, use the following command:

go mod download

Testing

Unit tests

To run all unit tests, execute:

make test-unit

To generate the unit test coverage HTML report, execute:

make test-unit-cover-html

NOTE: The generated report opens automatically in your default browser.

Lint tests

To check your code for errors, such as typos, wrong formatting, security issues, etc., execute:

make test-lint

To automatically fix detected lint issues, execute:

make fix-lint-issues

Integration tests

This project supports the integration tests that are defined in the tests package. The tests are executed against gh-codeowners/codeowners-samples.

CAUTION: Currently, running the integration tests both on external PRs and locally by external contributors is not supported, as the teams used for testing are visible only to the organization members. At the moment, the codeowners-validator repository owner is responsible for running these tests.

Build a binary

To generate a binary for this project, execute:

make build

This command generates a binary named codeowners-validator in the root directory.

↑ Back to top