Skip to content

Commit

Permalink
Merge branch 'master' into adds-forge
Browse files Browse the repository at this point in the history
  • Loading branch information
minikin authored Nov 7, 2024
2 parents 9f85499 + f746f97 commit bbe01d3
Show file tree
Hide file tree
Showing 14 changed files with 370 additions and 377 deletions.
6 changes: 1 addition & 5 deletions Earthfile
Original file line number Diff line number Diff line change
Expand Up @@ -57,8 +57,4 @@ edit-docs:
LOCALLY

RUN ./earthly/docs/dev/local.py cat-ci-docs:latest

# check-lint-openapi - OpenAPI linting from a given directory
check-lint-openapi:
FROM spectral-ci+spectral-base
DO spectral-ci+BUILD_SPECTRAL --dir="./examples/openapi" --file_type="json"

8 changes: 8 additions & 0 deletions earthly/cddl/Earthfile
Original file line number Diff line number Diff line change
@@ -0,0 +1,8 @@
VERSION 0.8

# cspell: words cddlc

cddl-base:
FROM ruby:3.3.0-alpine

RUN gem install cddlc
15 changes: 15 additions & 0 deletions earthly/docs/Earthfile
Original file line number Diff line number Diff line change
Expand Up @@ -68,6 +68,21 @@ common:

SAVE ARTIFACT /std

# The file we use for local-docs:
local-docs:
FROM scratch

COPY --dir dev .
SAVE ARTIFACT /dev

# SYNC_STD_CFG : Syncs the standard config files locally.
SYNC_LOCAL_DOCS:
FUNCTION
FROM scratch
COPY --dir +local-docs/dev /dev

SAVE ARTIFACT /dev/local.py AS LOCAL local.py

# Common src setup
SRC:
FUNCTION
Expand Down
3 changes: 3 additions & 0 deletions earthly/flutter/Earthfile
Original file line number Diff line number Diff line change
Expand Up @@ -39,6 +39,9 @@ flutter-base:

COPY +flutter-src/flutter /usr/local
ENV PATH="/usr/local/flutter/bin:/usr/local/flutter/bin/cache/dart-sdk/bin:$HOME/.pub-cache/bin:${PATH}"
# Flutter prints warnings when used by root user but omits them if has CI env flag found.
# script: https://github.com/flutter/flutter/blob/master/bin/internal/shared.sh#L214
ENV CI="true"
RUN flutter config --no-analytics
RUN flutter --version
RUN flutter doctor -v
Expand Down
2 changes: 1 addition & 1 deletion earthly/rust/scripts/std_checks.py
Original file line number Diff line number Diff line change
Expand Up @@ -104,7 +104,7 @@ def main():
results.add(exec_manager.cli_run("cargo machete", name="Unused Dependencies Check"))
# Check if we have any supply chain issues with dependencies.
results.add(
exec_manager.cli_run("cargo deny check --exclude-dev -W vulnerability", name="Supply Chain Issues Check")
exec_manager.cli_run("cargo deny check --exclude-dev -W vulnerability -W unmaintained", name="Supply Chain Issues Check")
)

results.print()
Expand Down
9 changes: 4 additions & 5 deletions earthly/rust/stdcfgs/deny.toml
Original file line number Diff line number Diff line change
Expand Up @@ -16,11 +16,7 @@ targets = [

[advisories]
version = 2
ignore = [
{ id = "RUSTSEC-2020-0168", reason = "`mach` is used by wasmtime and we have no control over that." },
{ id = "RUSTSEC-2021-0145", reason = "we don't target windows, and don't use a custom global allocator." },
{ id = "RUSTSEC-2024-0370", reason = "`proc-macro-error` is used by crates we rely on, we can't control what they use."},
]
ignore = []

[bans]
multiple-versions = "warn"
Expand Down Expand Up @@ -58,6 +54,9 @@ allow-git = [
"https://github.com/input-output-hk/catalyst-mithril.git",
"https://github.com/bytecodealliance/wasmtime",
"https://github.com/aldanor/hdf5-rust",
"https://github.com/txpipe/vrf",
"https://github.com/txpipe/kes",
"https://github.com/txpipe/curve25519-dalek",
]

[licenses]
Expand Down
2 changes: 1 addition & 1 deletion earthly/rust/stdcfgs/rustfmt.toml
Original file line number Diff line number Diff line change
Expand Up @@ -36,7 +36,7 @@ max_width = 100

# Comments:
normalize_comments = true
normalize_doc_attributes = true
normalize_doc_attributes = false
wrap_comments = true
comment_width = 90 # small excess is okay but prefer 80
format_code_in_doc_comments = true
Expand Down
27 changes: 9 additions & 18 deletions earthly/spectral/Earthfile
Original file line number Diff line number Diff line change
Expand Up @@ -3,29 +3,20 @@ VERSION 0.8
# cspell: words ruleset

spectral-base:
FROM stoplight/spectral
FROM stoplight/spectral:6.13.1
WORKDIR /work
COPY . .
RUN chmod +x ./minify-json.sh
SAVE ARTIFACT minify-json.sh

BUILD_SPECTRAL:
LINT:
FUNCTION

# Specify what file type to lint
ARG file_type = "json"

# FIle type to be linted, default linting only JSON files
ARG file_type = json
# Directory to lint
ARG dir = .
ARG src = .
# Rule set for spectral
ARG rule_set=.spectral.yml

COPY $src .

COPY +spectral-base/minify-json.sh minify-json.sh
# If file type is json, minify the JSON
RUN ./minify-json.sh
ARG rule_set = .spectral.yml

RUN spectral \
lint \
$dir/"**/*.{yml,json}" \
--ruleset $rule_set
$dir/"**/*.$file_type" \
--ruleset $rule_set
22 changes: 0 additions & 22 deletions earthly/spectral/minify-json.sh

This file was deleted.

File renamed without changes.
8 changes: 8 additions & 0 deletions examples/openapi/Earthfile
Original file line number Diff line number Diff line change
@@ -0,0 +1,8 @@
VERSION 0.8
IMPORT ../../earthly/spectral AS spectral-ci

# check-lint-openapi - OpenAPI linting from a given directory
check-lint-openapi:
FROM spectral-ci+spectral-base
COPY . .
DO spectral-ci+LINT --dir=. --rule_set=.spectral.yml
Loading

0 comments on commit bbe01d3

Please sign in to comment.