Skip to content

Commit

Permalink
feat: codespell precommit lint
Browse files Browse the repository at this point in the history
  • Loading branch information
UnicornChance committed Sep 9, 2024
1 parent 27b0404 commit 9550920
Show file tree
Hide file tree
Showing 16 changed files with 652 additions and 545 deletions.
6 changes: 6 additions & 0 deletions .codespellrc
Original file line number Diff line number Diff line change
@@ -0,0 +1,6 @@
# Lint Codespell configurations
[codespell]
skip = .codespellrc,.git,node_modules,build,dist,*.zst,CHANGELOG.md
ignore-words-list = NotIn
enable-colors =
count =
10 changes: 9 additions & 1 deletion .husky/pre-commit
Original file line number Diff line number Diff line change
@@ -1,4 +1,12 @@
#!/usr/bin/env sh
. "$(dirname -- "$0")/_/husky.sh"

npx lint-staged
OUTPUT=$(npx lint-staged > /dev/null && echo $? || echo $?)

if [ $OUTPUT -eq 0 ]; then
echo "\n\n✅ Lint Check Passed. ✅\n\n"
exit 0
else
echo "\n\n❌ Lint Check failed... Use the uds task: lint-fix to resolve issues and re-commit. ❌\n\n"
exit 1
fi
8 changes: 6 additions & 2 deletions .lintstagedrc.json
Original file line number Diff line number Diff line change
@@ -1,7 +1,11 @@
{
"*": [
"npm ci",
"npx pepr format --validate-only",
"bash -c 'codespell'"
],
"*.yaml": [
"yamllint -c .yamllint --no-warnings"
],
"*.ts": [
"npx pepr format --validate-only"
]
}
2 changes: 2 additions & 0 deletions .yamllint
Original file line number Diff line number Diff line change
Expand Up @@ -10,6 +10,8 @@ ignore:
- 'node_modules/**'
- 'dist/**'
- 'src/pepr/uds-operator-config/templates**'
- '.codespellrc'
- '.lintstagedrc.json'

rules:
anchors: enable
Expand Down
26 changes: 19 additions & 7 deletions CONTRIBUTING.md
Original file line number Diff line number Diff line change
Expand Up @@ -6,13 +6,15 @@ This document describes the process and requirements for contributing to this UD

## Table of Contents

1. [Developer Experience](#developer-experience)
2. [Definition of Done](#definition-of-done)
3. [Getting Started](#getting-started)
4. [Submitting a Pull Request](#submitting-a-pull-request)
- [Note for External Contributors](#note-for-external-contributors)
5. [PR Requirements](#pr-requirements)
6. [Contact](#contact)
- [Welcome to UDS Core](#welcome-to-uds-core)
- [Table of Contents](#table-of-contents)
- [Developer Experience](#developer-experience)
- [Definition of Done](#definition-of-done)
- [Getting Started](#getting-started)
- [Submitting a Pull Request](#submitting-a-pull-request)
- [Note for External Contributors](#note-for-external-contributors)
- [PR Requirements](#pr-requirements)
- [Contact](#contact)

## Developer Experience

Expand All @@ -26,6 +28,16 @@ Specifically:
* Continuous integration (CI) pipeline tests are definitive
* We create immutable release artifacts

Commits:

We use [codespell](https://github.com/codespell-project/codespell) and [yamllint](https://yamllint.readthedocs.io/en/stable/) for our precommit checking. It is recommended to have these installed before attempting to commit to the a branch otherwise your commit will not finalize and you will be shown an error.

To install both of these tools you can run `uds run lint-check` to install them or utilize `pip` to install them manually.

```bash
pip install yamllint codespell
```

## Definition of Done

We apply these general principles to all User Stories and activities contributing to the UDS.
Expand Down
2 changes: 1 addition & 1 deletion bundles/k3d-slim-dev/README.md
Original file line number Diff line number Diff line change
Expand Up @@ -8,7 +8,7 @@ This bundle is a trimmed-down version of [UDS Core](../k3d-standard/README.md) b

The k3d uds-dev-stack provides:

- [K3d](https://k3d.io/) - Containerized K3s Kubernetes Enviroment
- [K3d](https://k3d.io/) - Containerized K3s Kubernetes Environment
- [Minio](https://min.io/) - In-cluster S3 Object Storage (See below for more details)
- [Local Path Provisioner](https://github.com/rancher/local-path-provisioner/) - Local Storage with RWX
- [MetalLB](https://metallb.universe.tf/) - Provides type: LoadBalancer for cluster resources and Istio Gateways
Expand Down
2 changes: 1 addition & 1 deletion bundles/k3d-standard/README.md
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,7 @@

This bundle is used for demonstration, development, and testing of UDS Core. In addition to the [UDS Core applications](../../README.md#core-applications), the included k3d uds-dev-stack provides:

- [K3d](https://k3d.io/) - Containerized K3s Kubernetes Enviroment
- [K3d](https://k3d.io/) - Containerized K3s Kubernetes Environment
- [Minio](<https://min.io/>) - In-cluster S3 Object Storage (See below for more details)
- [Local Path Provisioner](<https://github.com/rancher/local-path-provisioner>) - Storage Provider with RWX configured
- [MetalLB](https://metallb.universe.tf/) - Provides type: LoadBalancer for cluster resources and Istio Gateways
Expand Down
16 changes: 8 additions & 8 deletions compliance/oscal-assessment-results.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -693,7 +693,7 @@ assessment-results:
uuid: c7c56dc6-9189-48e6-8153-541f8e7f129e
- description: |
Control Implementation: 5108E5FC-C45F-477B-8542-9C5611A92485 / Implemented Requirement: 0AE59B43-50A7-4420-881B-E0635CCB8424
Velero supports back-ups to multiple cloud environments (including geo-separated locations for high availibility) and on-premise environments in the event of an accessibility disruptions.
Velero supports back-ups to multiple cloud environments (including geo-separated locations for high availability) and on-premise environments in the event of an accessibility disruptions.
target:
status:
state: not-satisfied
Expand All @@ -713,7 +713,7 @@ assessment-results:
uuid: 6cf300c3-516b-4864-8049-a5d423c5bddc
- description: |
Control Implementation: 5108E5FC-C45F-477B-8542-9C5611A92485 / Implemented Requirement: D74C3A8C-E5B0-4F81-895D-FB2A318D723B
Velero supports back-ups to and restores from multiple cloud environments (including geo-separated locations for high availibility) and on-premise environments in the event of an accessibility disruptions.
Velero supports back-ups to and restores from multiple cloud environments (including geo-separated locations for high availability) and on-premise environments in the event of an accessibility disruptions.
target:
status:
state: not-satisfied
Expand All @@ -723,7 +723,7 @@ assessment-results:
uuid: 003c98fa-877a-4571-9bb7-f8ad72b88768
- description: |
Control Implementation: 5108E5FC-C45F-477B-8542-9C5611A92485 / Implemented Requirement: 72D7145F-7A3F-47AF-835F-7E3D6EFAE1CC
Velero supports back-ups to and restores from multiple cloud environments (including geo-separated locations for high availibility) and on-premise environments in the event of an accessibility disruptions.
Velero supports back-ups to and restores from multiple cloud environments (including geo-separated locations for high availability) and on-premise environments in the event of an accessibility disruptions.
target:
status:
state: not-satisfied
Expand Down Expand Up @@ -768,7 +768,7 @@ assessment-results:
uuid: f4c55319-50b5-4219-bf6f-22c66421f441
- description: |
Control Implementation: 5108E5FC-C45F-477B-8542-9C5611A92485 / Implemented Requirement: C650411C-33FD-4B59-8899-AC34B43C860F
Velero supports back-ups to multiple cloud environments (including geo-separated locations for high availibility) and on-premise environments.
Velero supports back-ups to multiple cloud environments (including geo-separated locations for high availability) and on-premise environments.
target:
status:
state: not-satisfied
Expand Down Expand Up @@ -2014,7 +2014,7 @@ assessment-results:
type: objective-id
title: 'Validation Result - Component:3127D34A-517B-473B-83B0-6536179ABE38 / Control Implementation: 5108E5FC-C45F-477B-8542-9C5611A92485 / Control: cp-6.2'
uuid: fde3d548-4c98-451e-8ad1-08ebf918ec1f
- description: Velero supports back-ups to multiple cloud environments (including geo-separated locations for high availibility) and on-premise environments in the event of an accessibility disruptions.
- description: Velero supports back-ups to multiple cloud environments (including geo-separated locations for high availability) and on-premise environments in the event of an accessibility disruptions.
target:
status:
state: not-satisfied
Expand All @@ -2030,15 +2030,15 @@ assessment-results:
type: objective-id
title: 'Validation Result - Component:3127D34A-517B-473B-83B0-6536179ABE38 / Control Implementation: 5108E5FC-C45F-477B-8542-9C5611A92485 / Control: cp-7'
uuid: 30788898-87df-4185-ab1c-9becdee50f6c
- description: Velero supports back-ups to and restores from multiple cloud environments (including geo-separated locations for high availibility) and on-premise environments in the event of an accessibility disruptions.
- description: Velero supports back-ups to and restores from multiple cloud environments (including geo-separated locations for high availability) and on-premise environments in the event of an accessibility disruptions.
target:
status:
state: not-satisfied
target-id: cp-7.1
type: objective-id
title: 'Validation Result - Component:3127D34A-517B-473B-83B0-6536179ABE38 / Control Implementation: 5108E5FC-C45F-477B-8542-9C5611A92485 / Control: cp-7.1'
uuid: a718a683-1df0-4cac-9b9e-f61792134683
- description: Velero supports back-ups to and restores from multiple cloud environments (including geo-separated locations for high availibility) and on-premise environments in the event of an accessibility disruptions.
- description: Velero supports back-ups to and restores from multiple cloud environments (including geo-separated locations for high availability) and on-premise environments in the event of an accessibility disruptions.
target:
status:
state: not-satisfied
Expand Down Expand Up @@ -2076,7 +2076,7 @@ assessment-results:
type: objective-id
title: 'Validation Result - Component:3127D34A-517B-473B-83B0-6536179ABE38 / Control Implementation: 5108E5FC-C45F-477B-8542-9C5611A92485 / Control: cp-9.2'
uuid: 2134ba61-df24-4258-80fc-a406ee86e4df
- description: Velero supports back-ups to multiple cloud environments (including geo-separated locations for high availibility) and on-premise environments.
- description: Velero supports back-ups to multiple cloud environments (including geo-separated locations for high availability) and on-premise environments.
target:
status:
state: not-satisfied
Expand Down
2 changes: 1 addition & 1 deletion docs/configuration/uds-operator.md
Original file line number Diff line number Diff line change
Expand Up @@ -153,7 +153,7 @@ The UDS Operator uses the first `redirectUris` to populate the `match.prefix` ho
For a complete example, see [app-authservice-tenant.yaml](https://github.com/defenseunicorns/uds-core/blob/main/src/test/app-authservice-tenant.yaml)

#### External Session Store
If you wish to scale Authservice horiztonally, Authservice supports using an [external redis session store](https://docs.tetrate.io/istio-authservice/configuration/oidc#session-store-configuration) which can be configured by setting [UDS_AUTHSERVICE_REDIS_URI](https://github.com/defenseunicorns/uds-core/blob/main/src/pepr/zarf.yaml#L20-L22).
If you wish to scale Authservice horizontally, Authservice supports using an [external redis session store](https://docs.tetrate.io/istio-authservice/configuration/oidc#session-store-configuration) which can be configured by setting [UDS_AUTHSERVICE_REDIS_URI](https://github.com/defenseunicorns/uds-core/blob/main/src/pepr/zarf.yaml#L20-L22).

You can also specify the `AUTHSERVICE_REDIS_URI` variable in your `uds-config.yaml`:

Expand Down
Loading

0 comments on commit 9550920

Please sign in to comment.