Skip to content

Commit

Permalink
fix: fixes table of contents in CONTRIBUTING.md (#132)
Browse files Browse the repository at this point in the history
A table of contents was erroneously place under
Format/Styling. Removing and fixing the header
positions.

Signed-off-by: Jennifer Power <[email protected]>
  • Loading branch information
jpower432 authored Jan 3, 2024
1 parent ee5cf32 commit e8d8372
Showing 1 changed file with 18 additions and 29 deletions.
47 changes: 18 additions & 29 deletions CONTRIBUTING.md
Original file line number Diff line number Diff line change
Expand Up @@ -10,15 +10,17 @@ Before you start contributing, please take a moment to read through the guide be
- [How To Contribute](#how-to-contribute)
- [Opening a Pull Request](#opening-a-pull-request)
- [Developer Guide](#developer-guide)
- [Prerequisites](#prerequisites)
- [Prerequisites](#prerequisites)
- [Development Environment](#development-environment)
- [How It Works](#how-it-works)
- [Components](#components)
- [Code structure](#code-structure)
- [Format and Styling](#format-and-styling)
- [Update the `actions` files](#update-the-actions-files)
- [Type Hints and Static Type Checking](#type-hints-and-static-type-checking)
- [Analysis Tools](#analysis-tools)
- [Running tests](#running-tests)
- [Run with poetry](#run-with-poetry)
- [Local testing](#local-testing)
- [Run with poetry](#run-with-poetry)
- [Local testing](#local-testing)


## How To Contribute
Expand All @@ -40,27 +42,27 @@ When submitting a pull request, please follow these guidelines:

## Developer Guide

## Prerequisites
### Prerequisites

- [Python](https://www.python.org/downloads/) - v3.8+
- [Poetry](https://python-poetry.org/)
- [Podman](https://podman.io/docs/installation) (Optional) - For testing locally and end-to-end tests

## Development Environment
### Development Environment

For a reproducible development environment, we use Dev Containers. See [devcontainer.json](./.devcontainer/devcontainer.json) for more information. Note that this does not include the `podman` installation to avoid the requirement for containers with elevated privileges.

## How It Works
### How It Works

For workflow diagrams, see the [diagrams](./docs/diagrams/) under the `docs` folder.

### Components
#### Components

1. CI Provider - Runs or builds and runs trestle-bot container
2. Trestle Bot - Provides logic for managing workspace and containerized environment for use in workflows
3. Compliance-Trestle - Upstream library that provides core logic for how OSCAL content is managed

### Code structure
#### Code structure

- `actions` - Provides specific logic for `trestle-bot` tasks that are packaged as Actions. See [README.md](./actions/README.md) for more information.
- `entrypoints` - Provides top level logic for specific user-facing tasks. These tasks are not necessarily related in any way so they are not organized into a hierarchical command structure, but they do inherit logic and flags from a base class.
Expand All @@ -70,41 +72,28 @@ For workflow diagrams, see the [diagrams](./docs/diagrams/) under the `docs` fol
- `transformers` - This contains data transformation logic; specifically for rules.


## Format and Styling
### Format and Styling

This project uses `black` and `isort` for formatting and `flake8` for linting. You can run these commands to format and lint your code.
They are also run as part as a pre-commit hook.

```bash
make format
make lint- [Contributing to trestlebot](#contributing-to-trestlebot)
- [How To Contribute](#how-to-contribute)
- [Opening a Pull Request](#opening-a-pull-request)
- [Developer Guide](#developer-guide)
- [Prerequisites](#prerequisites)
- [How It Works](#how-it-works)
- [Components](#components)
- [Code structure](#code-structure)
- [Format and Styling](#format-and-styling)
- [Update the `actions` files](#update-the-actions-files)
- [Running tests](#running-tests)
- [Run with poetry](#run-with-poetry)
- [Local testing](#local-testing)

make lint
```

For non-Python files, we use [Megalinter](https://github.com/oxsecurity/megalinter) to lint in a CI task. See [megalinter.yaml](./.github/megalinter.yaml) for more information.

## Type Hints and Static Type Checking
### Type Hints and Static Type Checking

We encourage the use of type hints in Python code to enhance readability, maintainability, and robustness of the codebase. Type hints serve as documentation and aid in catching potential errors during development. For static type analysis, we utilize `mypy`. Running `make lint` will run `mypy` checks on the codebase.

## Analysis Tools
### Analysis Tools

- [SonarCloud](https://sonarcloud.io/dashboard?id=rh-psce_trestle-bot) - We use SonarCloud to analyze code quality, coverage, and security. To not break GitHub security model, this will not run on a forked repository.
- [Semgrep](https://semgrep.dev/docs/extensions/overview/#pre-commit) - Identify issues in the local development environment before committing code. These checks are also run in CI.

## Running tests
### Running tests

Run all tests with `make test` or `make test-slow` to run all tests including end-to-end.
For information on end-to-end tests, see [README.md](./tests/e2e/README.md).
Expand All @@ -118,15 +107,15 @@ make test-slow
make test-e2e
```

### Run with poetry
#### Run with poetry
```
make develop
poetry run trestlebot-autosync
poetry run trestlebot-rules-transform
poetry run trestlebot-create-cd
```

### Local testing
#### Local testing

For this guide, we will be using `podman` to test trestlebot in a running container.

Expand Down

0 comments on commit e8d8372

Please sign in to comment.