Skip to content

Commit 9c416b7

Browse files
authored
Move from Codeclimate to Qlty (#673)
* Switch to qlty reporter * Fix job name * Qlty badges * Drop pinning of rubocop * No need for unique folder names anymore
1 parent aaf774d commit 9c416b7

File tree

9 files changed

+16
-31
lines changed

9 files changed

+16
-31
lines changed

.codeclimate.yml

-8
This file was deleted.

.github/workflows/test.yml

+6-8
Original file line numberDiff line numberDiff line change
@@ -77,14 +77,14 @@ jobs:
7777
uses: actions/upload-artifact@v4
7878
with:
7979
name: coverage-${{ matrix.os }}-${{ matrix.ruby }}-${{ env.SANITIZED_GEMFILE }}
80-
path: coverage-*/*.json
80+
path: coverage/*.json
8181
retention-days: 1
8282

8383
coverage:
84-
name: Report coverage to Code Climate
84+
name: Report coverage to Qlty
8585
runs-on: ubuntu-latest
8686
needs: test
87-
if: success() && github.ref == 'refs/heads/main'
87+
if: success()
8888
steps:
8989
- uses: actions/checkout@v4
9090

@@ -93,12 +93,10 @@ jobs:
9393
with:
9494
merge-multiple: true
9595

96-
- uses: paambaati/[email protected]
97-
env:
98-
CC_TEST_REPORTER_ID: ${{ secrets.CC_TEST_REPORTER_ID }}
96+
- uses: qltysh/qlty-action/coverage@main
9997
with:
100-
coverageLocations: |
101-
${{github.workspace}}/coverage-*/*.json:simplecov
98+
token: ${{ secrets.QLTY_COVERAGE_TOKEN }}
99+
files: coverage/*.json
102100

103101
smoke:
104102
name: Built GEM smoke test

.simplecov

-1
Original file line numberDiff line numberDiff line change
@@ -6,7 +6,6 @@ require 'simplecov_json_formatter'
66
SimpleCov.start do
77
command_name "Job #{File.basename(ENV['BUNDLE_GEMFILE'])}" if ENV['BUNDLE_GEMFILE']
88
project_name 'Ruby JWT - Ruby JSON Web Token implementation'
9-
coverage_dir "coverage-#{OpenSSL::Digest::SHA256.hexdigest(ENV.fetch('GITHUB_STEP_SUMMARY', nil))}" if ENV['GITHUB_STEP_SUMMARY']
109
add_filter 'spec'
1110
end
1211

Gemfile

-2
Original file line numberDiff line numberDiff line change
@@ -3,5 +3,3 @@
33
source 'https://rubygems.org'
44

55
gemspec
6-
7-
gem 'rubocop', '~> 1.56.3' # Keep .codeclimate.yml channel in sync with this one

README.md

+2-3
Original file line numberDiff line numberDiff line change
@@ -2,9 +2,8 @@
22

33
[![Gem Version](https://badge.fury.io/rb/jwt.svg)](https://badge.fury.io/rb/jwt)
44
[![Build Status](https://github.com/jwt/ruby-jwt/actions/workflows/test.yml/badge.svg?branch=main)](https://github.com/jwt/ruby-jwt/actions)
5-
[![Code Climate](https://codeclimate.com/github/jwt/ruby-jwt/badges/gpa.svg)](https://codeclimate.com/github/jwt/ruby-jwt)
6-
[![Test Coverage](https://codeclimate.com/github/jwt/ruby-jwt/badges/coverage.svg)](https://codeclimate.com/github/jwt/ruby-jwt/coverage)
7-
[![Issue Count](https://codeclimate.com/github/jwt/ruby-jwt/badges/issue_count.svg)](https://codeclimate.com/github/jwt/ruby-jwt)
5+
[![Maintainability](https://qlty.sh/badges/eefe957e-cf90-41f6-b78b-909837542c5f/maintainability.svg)](https://qlty.sh/gh/anakinj/projects/ruby-jwt)
6+
[![Code Coverage](https://qlty.sh/badges/eefe957e-cf90-41f6-b78b-909837542c5f/test_coverage.svg)](https://qlty.sh/gh/anakinj/projects/ruby-jwt)
87

98
A ruby implementation of the [RFC 7519 OAuth JSON Web Token (JWT)](https://tools.ietf.org/html/rfc7519) standard.
109

lib/jwt/decode.rb

+5-6
Original file line numberDiff line numberDiff line change
@@ -6,6 +6,11 @@
66
module JWT
77
# The Decode class is responsible for decoding and verifying JWT tokens.
88
class Decode
9+
# Order is very important - first check for string keys, next for symbols
10+
ALGORITHM_KEYS = ['algorithm',
11+
:algorithm,
12+
'algorithms',
13+
:algorithms].freeze
914
# Initializes a new Decode instance.
1015
#
1116
# @param jwt [String] the JWT to decode.
@@ -70,12 +75,6 @@ def allowed_and_valid_algorithms
7075
@allowed_and_valid_algorithms ||= allowed_algorithms.select { |alg| alg.valid_alg?(alg_in_header) }
7176
end
7277

73-
# Order is very important - first check for string keys, next for symbols
74-
ALGORITHM_KEYS = ['algorithm',
75-
:algorithm,
76-
'algorithms',
77-
:algorithms].freeze
78-
7978
def given_algorithms
8079
alg_key = ALGORITHM_KEYS.find { |key| @options[key] }
8180
Array(@options[alg_key])

lib/jwt/jwk/ec.rb

+1-1
Original file line numberDiff line numberDiff line change
@@ -68,7 +68,7 @@ def key_digest
6868
def []=(key, value)
6969
raise ArgumentError, 'cannot overwrite cryptographic key attributes' if EC_KEY_ELEMENTS.include?(key.to_sym)
7070

71-
super(key, value)
71+
super
7272
end
7373

7474
private

lib/jwt/jwk/hmac.rb

+1-1
Original file line numberDiff line numberDiff line change
@@ -64,7 +64,7 @@ def key_digest
6464
def []=(key, value)
6565
raise ArgumentError, 'cannot overwrite cryptographic key attributes' if HMAC_KEY_ELEMENTS.include?(key.to_sym)
6666

67-
super(key, value)
67+
super
6868
end
6969

7070
private

lib/jwt/jwk/rsa.rb

+1-1
Original file line numberDiff line numberDiff line change
@@ -67,7 +67,7 @@ def key_digest
6767
def []=(key, value)
6868
raise ArgumentError, 'cannot overwrite cryptographic key attributes' if RSA_KEY_ELEMENTS.include?(key.to_sym)
6969

70-
super(key, value)
70+
super
7171
end
7272

7373
private

0 commit comments

Comments
 (0)