diff --git a/.github/dependabot.yml b/.github/dependabot.yml index a079f5ecca..b5cc226c8a 100644 --- a/.github/dependabot.yml +++ b/.github/dependabot.yml @@ -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" diff --git a/.github/workflows/cargo-upgrade.yml b/.github/workflows/cargo-upgrade.yml index 864a76b338..594725c6a6 100644 --- a/.github/workflows/cargo-upgrade.yml +++ b/.github/workflows/cargo-upgrade.yml @@ -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 @@ -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 diff --git a/.github/workflows/ci.yml b/.github/workflows/ci.yml index 60bca334dd..1834a06d45 100644 --- a/.github/workflows/ci.yml +++ b/.github/workflows/ci.yml @@ -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 @@ -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 @@ -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/grcov@v0.1 with: @@ -409,3 +409,12 @@ jobs: - uses: crate-ci/typos@v1.24.3 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 . diff --git a/.github/workflows/release.yml b/.github/workflows/release.yml index 0be458af33..621e6935cf 100644 --- a/.github/workflows/release.yml +++ b/.github/workflows/release.yml @@ -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: diff --git a/.golangci.yml b/.golangci.yml index 2dd10dbeeb..e030e3bd24 100644 --- a/.golangci.yml +++ b/.golangci.yml @@ -125,7 +125,7 @@ linters-settings: min-complexity: 50 gosec: excludes: - - G115 # potential integer overflow + - G115 # potential integer overflow nestif: min-complexity: 15 errcheck: diff --git a/.prettierignore b/.prettierignore new file mode 100644 index 0000000000..eb5e0b36dd --- /dev/null +++ b/.prettierignore @@ -0,0 +1 @@ +.cargo-vendor diff --git a/Makefile b/Makefile index 24583c33b9..f109d82205 100644 --- a/Makefile +++ b/Makefile @@ -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 @@ -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