Skip to content

Commit 513473b

Browse files
authored
upgrades code climate to qlty.sh (#2122)
1 parent c8acbee commit 513473b

File tree

5 files changed

+144
-39
lines changed

5 files changed

+144
-39
lines changed

.github/workflows/go.yml

Lines changed: 39 additions & 39 deletions
Original file line numberDiff line numberDiff line change
@@ -275,45 +275,45 @@ jobs:
275275
name: submodule-coverage-reports
276276
path: coverage_reports/*.cov
277277

278-
# Job for uploading coverage to external services (CodeClimate)
279-
# upload_coverage:
280-
# name: Upload Coverage📊
281-
# runs-on: ubuntu-latest
282-
# # This job only needs example and pkg test results, not submodules
283-
# needs: [Example-Unit-Testing, PKG-Unit-Testing]
284-
# # Only run this job on pushes to the development branch
285-
# if: ${{ github.event_name == 'push' && github.ref == 'refs/heads/development'}}
286-
# steps:
287-
# - name: Check out code into the Go module directory
288-
# uses: actions/checkout@v5
289-
#
290-
# # Download coverage artifacts
291-
# - name: Download Coverage Report
292-
# uses: actions/download-artifact@v5
293-
# with:
294-
# path: artifacts
295-
#
296-
# # Merge coverage from example and pkg tests only
297-
# - name: Merge Coverage Files
298-
# working-directory: artifacts
299-
# run: |
300-
# echo "mode: set" > merged_profile.cov
301-
# tail -n +2 ./Example-Test-Report/profile.cov >> merged_profile.cov
302-
# tail -n +2 ./PKG-Coverage-Report/profile.cov >> merged_profile.cov
303-
#
304-
# # Generate and print total coverage percentage
305-
# echo "Total Coverage:"
306-
# go tool cover -func=merged_profile.cov | tail -n 1
307-
# shell: bash
308-
#
309-
# # Upload merged coverage to CodeClimate for analysis
310-
# - name: Upload
311-
# uses: paambaati/[email protected]
312-
# env:
313-
# CC_TEST_REPORTER_ID: ${{ secrets.CC_TEST_REPORTER_ID }}
314-
# with:
315-
# coverageLocations: artifacts/merged_profile.cov:gocov
316-
# prefix: gofr.dev
278+
# Job for uploading coverage to external services (qlty.sh)
279+
upload_coverage:
280+
name: Upload Coverage📊
281+
runs-on: ubuntu-latest
282+
# This job only needs example and pkg test results, not submodules
283+
needs: [Example-Unit-Testing, PKG-Unit-Testing]
284+
# Only run this job on pushes to the development branch
285+
if: ${{ github.event_name == 'push' && github.ref == 'refs/heads/development'}}
286+
steps:
287+
- name: Check out code into the Go module directory
288+
uses: actions/checkout@v5
289+
290+
- name: Install qlty CLI
291+
run: curl -s https://qlty.sh/install | bash
292+
293+
# Download coverage artifacts
294+
- name: Download Coverage Report
295+
uses: actions/download-artifact@v5
296+
with:
297+
path: artifacts
298+
299+
# Merge coverage from example and pkg tests only
300+
- name: Merge Coverage Files
301+
working-directory: artifacts
302+
run: |
303+
echo "mode: set" > merged_profile.cov
304+
tail -n +2 ./Example-Test-Report/profile.cov >> merged_profile.cov
305+
tail -n +2 ./PKG-Coverage-Report/profile.cov >> merged_profile.cov
306+
307+
# Generate and print total coverage percentage
308+
echo "Total Coverage:"
309+
go tool cover -func=merged_profile.cov | tail -n 1
310+
shell: bash
311+
312+
# Upload merged coverage to CodeClimate for analysis
313+
- name: Upload
314+
run: qlty coverage publish --input merged_profile.cov
315+
env:
316+
QLTY_TOKEN: ${{ secrets.QLTY_TOKEN }}
317317

318318
# Job for code quality checks
319319
code_quality:

.qlty/.gitignore

Lines changed: 7 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,7 @@
1+
*
2+
!configs
3+
!configs/**
4+
!hooks
5+
!hooks/**
6+
!qlty.toml
7+
!.gitignore

.qlty/configs/.hadolint.yaml

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,2 @@
1+
ignored:
2+
- DL3008

.qlty/configs/.yamllint.yaml

Lines changed: 8 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,8 @@
1+
rules:
2+
document-start: disable
3+
quoted-strings:
4+
required: only-when-needed
5+
extra-allowed: ["{|}"]
6+
key-duplicates: {}
7+
octal-values:
8+
forbid-implicit-octal: true

.qlty/qlty.toml

Lines changed: 88 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,88 @@
1+
# This file was automatically generated by `qlty init`.
2+
# You can modify it to suit your needs.
3+
# We recommend you to commit this file to your repository.
4+
#
5+
# This configuration is used by both Qlty CLI and Qlty Cloud.
6+
#
7+
# Qlty CLI -- Code quality toolkit for developers
8+
# Qlty Cloud -- Fully automated Code Health Platform
9+
#
10+
# Try Qlty Cloud: https://qlty.sh
11+
#
12+
# For a guide to configuration, visit https://qlty.sh/d/config
13+
# Or for a full reference, visit https://qlty.sh/d/qlty-toml
14+
config_version = "0"
15+
16+
exclude_patterns = [
17+
"*_min.*",
18+
"*-min.*",
19+
"*.min.*",
20+
"**/.yarn/**",
21+
"**/*.d.ts",
22+
"**/assets/**",
23+
"**/bower_components/**",
24+
"**/build/**",
25+
"**/cache/**",
26+
"**/config/**",
27+
"**/db/**",
28+
"**/deps/**",
29+
"**/dist/**",
30+
"**/extern/**",
31+
"**/external/**",
32+
"**/generated/**",
33+
"**/Godeps/**",
34+
"**/gradlew/**",
35+
"**/mvnw/**",
36+
"**/node_modules/**",
37+
"**/protos/**",
38+
"**/seed/**",
39+
"**/target/**",
40+
"**/templates/**",
41+
"**/testdata/**",
42+
"**/vendor/**", "**/mock_*", "**/*_test.go",
43+
]
44+
45+
test_patterns = [
46+
"**/test/**",
47+
"**/spec/**",
48+
"**/*.test.*",
49+
"**/*.spec.*",
50+
"**/*_test.*",
51+
"**/*_spec.*",
52+
"**/test_*.*",
53+
"**/spec_*.*",
54+
]
55+
56+
[smells]
57+
mode = "comment"
58+
59+
[smells.boolean_logic]
60+
threshold = 10
61+
enabled = true
62+
63+
[smells.file_complexity]
64+
threshold = 66
65+
enabled = true
66+
67+
[smells.return_statements]
68+
threshold = 8
69+
enabled = true
70+
71+
[smells.nested_control_flow]
72+
threshold = 4
73+
enabled = true
74+
75+
[smells.function_parameters]
76+
threshold = 6
77+
enabled = true
78+
79+
[smells.function_complexity]
80+
threshold = 13
81+
enabled = true
82+
83+
[smells.duplication]
84+
enabled = false
85+
86+
[[source]]
87+
name = "default"
88+
default = true

0 commit comments

Comments
 (0)