Skip to content

Commit

Permalink
Merge pull request #2405 from saschagrunert/prettier
Browse files Browse the repository at this point in the history
Add prettier CI target
  • Loading branch information
openshift-merge-bot[bot] authored Sep 4, 2024
2 parents 66d17b3 + 2ff6e9c commit 4da9577
Show file tree
Hide file tree
Showing 7 changed files with 61 additions and 41 deletions.
62 changes: 31 additions & 31 deletions .github/dependabot.yml
Original file line number Diff line number Diff line change
@@ -1,33 +1,33 @@
version: 2
updates:
# TODO: does not support vendoring
# - package-ecosystem: cargo
# directory: "/"
# schedule:
# interval: daily
# time: "11:00"
# open-pull-requests-limit: 10
# labels:
# - "release-note-none"
# allow:
# - dependency-type: direct
# - dependency-type: indirect
# groups:
# opentelemetry:
# patterns:
# - "opentelemetry*"
# - "tracing-opentelemetry"
- package-ecosystem: gomod
directory: "/"
schedule:
interval: daily
open-pull-requests-limit: 10
labels:
- "release-note-none"
- package-ecosystem: "github-actions"
directory: "/"
schedule:
interval: daily
open-pull-requests-limit: 10
labels:
- "release-note-none"
# TODO: does not support vendoring
# - package-ecosystem: cargo
# directory: "/"
# schedule:
# interval: daily
# time: "11:00"
# open-pull-requests-limit: 10
# labels:
# - "release-note-none"
# allow:
# - dependency-type: direct
# - dependency-type: indirect
# groups:
# opentelemetry:
# patterns:
# - "opentelemetry*"
# - "tracing-opentelemetry"
- package-ecosystem: gomod
directory: "/"
schedule:
interval: daily
open-pull-requests-limit: 10
labels:
- "release-note-none"
- package-ecosystem: "github-actions"
directory: "/"
schedule:
interval: daily
open-pull-requests-limit: 10
labels:
- "release-note-none"
4 changes: 2 additions & 2 deletions .github/workflows/cargo-upgrade.yml
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,7 @@ name: cargo-upgrade
on:
workflow_dispatch:
schedule:
- cron: '0 0 * * 0' # At 00:00 on Sunday
- cron: "0 0 * * 0" # At 00:00 on Sunday
env:
CARGO_TERM_COLOR: always
ACTION_MSRV_TOOLCHAIN: 1.66.1
Expand Down Expand Up @@ -54,7 +54,7 @@ jobs:
if: ${{ steps.create_pr.outputs.create_pr == 'true' }}
with:
commit-message: Update cargo dependencies
title: 'Update cargo dependencies'
title: "Update cargo dependencies"
body-path: ${{ env['BODY_FILE'] }}
labels: kind/dependency-change, release-note-none, ok-to-test
branch: cargo-deps
Expand Down
21 changes: 15 additions & 6 deletions .github/workflows/ci.yml
Original file line number Diff line number Diff line change
Expand Up @@ -8,11 +8,11 @@ on:
- main
env:
CARGO_TERM_COLOR: always
GO_VERSION: '1.23'
GO_VERSION: "1.23"
ACTION_MSRV_TOOLCHAIN: 1.66.1
# Latest available toolchain which does not break clippy and the unit tests
ACTION_MSRV_NIGHTLY_TOOLCHAIN: nightly-2024-05-19
NIX_VERSION: '2.21.0'
NIX_VERSION: "2.21.0"
jobs:
build:
runs-on: ubuntu-latest
Expand Down Expand Up @@ -156,7 +156,7 @@ jobs:
- uses: cachix/cachix-action@v15
with:
name: conmon-rs
authToken: '${{ secrets.CACHIX_AUTH_TOKEN }}'
authToken: "${{ secrets.CACHIX_AUTH_TOKEN }}"
pushFilter: "(conmon-rs|cargo-vendor)"
- run: nix-build nix/default-${{ matrix.arch }}.nix
- run: file result/bin/conmonrs | grep static | grep stripped
Expand Down Expand Up @@ -299,9 +299,9 @@ jobs:
command: test
args: --no-fail-fast
env:
CARGO_INCREMENTAL: '0'
RUSTFLAGS: '-Zprofile -Ccodegen-units=1 -Cinline-threshold=0 -Clink-dead-code -Coverflow-checks=off -Zpanic_abort_tests'
RUSTDOCFLAGS: '-Zprofile -Ccodegen-units=1 -Cinline-threshold=0 -Clink-dead-code -Coverflow-checks=off -Zpanic_abort_tests'
CARGO_INCREMENTAL: "0"
RUSTFLAGS: "-Zprofile -Ccodegen-units=1 -Cinline-threshold=0 -Clink-dead-code -Coverflow-checks=off -Zpanic_abort_tests"
RUSTDOCFLAGS: "-Zprofile -Ccodegen-units=1 -Cinline-threshold=0 -Clink-dead-code -Coverflow-checks=off -Zpanic_abort_tests"
- name: Coverage
uses: actions-rs/[email protected]
with:
Expand Down Expand Up @@ -409,3 +409,12 @@ jobs:
- uses: crate-ci/[email protected]
with:
config: .github/typos.toml

prettier:
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@692973e3d937129bcbf40652eb9f2f61becf3332 # v4.1.7
- uses: creyD/prettier_action@31355f8eef017f8aeba2e0bc09d8502b13dbbad1 # v4.3
with:
dry: true
prettier_options: --write .
2 changes: 1 addition & 1 deletion .github/workflows/release.yml
Original file line number Diff line number Diff line change
Expand Up @@ -7,7 +7,7 @@ on:

env:
CARGO_TERM_COLOR: always
GO_VERSION: '1.23'
GO_VERSION: "1.23"
ACTION_MSRV_TOOLCHAIN: 1.66.1

jobs:
Expand Down
2 changes: 1 addition & 1 deletion .golangci.yml
Original file line number Diff line number Diff line change
Expand Up @@ -125,7 +125,7 @@ linters-settings:
min-complexity: 50
gosec:
excludes:
- G115 # potential integer overflow
- G115 # potential integer overflow
nestif:
min-complexity: 15
errcheck:
Expand Down
1 change: 1 addition & 0 deletions .prettierignore
Original file line number Diff line number Diff line change
@@ -0,0 +1 @@
.cargo-vendor
10 changes: 10 additions & 0 deletions Makefile
Original file line number Diff line number Diff line change
Expand Up @@ -2,6 +2,7 @@ MAKEFILE_PATH := $(dir $(abspath $(lastword $(MAKEFILE_LIST))))
RUNTIME_PATH ?= "/usr/bin/runc"
PROTO_PATH ?= "conmon-rs/common/proto"
BINARY := conmonrs
CONTAINER_RUNTIME ?= podman
BUILD_DIR ?= .build
GOTOOLS_GOPATH ?= $(BUILD_DIR)/gotools
GOTOOLS_BINDIR ?= $(GOTOOLS_GOPATH)/bin
Expand Down Expand Up @@ -40,6 +41,15 @@ lint-go: .install.golangci-lint
verify-dependencies: $(GOTOOLS_BINDIR)/zeitgeist
$(GOTOOLS_BINDIR)/zeitgeist validate --local-only --base-path . --config dependencies.yaml

.PHONY: verify-prettier
verify-prettier: prettier ## Run prettier on the project.
./hack/tree_status.sh

.PHONY: prettier
prettier: ## Prettify supported files.
$(CONTAINER_RUNTIME) run -it --privileged -v ${PWD}:/w -w /w --entrypoint bash node:latest -c \
'npm install -g prettier && prettier -w .'

unit:
cargo test --no-fail-fast

Expand Down

0 comments on commit 4da9577

Please sign in to comment.