From ccef4fad204f0ae78b202af4fb8b9c6a3d26d06e Mon Sep 17 00:00:00 2001 From: Ara Park Date: Fri, 1 Dec 2023 16:23:41 +0900 Subject: [PATCH] chore: apply code factor (#29) --- .github/workflows/code_review.yml | 18 ------------------ README.md | 7 +++++-- cmd/resource/builder.go | 9 ++++----- 3 files changed, 9 insertions(+), 25 deletions(-) delete mode 100644 .github/workflows/code_review.yml diff --git a/.github/workflows/code_review.yml b/.github/workflows/code_review.yml deleted file mode 100644 index 2074f67e..00000000 --- a/.github/workflows/code_review.yml +++ /dev/null @@ -1,18 +0,0 @@ -name: Code Review - -permissions: - contents: read - pull-requests: write - -on: - pull_request: - types: [opened, reopened, synchronize] - -jobs: - test: - runs-on: ubuntu-latest - steps: - - uses: anc95/ChatGPT-CodeReview@main - env: - GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }} - OPENAI_API_KEY: ${{ secrets.OPENAI_API_KEY }} diff --git a/README.md b/README.md index 81be4f01..300c5fe7 100644 --- a/README.md +++ b/README.md @@ -1,8 +1,9 @@ # Uniflow -[![go report][go_report_img]][go_report_url] -[![code coverage][go_code_coverage_img]][go_code_coverage_url] [![check][repo_check_img]][repo_check_url] +[![code coverage][go_code_coverage_img]][go_code_coverage_url] +[![go report][go_report_img]][go_report_url] +[![codefactor][repo_codefactor_img]][repo_codefactor_url] [![release][repo_releases_img]][repo_releases_url] > Low-Code Engine for Backend Workflows @@ -92,3 +93,5 @@ Configuration can be done using `.uniflow.toml` or system environment variables. [repo_wiki_faq_url]: https://github.com/siyul-park/uniflow/wiki/FAQ [repo_check_img]: https://github.com/siyul-park/uniflow/actions/workflows/check.yml/badge.svg [repo_check_url]: https://github.com/siyul-park/uniflow/actions/workflows/check.yml +[repo_codefactor_img]: https://www.codefactor.io/repository/github/siyul-park/uniflow/badge +[repo_codefactor_url]: https://www.codefactor.io/repository/github/siyul-park/uniflow diff --git a/cmd/resource/builder.go b/cmd/resource/builder.go index c832402f..ed6eac67 100644 --- a/cmd/resource/builder.go +++ b/cmd/resource/builder.go @@ -66,9 +66,8 @@ func (b *Builder) Build() ([]scheme.Spec, error) { var e map[string]any if err := UnmarshalYAMLOrJSON(data, &e); err != nil { return nil, err - } else { - raws = []map[string]any{e} } + raws = []map[string]any{e} } codec := NewSpecCodec(SpecCodecOptions{ @@ -78,11 +77,11 @@ func (b *Builder) Build() ([]scheme.Spec, error) { var specs []scheme.Spec for _, raw := range raws { - if spec, err := codec.Decode(raw); err != nil { + spec, err := codec.Decode(raw) + if err != nil { return nil, err - } else { - specs = append(specs, spec) } + specs = append(specs, spec) } return specs, nil