diff --git a/.codeclimate.yml b/.codeclimate.yml deleted file mode 100644 index 659feca..0000000 --- a/.codeclimate.yml +++ /dev/null @@ -1,15 +0,0 @@ -engines: - duplication: - enabled: true - config: - languages: - - ruby - rubocop: - enabled: true - -ratings: - paths: - - lib/** - -exclude_paths: - - spec/**/* diff --git a/.github/workflows/test.yml b/.github/workflows/test.yml new file mode 100644 index 0000000..5ad7ccd --- /dev/null +++ b/.github/workflows/test.yml @@ -0,0 +1,51 @@ +--- +name: test +on: + push: + branches: + - "*" + pull_request: + branches: + - "*" + +jobs: + lint: + name: RuboCop + runs-on: ubuntu-latest + steps: + - uses: actions/checkout@v4 + - name: Set up Ruby + uses: ruby/setup-ruby@v1 + with: + ruby-version: "ruby" + bundler-cache: true + - name: Run RuboCop + run: bundle exec rubocop + + test: + name: Ruby ${{ matrix.ruby }} + runs-on: ubuntu-latest + strategy: + fail-fast: false + matrix: + ruby: + - "2.5" + - "2.6" + - "2.7" + - "3.0" + - "3.1" + - "3.2" + - "3.3" + - "3.4" + + steps: + - uses: actions/checkout@v4 + + - name: Set up Ruby + uses: ruby/setup-ruby@v1 + with: + ruby-version: ${{ matrix.ruby }} + bundler-cache: true + + - name: Run tests + run: bundle exec rspec diff --git a/.rubocop.yml b/.rubocop.yml index 9f426d4..58ec2ae 100644 --- a/.rubocop.yml +++ b/.rubocop.yml @@ -1,9 +1,19 @@ -Metrics/LineLength: +inherit_from: .rubocop_todo.yml + +AllCops: + TargetRubyVersion: 2.5 + NewCops: enable + SuggestExtensions: false + +Layout/LineLength: Enabled: false + Style/RaiseArgs: Enabled: false + Metrics/BlockLength: Enabled: false + Style/PercentLiteralDelimiters: PreferredDelimiters: "%w": "[]" diff --git a/.rubocop_todo.yml b/.rubocop_todo.yml new file mode 100644 index 0000000..f8be5a6 --- /dev/null +++ b/.rubocop_todo.yml @@ -0,0 +1,82 @@ +# This configuration was generated by +# `rubocop --auto-gen-config` +# on 2025-02-15 17:10:47 UTC using RuboCop version 1.72.1. +# The point is for the user to remove these configuration records +# one by one as the offenses are removed from the code base. +# Note that changes in the inspected code, or installation of new +# versions of RuboCop, may require this file to be generated again. + +# Offense count: 1 +# This cop supports safe autocorrection (--autocorrect). +Lint/AmbiguousOperatorPrecedence: + Exclude: + - 'spec/jwe/alg_spec.rb' + +# Offense count: 6 +Lint/DuplicateMethods: + Exclude: + - 'lib/jwe/enc/aes_cbc_hs.rb' + - 'lib/jwe/enc/aes_gcm.rb' + +# Offense count: 15 +# Configuration parameters: MinNameLength, AllowNamesEndingInNumbers, AllowedNames, ForbiddenNames. +# AllowedNames: as, at, by, cc, db, id, if, in, io, ip, of, on, os, pp, to +Naming/MethodParameterName: + Exclude: + - 'lib/jwe/alg/aes_kw.rb' + - 'lib/jwe/enc.rb' + - 'lib/jwe/enc/aes_cbc_hs.rb' + - 'lib/jwe/enc/aes_gcm.rb' + - 'lib/jwe/serialization/compact.rb' + +# Offense count: 8 +# This cop supports safe autocorrection (--autocorrect). +# Configuration parameters: EnforcedStyle. +# SupportedStyles: separated, grouped +Style/AccessorGrouping: + Exclude: + - 'lib/jwe/alg/aes_kw.rb' + - 'lib/jwe/enc/aes_cbc_hs.rb' + - 'lib/jwe/enc/aes_gcm.rb' + +# Offense count: 1 +# This cop supports safe autocorrection (--autocorrect). +Style/ExpandPathArguments: + Exclude: + - 'jwe.gemspec' + +# Offense count: 34 +# This cop supports unsafe autocorrection (--autocorrect-all). +# Configuration parameters: EnforcedStyle. +# SupportedStyles: always, always_true, never +Style/FrozenStringLiteralComment: + Enabled: false + +# Offense count: 2 +# This cop supports safe autocorrection (--autocorrect). +Style/IfUnlessModifier: + Exclude: + - 'lib/jwe/alg/aes_kw.rb' + - 'lib/jwe/enc/aes_cbc_hs.rb' + +# Offense count: 1 +# This cop supports safe autocorrection (--autocorrect). +Style/PerlBackrefs: + Exclude: + - 'lib/jwe.rb' + +# Offense count: 8 +# This cop supports unsafe autocorrection (--autocorrect-all). +# Configuration parameters: Mode. +Style/StringConcatenation: + Exclude: + - 'spec/jwe/alg_spec.rb' + - 'spec/jwe_spec.rb' + +# Offense count: 1 +# This cop supports safe autocorrection (--autocorrect). +# Configuration parameters: WordRegex. +# SupportedStyles: percent, brackets +Style/WordArray: + EnforcedStyle: percent + MinSize: 7 diff --git a/.travis.yml b/.travis.yml deleted file mode 100644 index 7ddf6e0..0000000 --- a/.travis.yml +++ /dev/null @@ -1,14 +0,0 @@ -language: ruby -dist: trusty -rvm: - - 2.0.0-p648 - - 2.1.10 - - 2.2.7 - - 2.3.4 - - 2.4.1 - -after_script: - - bundle exec codeclimate-test-reporter - -env: - CODECLIMATE_REPO_TOKEN: d9854e6b60cf9cbd78bb8036da0a5c63d6178a14a19a8043752dc5fecec99831 diff --git a/Gemfile b/Gemfile index fa75df1..a935ba7 100644 --- a/Gemfile +++ b/Gemfile @@ -1,3 +1,8 @@ source 'https://rubygems.org' gemspec + +gem 'rake' +gem 'rspec' +gem 'rubocop' +gem 'simplecov' diff --git a/README.md b/README.md index 6b15840..ef97516 100644 --- a/README.md +++ b/README.md @@ -1,9 +1,6 @@ # JWE -[![Build Status](https://travis-ci.org/jwt/ruby-jwe.svg)](https://travis-ci.org/jwt/ruby-jwe) -[![Code Climate](https://codeclimate.com/github/jwt/ruby-jwe/badges/gpa.svg)](https://codeclimate.com/github/jwt/ruby-jwe) -[![Test Coverage](https://codeclimate.com/github/jwt/ruby-jwe/badges/coverage.svg)](https://codeclimate.com/github/aomega08/jwe/coverage) - +[![Build Status](https://github.com/jwt/ruby-jwe/workflows/test/badge.svg?branch=master)](https://github.com/jwt/ruby-jwe/actions) A ruby implementation of the [RFC 7516 JSON Web Encryption (JWE)](https://tools.ietf.org/html/rfc7516) standard. ## Installing diff --git a/jwe.gemspec b/jwe.gemspec index 4838b70..8283ea9 100644 --- a/jwe.gemspec +++ b/jwe.gemspec @@ -15,10 +15,6 @@ Gem::Specification.new do |s| s.files = `git ls-files`.split("\n") s.require_paths = %w[lib] - s.required_ruby_version = '>= 2.0.0' - - s.add_development_dependency 'rspec' - s.add_development_dependency 'rake' - s.add_development_dependency 'simplecov' - s.add_development_dependency 'codeclimate-test-reporter' + s.required_ruby_version = '>= 2.5.0' + s.metadata['rubygems_mfa_required'] = 'true' end diff --git a/lib/jwe/version.rb b/lib/jwe/version.rb index d2604e6..642aeee 100644 --- a/lib/jwe/version.rb +++ b/lib/jwe/version.rb @@ -1,3 +1,3 @@ module JWE - VERSION = '0.4.0'.freeze + VERSION = '1.0.0'.freeze end