From 3d3edb7d3ee246bb04c00fc8f1e3e9b31190e32f Mon Sep 17 00:00:00 2001 From: Howard <139238193+howard-oc@users.noreply.github.com> Date: Thu, 2 May 2024 09:47:24 +0000 Subject: [PATCH] fix:bug: linting for test changes --- .env | 8 +------- .github/linters/.checkov.yaml | 3 ++- .github/linters/.hadolint.yaml | 13 +++++++------ .github/workflows/linter.yml | 6 ++++-- .github/workflows/rust.yml | 16 ++++++++-------- src/lib.rs | 8 ++++---- 6 files changed, 26 insertions(+), 28 deletions(-) diff --git a/.env b/.env index 4527a79..bf277ab 100644 --- a/.env +++ b/.env @@ -1,11 +1,5 @@ - - BASE_INSTANCE="$WORKSPACE/resources/minimal-flinkdep-manifest.yaml" - DEPENDENCIES_DIR="$WORKSPACE/dependencies" - -RESOURCES_DIR="$WORKSPACE/resources" - KRATIX_INPUT="$WORKSPACE/tests/test-input" - KRATIX_OUTPUT="$WORKSPACE/tests/test-output" +RESOURCES_DIR="$WORKSPACE/resources" diff --git a/.github/linters/.checkov.yaml b/.github/linters/.checkov.yaml index 85de8e8..6e93b42 100644 --- a/.github/linters/.checkov.yaml +++ b/.github/linters/.checkov.yaml @@ -1,3 +1,4 @@ +--- skip-check: - CKV_DOCKER_2 - - CKV2_GHA_1 \ No newline at end of file + - CKV2_GHA_1 diff --git a/.github/linters/.hadolint.yaml b/.github/linters/.hadolint.yaml index caea5a1..99ac289 100644 --- a/.github/linters/.hadolint.yaml +++ b/.github/linters/.hadolint.yaml @@ -1,10 +1,11 @@ +--- failure-threshold: warning format: tty ignored: -- DL3045 -- DL3018 + - DL3045 + - DL3018 trustedRegistries: -- docker.io -- ghcr.io -- "*.gcr.io" -- quay.io \ No newline at end of file + - docker.io + - ghcr.io + - "*.gcr.io" + - quay.io diff --git a/.github/workflows/linter.yml b/.github/workflows/linter.yml index 5fd743b..816f48e 100644 --- a/.github/workflows/linter.yml +++ b/.github/workflows/linter.yml @@ -26,5 +26,7 @@ jobs: env: DEFAULT_BRANCH: main VALIDATE_KUBERNETES_KUBECONFORM: false - # To report GitHub Actions status checks - GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }} \ No newline at end of file + VALIDATE_RUST_2015: false + VALIDATE_RUST_2018: false + VALIDATE_RUST_2021: false + GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }} diff --git a/.github/workflows/rust.yml b/.github/workflows/rust.yml index 9fd45e0..105f44e 100644 --- a/.github/workflows/rust.yml +++ b/.github/workflows/rust.yml @@ -1,22 +1,22 @@ +--- name: Rust on: push: - branches: [ "main" ] + branches: ["main"] pull_request: - branches: [ "main" ] + branches: ["main"] env: CARGO_TERM_COLOR: always jobs: build: - runs-on: ubuntu-latest steps: - - uses: actions/checkout@v4 - - name: Build - run: cargo build --verbose - - name: Run tests - run: cargo test --verbose + - uses: actions/checkout@v4 + - name: Build + run: cargo build --verbose + - name: Run tests + run: cargo test --verbose diff --git a/src/lib.rs b/src/lib.rs index 6449d3b..5921cf0 100644 --- a/src/lib.rs +++ b/src/lib.rs @@ -2,7 +2,7 @@ pub mod pipeline; pub mod promise; use crate::pipeline::PipelineConfig; use dotenv::dotenv; -use log; + use std::{ env, process, @@ -40,7 +40,7 @@ pub fn run_pipeline() -> PipelineConfig { impl ResourceRequest for MyPromise { fn transform(&self, _conf: &PipelineConfig) -> String { - format!("{}", self.params) + self.params.to_string() } } @@ -48,7 +48,7 @@ pub fn run_pipeline() -> PipelineConfig { params: String::from("(default)"), }; - return run_custom_pipeline(Some(request)); + run_custom_pipeline(Some(request)) } pub fn run_custom_pipeline(_request: Option) -> PipelineConfig { @@ -125,7 +125,7 @@ pub fn run_custom_pipeline(_request: Option) -> PipelineCo //pipeline::list_files_recursively(_kratix_output_dir); log::debug!("<- End Pipeline ->"); - return config; + config } // validation function