Skip to content

Commit

Permalink
test: suggestions
Browse files Browse the repository at this point in the history
  • Loading branch information
JesseTatasciore committed Aug 28, 2024
1 parent 3608e30 commit a024552
Show file tree
Hide file tree
Showing 8 changed files with 195 additions and 2 deletions.
1 change: 1 addition & 0 deletions .aspect/cli/config.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -7,3 +7,4 @@ configure:
lint:
aspects:
- //tools/lint:linters.bzl%vale
- //tools/lint:linters.bzl%shellcheck
2 changes: 2 additions & 0 deletions .aspect/workflows/config.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -99,6 +99,8 @@ workspaces:
- delivery:
without: true
tasks:
- checkout:
update_strategy: rebase
- test:
hooks:
- type: before_task
Expand Down
44 changes: 44 additions & 0 deletions .circleci/config.yml
Original file line number Diff line number Diff line change
Expand Up @@ -199,6 +199,10 @@ jobs:
command: /etc/aspect/workflows/bin/agent_health_check
name: Agent health check
no_output_timeout: 180m
- run:
command: rosetta run checkout
name: Checkout health
no_output_timeout: 180m
- run:
command: rosetta run buildifier --workspace << parameters.workspace >>
name: Buildifier
Expand Down Expand Up @@ -239,6 +243,10 @@ jobs:
command: /etc/aspect/workflows/bin/agent_health_check
name: Agent health check
no_output_timeout: 180m
- run:
command: rosetta run checkout
name: Checkout health
no_output_timeout: 180m
- run:
command: rosetta run test --workspace << parameters.workspace >>
name: Test
Expand Down Expand Up @@ -299,6 +307,10 @@ jobs:
command: /etc/aspect/workflows/bin/agent_health_check
name: Agent health check
no_output_timeout: 180m
- run:
command: rosetta run checkout
name: Checkout health
no_output_timeout: 180m
- run:
command: rosetta run test --workspace << parameters.workspace >>
name: Test
Expand Down Expand Up @@ -359,6 +371,10 @@ jobs:
command: /etc/aspect/workflows/bin/agent_health_check
name: Agent health check
no_output_timeout: 180m
- run:
command: rosetta run checkout
name: Checkout health
no_output_timeout: 180m
- run:
command: rosetta run test --workspace << parameters.workspace >>
name: Test
Expand Down Expand Up @@ -419,6 +435,10 @@ jobs:
command: /etc/aspect/workflows/bin/agent_health_check
name: Agent health check
no_output_timeout: 180m
- run:
command: rosetta run checkout
name: Checkout health
no_output_timeout: 180m
- run:
command: rosetta run test --workspace << parameters.workspace >>
name: Test
Expand Down Expand Up @@ -479,6 +499,10 @@ jobs:
command: /etc/aspect/workflows/bin/agent_health_check
name: Agent health check
no_output_timeout: 180m
- run:
command: rosetta run checkout
name: Checkout health
no_output_timeout: 180m
- run:
command: rosetta run test --workspace << parameters.workspace >>
name: Test
Expand Down Expand Up @@ -539,6 +563,10 @@ jobs:
command: /etc/aspect/workflows/bin/agent_health_check
name: Agent health check
no_output_timeout: 180m
- run:
command: rosetta run checkout
name: Checkout health
no_output_timeout: 180m
- run:
command: rosetta run format --workspace << parameters.workspace >>
name: Format
Expand Down Expand Up @@ -579,6 +607,10 @@ jobs:
command: /etc/aspect/workflows/bin/agent_health_check
name: Agent health check
no_output_timeout: 180m
- run:
command: rosetta run checkout
name: Checkout health
no_output_timeout: 180m
- run:
command: rosetta run gazelle --workspace << parameters.workspace >>
name: Gazelle
Expand Down Expand Up @@ -619,6 +651,10 @@ jobs:
command: /etc/aspect/workflows/bin/agent_health_check
name: Agent health check
no_output_timeout: 180m
- run:
command: rosetta run checkout
name: Checkout health
no_output_timeout: 180m
- run:
command: rosetta run lint --workspace << parameters.workspace >>
name: Lint
Expand Down Expand Up @@ -697,6 +733,10 @@ jobs:
command: /etc/aspect/workflows/bin/agent_health_check
name: Agent health check
no_output_timeout: 180m
- run:
command: rosetta run checkout
name: Checkout health
no_output_timeout: 180m
- run:
command: rosetta run configure --workspace << parameters.workspace >>
name: Configure
Expand Down Expand Up @@ -737,6 +777,10 @@ jobs:
command: /etc/aspect/workflows/bin/agent_health_check
name: Agent health check
no_output_timeout: 180m
- run:
command: rosetta run checkout
name: Checkout health
no_output_timeout: 180m
- run:
command: rosetta run test --workspace << parameters.workspace >>
name: Test
Expand Down
106 changes: 106 additions & 0 deletions bar.json
Original file line number Diff line number Diff line change
@@ -0,0 +1,106 @@
{
"diagnostics": [
{
"severity": 4,
"help": " declare \"$key\"=\"$value\"",
"title": " provided a suggestion",
"source_content": {
"name": "lib/tests/stamping/stamper.sh"
},
"spans": [
{
"offset": 9
}
],
"baggage": {
"label": "//lib/tests/stamping:stamper"
},
"type": 1
},
{
"message": "Vale.Spelling:Did you really mean 'esdwdsqafdfg'?",
"severity": 3,
"title": "Vale found an issue",
"source_content": {
"name": "foo.md"
},
"spans": [
{
"offset": 4
}
],
"baggage": {
"label": "//:foo"
},
"type": 1
},
{
"message": "Vale.Spelling:Did you really mean 'wqftqerwt'?",
"severity": 3,
"title": "Vale found an issue",
"source_content": {
"name": "foo.md"
},
"spans": [
{
"offset": 5
}
],
"baggage": {
"label": "//:foo"
},
"type": 1
},
{
"message": "Vale.Spelling:Did you really mean 'gertgerw'?",
"severity": 3,
"title": "Vale found an issue",
"source_content": {
"name": "foo.md"
},
"spans": [
{
"offset": 8
}
],
"baggage": {
"label": "//:foo"
},
"type": 1
},
{
"message": "Google.FirstPerson:Avoid first-person pronouns such as 'I '.",
"severity": 3,
"title": "Vale found an issue",
"source_content": {
"name": "foo.md"
},
"spans": [
{
"offset": 11
}
],
"baggage": {
"label": "//:foo"
},
"type": 1
},
{
"message": "Vale.Avoid:Avoid using 'bar'.",
"severity": 3,
"title": "Vale found an issue",
"source_content": {
"name": "foo.md"
},
"spans": [
{
"offset": 13
}
],
"baggage": {
"label": "//:foo"
},
"type": 1
}
]
}
34 changes: 34 additions & 0 deletions foo.json
Original file line number Diff line number Diff line change
@@ -1,5 +1,39 @@
{
"diagnostics": [
{
"severity": 4,
"help": " declare \"$key\"=\"$value\"",
"title": " provided a suggestion",
"source_content": {
"name": "lib/tests/stamping/stamper.sh"
},
"spans": [
{
"offset": 9
}
],
"baggage": {
"label": "//lib/tests/stamping:stamper"
},
"type": 1
},
{
"severity": 4,
"help": "rm -f \"$outfile\" || true",
"title": " provided a suggestion",
"source_content": {
"name": "lib/tests/run_binary_expansions/expansions.sh"
},
"spans": [
{
"offset": 6
}
],
"baggage": {
"label": "//lib/tests/run_binary_expansions:expansions_sh"
},
"type": 1
},
{
"message": "Vale.Spelling:Did you really mean 'esdwdsqafdfg'?",
"severity": 3,
Expand Down
2 changes: 1 addition & 1 deletion lib/tests/copy_to_bin/test.sh
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,7 @@ set -o errexit -o nounset

expected_file="$1"
source_file="$2"
bin_file="$3"
bin_file=$3
if [[ "$expected_file" != "$source_file" ]]; then
echo "ERROR: expected source_file to be $expected_file, but got $source_file"
exit 1
Expand Down
2 changes: 1 addition & 1 deletion lib/tests/run_binary_expansions/expansions.sh
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,7 @@ set -o errexit -o nounset -o pipefail

mkdir -p $(dirname "$1")
outfile=$1
rm -f "$outfile" || true
rm -f $outfile || true
for each in $@; do
sanitized=${each/darwin/PLATFORM}
sanitized=${sanitized/k8/PLATFORM}
Expand Down
6 changes: 6 additions & 0 deletions tools/lint/linters.bzl
Original file line number Diff line number Diff line change
@@ -1,6 +1,12 @@
"Create linter aspects, see https://github.com/aspect-build/rules_lint/blob/main/docs/linting.md#installation"

load("@aspect_rules_lint//lint:vale.bzl", "lint_vale_aspect")
load("@aspect_rules_lint//lint:shellcheck.bzl", "lint_shellcheck_aspect")

shellcheck = lint_shellcheck_aspect(
binary = "@multitool//tools/shellcheck",
config = "@@//:.shellcheckrc",
)

vale = lint_vale_aspect(
binary = "@@//tools/lint:vale_bin",
Expand Down

0 comments on commit a024552

Please sign in to comment.