diff --git a/.circleci/config.yml b/.circleci/config.yml index d00c008..9a643f5 100644 --- a/.circleci/config.yml +++ b/.circleci/config.yml @@ -3,21 +3,25 @@ version: 2.1 orbs: samvera: samvera/circleci-orb@1.0 jobs: - bundle_and_test: + lint: parameters: ruby_version: type: string bundler_version: type: string default: 2.3.11 + executor: name: "samvera/ruby" ruby_version: << parameters.ruby_version >> + environment: WAIT_FOR_JEKYLL: 10 NOKOGIRI_USE_SYSTEM_LIBRARIES: true + steps: - samvera/cached_checkout + - run: name: Check for a branch named 'master' command: | @@ -27,27 +31,103 @@ jobs: echo "$(git branch --all --list master */master)" fi [[ -z "$(git branch --all --list master */master)" ]] + - run: name: Install the NPM dependencies using Yarn command: | yarn install -D + - run: name: Lint the formatting of source code files using Prettier command: | yarn run prettier --check . + - persist_to_workspace: root: ~/ paths: - project/* - project/**/* + bixby: + parameters: + ruby_version: + type: string + bundler_version: + type: string + default: 2.3.11 + + executor: + name: "samvera/ruby" + ruby_version: << parameters.ruby_version >> + + environment: + WAIT_FOR_JEKYLL: 10 + NOKOGIRI_USE_SYSTEM_LIBRARIES: true + BUNDLE_PATH: ./vendor/bixby/bundle + + steps: + - restore_cache: + name: Restore code from cache + keys: + - v1-source-bixby-{{ .Branch }}-{{ .Revision }} + + - checkout + + - save_cache: + name: Save code cache + key: v1-source-bixby-{{ .Branch }}-{{ .Revision }} + paths: + - ".git" + + - run: + name: Update bundler + command: | + echo 'export BUNDLER_VERSION=<< parameters.bundler_version >>' >> $BASH_ENV + gem install bundler -v << parameters.bundler_version >> + + - run: + name: Install dependencies + working_directory: ~/project/bixby + command: bundle check || bundle install --jobs=4 --retry=3 + + - run: + name: Call Rubocop in parallel + working_directory: ~/project/bixby + command: bundle exec rubocop --parallel + + - persist_to_workspace: + root: ~/ + paths: + - project/bixby/* + - project/bixby/**/* + workflows: version: 2 ci: jobs: - - bundle_and_test: - name: ruby3-1 - ruby_version: 3.1.1 + - lint: + name: lint + ruby_version: 3.2.0 + - bixby: + name: bixby-ruby3-2 + ruby_version: 3.2.0 + requires: + - lint + - bixby: + name: bixby-ruby3-1 + ruby_version: 3.1.3 + requires: + - lint + - bixby: + name: bixby-ruby3-0 + ruby_version: 3.0.5 + requires: + - lint + - bixby: + name: bixby-ruby2-7 + ruby_version: 2.7.7 + requires: + - lint nightly: triggers: @@ -58,6 +138,26 @@ workflows: only: - main jobs: - - bundle_and_test: - name: ruby3-1 - ruby_version: 3.1.1 + - lint: + name: lint + ruby_version: 3.2.0 + - bixby: + name: bixby-ruby3-2 + ruby_version: 3.2.0 + requires: + - lint + - bixby: + name: bixby-ruby3-1 + ruby_version: 3.1.3 + requires: + - lint + - bixby: + name: bixby-ruby3-0 + ruby_version: 3.0.5 + requires: + - lint + - bixby: + name: bixby-ruby2-7 + ruby_version: 2.7.7 + requires: + - lint diff --git a/.prettierignore b/.prettierignore index 42061c0..ef1b2bb 100644 --- a/.prettierignore +++ b/.prettierignore @@ -1 +1,2 @@ -README.md \ No newline at end of file +README.md +bixby/ diff --git a/README.md b/README.md index 30f6aa8..0e30e65 100644 --- a/README.md +++ b/README.md @@ -1,6 +1,44 @@ # Component Maintenance Interest Group -This repository holds templates and guidelines to support the maintenance of projects in the [Samvera](https://github.com/samvera) Github organization. +This repository contains [bixby](./bixby), documentation, and templates to support the maintenance of projects in the [Samvera](https://github.com/samvera) Github organization. + +## Maintenance Projects + +Within this repository are maintained the following Ruby Gems used for the administration and quality assurance of source code projects: + +- [bixby](./bixby) - A Ruby Gem containing the default configuration settings for [RuboCop](https://github.com/rubocop/rubocop) used to enforce common Ruby style guidelines across Samvera community projects. + +## Maintenance Documentation + +- [ORGS](./ORGS.md) - Reference guide for the structure of GitHub Organizations (`samvera`, `samvera-labs`, and `samvera-deprecated`) +- [TEAMS](./TEAMS.md) - Reference guide for the structure of GitHub Teams within the `samvera`, `samvera-labs`, and `samvera-deprecated` Organizations +- [RELEASES](./ruby/RELEASES.md) - Reference guide for the releasing Ruby Gem components maintained by the Samvera Community + +## Samvera Component Templates + +[README.md](./templates/README.md) - The elements in this template should be in +every repository. Additional elements may be added. + +[SUPPORT.md](./templates/SUPPORT.md) - Copy this and replace `{{library}}` with +the repository name. This is linked from the README and has information on how +to create an issue, email the list, and connect to Slack. + +[CONTRIBUTING.md](./templates/CONTRIBUTING.md) - Contribution guidelines for +Samvera projects. Should be included. Minimal customization should be necessary. + +[CODE_OF_CONDUCT.md](./templates/CODE_OF_CONDUCT.md) - Should be included +verbatim in every Samvera repository. If this is updated, it needs to be +distributed to all Samvera organization repositories. + +[LICENSE](./templates/LICENSE) - Should be included in every Samvera +repository. The copyright statements may change as appropriate. This template +was taken from guidelines found on the +[wiki](https://wiki.duraspace.org/display/samvera/Code+Copyright+Statement). + +[MAILMAP](./templates/MAILMAP) - A master template for [git mailmap](https://www.git-scm.com/docs/git-check-mailmap). +This template is something to push to all samvera repositories. The goal in +applying a common mailmap is to help understand contributions as people move +and change roles/functions/laptops. ## Samvera Core Components @@ -17,7 +55,6 @@ Currently, there are twenty Samvera Core Components maintained by the community: | Component | CircleCI Status | Ruby 3.1 Support | Ruby 3.0 Support | Ruby 2.7 Support | Ruby 2.6 Support | Rails 7.0 Support | Rails 6.1 Support | Rails 6.0 Support | Rails 5.2 Support | | --- | --- | --- | --- | --- | --- | --- | --- | --- | --- | | [active_fedora](https://github.com/samvera/active_fedora) | [![Build Status](https://circleci.com/gh/samvera/active_fedora.svg?style=svg)](https://circleci.com/gh/samvera/active_fedora) | | | 2.7.0 | 2.6.5 | | | 6.0.2 | 5.2.4 | -| [bixby](https://github.com/samvera/bixby) | [![Build Status](https://circleci.com/gh/samvera/bixby.svg?style=svg)](https://circleci.com/gh/samvera/bixby) | 3.1.1 | 3.0.3 | 2.7.5 | 2.6.9 | N/A | N/A | N/A | N/A | | [browse-everything](https://github.com/samvera/browse-everything) | [![Build Status](https://circleci.com/gh/samvera/browse-everything.svg?style=svg)](https://circleci.com/gh/samvera/browse-everything) | | | 2.7.5 | 2.6.9 | | | 6.0.4.7 | 5.2.4 | | [hydra-derivatives](https://github.com/samvera/hydra-derivatives) | [![Build Status](https://circleci.com/gh/samvera/hydra-derivatives.svg?style=svg)](https://circleci.com/gh/samvera/hydra-derivatives) | | | 2.7.5 | 2.6.9 | N/A | N/A | N/A | N/A | | [hydra-editor](https://github.com/samvera/hydra-editor) | [![Build Status](https://circleci.com/gh/samvera/hydra-editor.svg?style=svg)](https://circleci.com/gh/samvera/hydra-editor) | | | 2.7.5 | 2.6.9 | | | 6.0.3.4 | 5.2.3 | @@ -42,38 +79,6 @@ Currently, there are twenty Samvera Core Components maintained by the community: | [node-iiif](https://github.com/samvera/node-iiif) | [![Build Status](https://circleci.com/gh/samvera/node-iiif.svg?style=svg)](https://circleci.com/gh/samvera/node-iiif) | N/A | N/A | N/A | N/A | N/A | N/A | N/A | N/A | | [serverless-iiif](https://github.com/samvera/serverless-iiif) | [![Build Status](https://circleci.com/gh/samvera/serverless-iiif.svg?style=svg)](https://circleci.com/gh/samvera/serverless-iiif) | N/A | N/A | N/A | N/A | N/A | N/A | N/A | N/A | -## Maintenance Documentation - -- [ORGS](./ORGS.md) - Reference guide for the structure of GitHub Organizations (`samvera`, `samvera-labs`, and `samvera-deprecated`) -- [TEAMS](./TEAMS.md) - Reference guide for the structure of GitHub Teams within the `samvera`, `samvera-labs`, and `samvera-deprecated` Organizations -- [RELEASES](./ruby/RELEASES.md) - Reference guide for the releasing Ruby Gem components maintained by the Samvera Community - -## Samvera Component Templates - -[README.md](./templates/README.md) - The elements in this template should be in -every repository. Additional elements may be added. - -[SUPPORT.md](./templates/SUPPORT.md) - Copy this and replace `{{library}}` with -the repository name. This is linked from the README and has information on how -to create an issue, email the list, and connect to Slack. - -[CONTRIBUTING.md](./templates/CONTRIBUTING.md) - Contribution guidelines for -Samvera projects. Should be included. Minimal customization should be necessary. - -[CODE_OF_CONDUCT.md](./templates/CODE_OF_CONDUCT.md) - Should be included -verbatim in every Samvera repository. If this is updated, it needs to be -distributed to all Samvera organization repositories. - -[LICENSE](./templates/LICENSE) - Should be included in every Samvera -repository. The copyright statements may change as appropriate. This template -was taken from guidelines found on the -[wiki](https://wiki.duraspace.org/display/samvera/Code+Copyright+Statement). - -[MAILMAP](./templates/MAILMAP) - A master template for [git mailmap](https://www.git-scm.com/docs/git-check-mailmap). -This template is something to push to all samvera repositories. The goal in -applying a common mailmap is to help understand contributions as people move -and change roles/functions/laptops. - ## Ruby Scripts There exist Ruby scripts in this repository that can be used to propagate some of these templates. These are located within `ruby/scripts/`: diff --git a/bixby/.github_changelog_generator b/bixby/.github_changelog_generator new file mode 100644 index 0000000..ffb8453 --- /dev/null +++ b/bixby/.github_changelog_generator @@ -0,0 +1,2 @@ +unreleased=true +future-release=3.0.1 diff --git a/bixby/.gitignore b/bixby/.gitignore new file mode 100644 index 0000000..a9c2466 --- /dev/null +++ b/bixby/.gitignore @@ -0,0 +1,51 @@ +*.gem +*.rbc +/.config +/coverage/ +/InstalledFiles +/pkg/ +/spec/reports/ +/spec/examples.txt +/test/tmp/ +/test/version_tmp/ +/tmp/ + +# Used by dotenv library to load environment variables. +# .env + +## Specific to RubyMotion: +.dat* +.repl_history +build/ +*.bridgesupport +build-iPhoneOS/ +build-iPhoneSimulator/ + +## Specific to RubyMotion (use of CocoaPods): +# +# We recommend against adding the Pods directory to your .gitignore. However +# you should judge for yourself, the pros and cons are mentioned at: +# https://guides.cocoapods.org/using/using-cocoapods.html#should-i-check-the-pods-directory-into-source-control +# +# vendor/Pods/ + +## Documentation cache and generated files: +/.yardoc/ +/_yardoc/ +/doc/ +/rdoc/ + +## Environment normalization: +/.bundle/ +/vendor/bundle +/lib/bundler/man/ + +# for a library or gem, you might want to ignore these files since the code is +# intended to run in multiple environments; otherwise, check them in: +# Gemfile.lock +# .ruby-version +# .ruby-gemset + +# unless supporting rvm < 1.11.0 or doing something fancy, ignore this: +.rvmrc +Gemfile.lock diff --git a/bixby/.rubocop.yml b/bixby/.rubocop.yml new file mode 100644 index 0000000..3141bab --- /dev/null +++ b/bixby/.rubocop.yml @@ -0,0 +1 @@ +inherit_from: bixby_default.yml diff --git a/bixby/CHANGELOG.md b/bixby/CHANGELOG.md new file mode 100644 index 0000000..da2b16e --- /dev/null +++ b/bixby/CHANGELOG.md @@ -0,0 +1,218 @@ +# Changelog + +## [5.0.2](https://github.com/samvera/bixby/tree/v5.0.2) (2022-05-11) + +[Full Changelog](https://github.com/samvera/bixby/compare/v5.0.1...v5.0.2) + +**Merged pull requests:** + +- reinstate ruby 2.5 support [\#75](https://github.com/samvera/bixby/pull/75) ([no-reply](https://github.com/no-reply)) + +## [5.0.1](https://github.com/samvera/bixby/tree/v5.0.1) (2022-05-09) + +[Full Changelog](https://github.com/samvera/bixby/compare/v5.0.0...v5.0.1) + +**Merged pull requests:** + +- Locks down the version of Rubocop to a working image. [\#73](https://github.com/samvera/bixby/pull/73) ([bwatson78](https://github.com/bwatson78)) + +## [5.0.0](https://github.com/samvera/bixby/tree/v5.0.0) (2022-05-09) + +[Full Changelog](https://github.com/samvera/bixby/compare/v4.0.0...v5.0.0) + +**Merged pull requests:** + +- Introduces a configuration for scheduled, nightly test suite executions on CircleCI [\#70](https://github.com/samvera/bixby/pull/70) ([jrgriffiniii](https://github.com/jrgriffiniii)) +- Removes Lint/UselessElseWithoutRescue cop. [\#72](https://github.com/samvera/bixby/pull/72) ([bwatson78](https://github.com/bwatson78)) + +## [4.0.0](https://github.com/samvera/bixby/tree/v4.0.0) (2022-03-30) + +[Full Changelog](https://github.com/samvera/bixby/compare/v3.0.2...v4.0.0) + +**Merged pull requests:** + +- Upgrade to rubocop 1.x [\#57](https://github.com/samvera/bixby/pull/57) ([cjcolvar](https://github.com/cjcolvar)) +- Updated CONTRIBUTING [\#55](https://github.com/samvera/bixby/pull/55) ([kelynch](https://github.com/kelynch)) +- Updated README [\#54](https://github.com/samvera/bixby/pull/54) ([kelynch](https://github.com/kelynch)) +- Preparing the Gem for promotion to Core Component [\#60](https://github.com/samvera/bixby/pull/60) ([jrgriffiniii](https://github.com/jrgriffiniii)) +- Adding the CI branch name test for `master` [\#61](https://github.com/samvera/bixby/pull/61) ([kelynch](https://github.com/kelynch)) +- Make new issue link work now [\#63](https://github.com/samvera/bixby/pull/63) ([cjcolvar](https://github.com/cjcolvar)) +- Fix reference in README to main branch [\#66](https://github.com/samvera/bixby/pull/66) ([bess](https://github.com/bess)) + +## [3.0.2](https://github.com/samvera/bixby/tree/v3.0.2) (2020-09-16) + +[Full Changelog](https://github.com/samvera/bixby/compare/v3.0.1...v3.0.2) + +**Merged pull requests:** + +- Setting rubocop-ast to ~> 0.3.0 [\#47](https://github.com/samvera/bixby/pull/47) ([jeremyf](https://github.com/jeremyf)) + +## [3.0.1](https://github.com/samvera/bixby/tree/3.0.1) (2020-06-16) + +[Full Changelog](https://github.com/samvera/bixby/compare/v3.0.0...3.0.1) + +**Merged pull requests:** + +- Removes IndentationConsistency supported styles [\#45](https://github.com/samvera/bixby/pull/45) ([rotated8](https://github.com/rotated8)) +- allow non-ascii characters in comments [\#44](https://github.com/samvera/bixby/pull/44) ([no-reply](https://github.com/no-reply)) + +## [v3.0.0](https://github.com/samvera/bixby/tree/v3.0.0) (2020-06-10) + +[Full Changelog](https://github.com/samvera/bixby/compare/v3.0.0.pre3...v3.0.0) + +**Merged pull requests:** + +- Prep for 3.0.0 release [\#43](https://github.com/samvera/bixby/pull/43) ([bess](https://github.com/bess)) +- Prep for 3.0.0.pre3 release [\#42](https://github.com/samvera/bixby/pull/42) ([bess](https://github.com/bess)) + +## [v3.0.0.pre3](https://github.com/samvera/bixby/tree/v3.0.0.pre3) (2020-06-10) + +[Full Changelog](https://github.com/samvera/bixby/compare/v3.0.0.pre2...v3.0.0.pre3) + +**Merged pull requests:** + +- Disable Rails/DynamicFindBy [\#41](https://github.com/samvera/bixby/pull/41) ([bess](https://github.com/bess)) + +## [v3.0.0.pre2](https://github.com/samvera/bixby/tree/v3.0.0.pre2) (2020-06-10) + +[Full Changelog](https://github.com/samvera/bixby/compare/v3.0.0.pre1...v3.0.0.pre2) + +**Merged pull requests:** + +- Prep for 3.0.0.pre2 release [\#40](https://github.com/samvera/bixby/pull/40) ([bess](https://github.com/bess)) +- 3.0.0 fixup [\#39](https://github.com/samvera/bixby/pull/39) ([no-reply](https://github.com/no-reply)) + +## [v3.0.0.pre1](https://github.com/samvera/bixby/tree/v3.0.0.pre1) (2020-06-10) + +[Full Changelog](https://github.com/samvera/bixby/compare/v3.0.0.pre.pre1...v3.0.0.pre1) + +**Merged pull requests:** + +- Fix gem version [\#38](https://github.com/samvera/bixby/pull/38) ([bess](https://github.com/bess)) + +## [v3.0.0.pre.pre1](https://github.com/samvera/bixby/tree/v3.0.0.pre.pre1) (2020-06-10) + +[Full Changelog](https://github.com/samvera/bixby/compare/v2.1.0...v3.0.0.pre.pre1) + +**Implemented enhancements:** + +- Request to promote this Gem to samvera [\#33](https://github.com/samvera/bixby/issues/33) + +**Merged pull requests:** + +- Prep for 3.0.0-pre1 release [\#37](https://github.com/samvera/bixby/pull/37) ([bess](https://github.com/bess)) +- Prepares the Gem for promotion [\#34](https://github.com/samvera/bixby/pull/34) ([jrgriffiniii](https://github.com/jrgriffiniii)) + +## [v2.1.0](https://github.com/samvera/bixby/tree/v2.1.0) (2020-06-09) + +[Full Changelog](https://github.com/samvera/bixby/compare/v2.0.0...v2.1.0) + +**Merged pull requests:** + +- Prep for 2.1.0 release [\#36](https://github.com/samvera/bixby/pull/36) ([bess](https://github.com/bess)) +- Upgrade rubocop and dependencies [\#35](https://github.com/samvera/bixby/pull/35) ([bess](https://github.com/bess)) +- Prep for 2.0 release [\#31](https://github.com/samvera/bixby/pull/31) ([bess](https://github.com/bess)) + +## [v2.0.0](https://github.com/samvera/bixby/tree/v2.0.0) (2019-12-10) + +[Full Changelog](https://github.com/samvera/bixby/compare/v2.0.0.pre.beta1...v2.0.0) + +**Closed issues:** + +- Upgrade for new rubocop [\#26](https://github.com/samvera/bixby/issues/26) +- Update rubocop-rspec [\#25](https://github.com/samvera/bixby/issues/25) +- Lint/BlockAlignment has the wrong namespace - should be Layout [\#24](https://github.com/samvera/bixby/issues/24) +- Add Lint/RescueWithoutErrorClass [\#23](https://github.com/samvera/bixby/issues/23) + +**Merged pull requests:** + +- Skipping node\_modules directory when running cops [\#30](https://github.com/samvera/bixby/pull/30) ([cgalarza](https://github.com/cgalarza)) + +## [v2.0.0.pre.beta1](https://github.com/samvera/bixby/tree/v2.0.0.pre.beta1) (2019-02-14) + +[Full Changelog](https://github.com/samvera/bixby/compare/1.0.0...v2.0.0.pre.beta1) + +**Merged pull requests:** + +- Bixby 2.0 [\#28](https://github.com/samvera/bixby/pull/28) ([no-reply](https://github.com/no-reply)) +- Bump version to 1.0.0-rc1 [\#21](https://github.com/samvera/bixby/pull/21) ([no-reply](https://github.com/no-reply)) + +## [1.0.0](https://github.com/samvera/bixby/tree/1.0.0) (2018-02-13) + +[Full Changelog](https://github.com/samvera/bixby/compare/v1.0.0-rc1...1.0.0) + +**Merged pull requests:** + +- Prepare Release 1.0.0 [\#22](https://github.com/samvera/bixby/pull/22) ([no-reply](https://github.com/no-reply)) + +## [v1.0.0-rc1](https://github.com/samvera/bixby/tree/v1.0.0-rc1) (2018-02-09) + +[Full Changelog](https://github.com/samvera/bixby/compare/v0.3.1...v1.0.0-rc1) + +**Closed issues:** + +- Disable `RSpec/MulitpleExpectations` [\#19](https://github.com/samvera/bixby/issues/19) +- Add tmp dir to AllCops exclusion [\#18](https://github.com/samvera/bixby/issues/18) +- Warning: unrecognized cop Naming/BinaryOperatorParameter found in ~/.gem/ruby/2.4.2/gems/bixby-0.3.0/bixby\_default.yml [\#14](https://github.com/samvera/bixby/issues/14) +- Resolve new cops/changes is in rubocop-rspec 0.18.0. [\#11](https://github.com/samvera/bixby/issues/11) +- Resolve new cops/changes in RuboCop 0.50.0 [\#10](https://github.com/samvera/bixby/issues/10) +- Bixby not compatible with latest Rubocop [\#6](https://github.com/samvera/bixby/issues/6) + +**Merged pull requests:** + +- Support newer versions of `rubocop`, `rubocop-rspec`, and Ruby [\#20](https://github.com/samvera/bixby/pull/20) ([no-reply](https://github.com/no-reply)) +- Remove Lint/InvalidCharacterLiteral, fixes \#15 [\#16](https://github.com/samvera/bixby/pull/16) ([hackmastera](https://github.com/hackmastera)) +- Update READEME.md to discuss versioning strategy [\#13](https://github.com/samvera/bixby/pull/13) ([no-reply](https://github.com/no-reply)) +- Lock versions to `rubocop` 0.50.0 and `rubocop-rspec` 1.18.0 [\#12](https://github.com/samvera/bixby/pull/12) ([no-reply](https://github.com/no-reply)) + +## [v0.3.1](https://github.com/samvera/bixby/tree/v0.3.1) (2017-10-04) + +[Full Changelog](https://github.com/samvera/bixby/compare/v0.3.0...v0.3.1) + +**Closed issues:** + +- Error: The `Lint/InvalidCharacterLiteral` cop has been removed since it was never being actually triggered. \(obsolete configuration found in /home/ubuntu/valkyrie/valkyrie/vendor/valk\_bundle/ruby/2.3.0/gems/bixby-0.3.0/bixby\_default.yml, please update it\) [\#15](https://github.com/samvera/bixby/issues/15) + +**Merged pull requests:** + +- Remove Lint/InvalidCharacterLiteral, fixes \#15 [\#17](https://github.com/samvera/bixby/pull/17) ([hackmastera](https://github.com/hackmastera)) + +## [v0.3.0](https://github.com/samvera/bixby/tree/v0.3.0) (2017-10-03) + +[Full Changelog](https://github.com/samvera/bixby/compare/v0.2.2...v0.3.0) + +**Merged pull requests:** + +- Prepare Release v0.3.0 [\#9](https://github.com/samvera/bixby/pull/9) ([no-reply](https://github.com/no-reply)) +- Upgrade for RuboCop 0.50.0 compatibility [\#8](https://github.com/samvera/bixby/pull/8) ([no-reply](https://github.com/no-reply)) +- Allow deeper group nesting in RSpec [\#7](https://github.com/samvera/bixby/pull/7) ([no-reply](https://github.com/no-reply)) + +## [v0.2.2](https://github.com/samvera/bixby/tree/v0.2.2) (2017-08-07) + +[Full Changelog](https://github.com/samvera/bixby/compare/v0.2.1...v0.2.2) + +**Closed issues:** + +- Should we allow long blocks in CatalogController? [\#3](https://github.com/samvera/bixby/issues/3) + +**Merged pull requests:** + +- Ignore block and class length on CatalogController [\#5](https://github.com/samvera/bixby/pull/5) ([no-reply](https://github.com/no-reply)) +- Include 'Capfile' in excluded filenames [\#4](https://github.com/samvera/bixby/pull/4) ([mark-dce](https://github.com/mark-dce)) + +## [v0.2.1](https://github.com/samvera/bixby/tree/v0.2.1) (2017-06-01) + +[Full Changelog](https://github.com/samvera/bixby/compare/v0.2.0...v0.2.1) + +**Merged pull requests:** + +- Add bundler release tasks for easier gem management [\#2](https://github.com/samvera/bixby/pull/2) ([bess](https://github.com/bess)) +- Rubocop 0 49 fixes [\#1](https://github.com/samvera/bixby/pull/1) ([bess](https://github.com/bess)) + +## [v0.2.0](https://github.com/samvera/bixby/tree/v0.2.0) (2017-03-30) + +[Full Changelog](https://github.com/samvera/bixby/compare/8f95541b23cfda44c8a89704127696262284215a...v0.2.0) + + + +\* *This Changelog was automatically generated by [github_changelog_generator](https://github.com/github-changelog-generator/github-changelog-generator)* diff --git a/bixby/CODE_OF_CONDUCT.md b/bixby/CODE_OF_CONDUCT.md new file mode 100644 index 0000000..f54505d --- /dev/null +++ b/bixby/CODE_OF_CONDUCT.md @@ -0,0 +1,36 @@ +The Samvera community is dedicated to providing a welcoming and +positive experience for all its members, whether they are at a formal +gathering, in a social setting, or taking part in activities online. +The Samvera community welcomes participation from people all over the +world and these members bring with them a wide variety of +professional, personal and social backgrounds; whatever these may be, +we treat colleagues with dignity and respect. + +Community members communicate primarily in English, though for many of +them this is not their native language. We therefore strive to express +ourselves simply and clearly remembering that unnecessary use of +jargon and slang will be a barrier to understanding for many of our +colleagues. We are sensitive to the fact that the international +nature of the community means that we span many different social norms +around language and behaviour and we strive to conduct ourselves, +online and in person, in ways that are unlikely to cause offence. + +Samvera conversations are often information-rich and intended to +generate discussion and debate. We discuss ideas from a standpoint of +mutual respect and reasoned argument. + +Community members work together to promote a respectful and safe +community. In the event that someone’s conduct is causing offence or +distress, Samvera has a detailed +[Anti-Harassment Policy and Protocol](https://wiki.duraspace.org/display/samvera/Anti-Harassment+Policy) +which can be applied to address the problem. The first step in dealing +with any serious misconduct is to contact a local meeting organizer, +the +[Samvera community helpers](https://wiki.duraspace.org/display/samvera/Samvera+Community+Helpers) +([email](mailto:helpers@samvera.org)), a community member you +trust, or the +[Samvera Steering Group](https://wiki.duraspace.org/display/samvera/Samvera+Steering+Group+membership) +immediately; at Samvera events, these people can be identified by +distinctive name badges. The +[Policy and Protocol](https://wiki.duraspace.org/display/samvera/Anti-Harassment+Policy) +should be consulted for fuller details. \ No newline at end of file diff --git a/bixby/CONTRIBUTING.md b/bixby/CONTRIBUTING.md new file mode 100644 index 0000000..c06cc7e --- /dev/null +++ b/bixby/CONTRIBUTING.md @@ -0,0 +1,192 @@ +# How to Contribute + +We want your help to make the Samvera community great. There are a few guidelines +that we need contributors to follow so that we can have a chance of +keeping on top of things. + +## Code of Conduct + +The Samvera Community is dedicated to providing a welcoming and positive +experience for all its members, whether they are at a formal gathering, in +a social setting, or taking part in activities online. Please see our +[Code of Conduct](CODE_OF_CONDUCT.md) for more information. + +## Samvera Community Intellectual Property Licensing and Ownership + +All code contributors must have an Individual Contributor License Agreement +(iCLA) on file with the Samvera Steering Group. If the contributor works for +an institution, the institution must have a Corporate Contributor License +Agreement (cCLA) on file. + +https://wiki.duraspace.org/display/samvera/Samvera+Community+Intellectual+Property+Licensing+and+Ownership + +You should also add yourself to the `CONTRIBUTORS.md` file in the root of the project. + +## Language + +The language we use matters. Today, tomorrow, and for years to come +people will read the code we write. They will judge us for our +design, logic, and the words we use to describe the system. + +Our words should be accessible. Favor descriptive words that give +meaning while avoiding reinforcing systemic inequities. For example, +in the Samvera community, we should favor using allowed\_list instead +of whitelist, denied\_list instead of blacklist, or source/copy +instead of master/slave. + +We're going to get it wrong, but this is a call to keep working to +make it right. View our code and the words we choose as a chance to +have a conversation. A chance to grow an understanding of the systems +we develop as well as the systems in which we live. + +See [“Blacklists” and “whitelists”: a salutary warning concerning the +prevalence of racist language in discussions of predatory +publishing](https://www.ncbi.nlm.nih.gov/pmc/articles/PMC6148600/) for +further details. + +## Contribution Tasks + +* Reporting Issues +* Making Changes +* Documenting Code +* Committing Changes +* Submitting Changes +* Reviewing and Merging Changes + +### Reporting Issues + +* Make sure you have a [GitHub account](https://github.com/signup/free) +* Submit a [Github issue](https://github.com/samvera/bixby/issues/) by: + * Clearly describing the issue + * Provide a descriptive summary + * Explain the expected behavior + * Explain the actual behavior + * Provide steps to reproduce the actual behavior + +### Making Changes + +* Fork the repository on GitHub +* Create a topic branch from where you want to base your work. + * This is usually the `main` branch. + * To quickly create a topic branch based on `main`; `git branch fix/main/my_contribution main` + * Then checkout the new branch with `git checkout fix/main/my_contribution`. + * Please avoid working directly on the `main` branch. + * Please do not create a branch called `master`. (See note below.) + * You may find the [hub suite of commands](https://github.com/defunkt/hub) helpful +* Make sure you have added sufficient tests and documentation for your changes. + * Test functionality with RSpec; Test features / UI with Capybara. +* Run _all_ the tests to assure nothing else was accidentally broken. + +NOTE: This repository follows the [Samvera Community Code of Conduct](https://samvera.atlassian.net/wiki/spaces/samvera/pages/405212316/Code+of+Conduct) +and [language recommendations](#language). +Please ***do not*** create a branch called `master` for this repository or as part of +your pull request; the branch will either need to be removed or renamed before it can +be considered for inclusion in the code base and history of this repository. + +### Documenting Code + +* All new public methods, modules, and classes should include inline documentation in [YARD](http://yardoc.org/). + * Documentation should seek to answer the question "why does this code exist?" +* Document private / protected methods as desired. +* If you are working in a file with no prior documentation, do try to document as you gain understanding of the code. + * If you don't know exactly what a bit of code does, it is extra likely that it needs to be documented. Take a stab at it and ask for feedback in your pull request. You can use the 'blame' button on GitHub to identify the original developer of the code and @mention them in your comment. + * This work greatly increases the usability of the code base and supports the on-ramping of new committers. + * We will all be understanding of one another's time constraints in this area. +* [Getting started with YARD](http://www.rubydoc.info/gems/yard/file/docs/GettingStarted.md) + +### Committing changes + +* Make commits of logical units. +* Check for unnecessary whitespace with `git diff --check` before committing. +* Make sure your commit messages are [well formed](http://tbaggery.com/2008/04/19/a-note-about-git-commit-messages.html). +* If you created an issue, you can close it by including "Closes #issue" in your commit message. See [Github's blog post for more details](https://github.com/blog/1386-closing-issues-via-commit-messages) + +``` + Present tense short summary (50 characters or less) + + More detailed description, if necessary. It should be wrapped to 72 + characters. Try to be as descriptive as you can, even if you think that + the commit content is obvious, it may not be obvious to others. You + should add such description also if it's already present in bug tracker, + it should not be necessary to visit a webpage to check the history. + + Include Closes # when relavent. + + Description can have multiple paragraphs and you can use code examples + inside, just indent it with 4 spaces: + + class PostsController + def index + respond_to do |wants| + wants.html { render 'index' } + end + end + end + + You can also add bullet points: + + - you can use dashes or asterisks + + - also, try to indent next line of a point for readability, if it's too + long to fit in 72 characters +``` + +* Make sure you have added the necessary tests for your changes. +* Run _all_ the tests to assure nothing else was accidentally broken. +* When you are ready to submit a pull request + +### Submitting Changes + +* Read the article ["Using Pull Requests"](https://help.github.com/articles/using-pull-requests) on GitHub. +* Make sure your branch is up to date with its parent branch (i.e. main) + * `git checkout main` + * `git pull --rebase` + * `git checkout ` + * `git rebase main` + * It is a good idea to run your tests again. +* If you've made more than one commit take a moment to consider whether squashing commits together would help improve their logical grouping. + * [Detailed Walkthrough of One Pull Request per Commit](http://ndlib.github.io/practices/one-commit-per-pull-request/) + * `git rebase --interactive main` ([See Github help](https://help.github.com/articles/interactive-rebase)) + * Squashing your branch's changes into one commit is "good form" and helps the person merging your request to see everything that is going on. +* Push your changes to a topic branch in your fork of the repository. +* Submit a pull request from your fork to the project. + +### Reviewing and Merging Changes + +We adopted [Github's Pull Request Review](https://help.github.com/articles/about-pull-request-reviews/) for our repositories. +Common checks that may occur in our repositories: + +1. [CircleCI](https://circleci.com/gh/samvera) - where our automated tests are running +2. RuboCop/Bixby - where we check for style violations +3. Approval Required - Github enforces at least one person approve a pull request. Also, all reviewers that have chimed in must approve. +4. CodeClimate - is our code remaining healthy (at least according to static code analysis) + +If one or more of the required checks failed (or are incomplete), the code should not be merged (and the UI will not allow it). If all of the checks have passed, then anyone on the project (including the pull request submitter) may merge the code. + +*Example: Carolyn submits a pull request, Justin reviews the pull request and approves. However, Justin is still waiting on other checks (CI tests are usually the culprit), so he does not merge the pull request. Eventually, all of the checks pass. At this point, Carolyn or anyone else may merge the pull request.* + +#### Things to Consider When Reviewing + +First, the person contributing the code is putting themselves out there. Be mindful of what you say in a review. + +* Ask clarifying questions +* State your understanding and expectations +* Provide example code or alternate solutions, and explain why + +This is your chance for a mentoring moment of another developer. Take time to give an honest and thorough review of what has changed. Things to consider: + + * Does the commit message explain what is going on? + * Does the code changes have tests? _Not all changes need new tests, some changes are refactorings_ + * Do new or changed methods, modules, and classes have documentation? + * Does the commit contain more than it should? Are two separate concerns being addressed in one commit? + * Does the description of the new/changed specs match your understanding of what the spec is doing? + * Did the Continuous Integration tests complete successfully? + +If you are uncertain, bring other contributors into the conversation by assigning them as a reviewer. + +# Additional Resources + +* [General GitHub documentation](http://help.github.com/) +* [GitHub pull request documentation](https://help.github.com/articles/about-pull-requests/) +* [Pro Git](http://git-scm.com/book) is both a free and excellent book about Git. +* [A Git Config for Contributing](http://ndlib.github.io/practices/my-typical-per-project-git-config/) diff --git a/bixby/Gemfile b/bixby/Gemfile new file mode 100644 index 0000000..7f4f5e9 --- /dev/null +++ b/bixby/Gemfile @@ -0,0 +1,5 @@ +# frozen_string_literal: true + +source 'https://rubygems.org' + +gemspec diff --git a/bixby/LICENSE b/bixby/LICENSE new file mode 100644 index 0000000..8dada3e --- /dev/null +++ b/bixby/LICENSE @@ -0,0 +1,201 @@ + Apache License + Version 2.0, January 2004 + http://www.apache.org/licenses/ + + TERMS AND CONDITIONS FOR USE, REPRODUCTION, AND DISTRIBUTION + + 1. Definitions. + + "License" shall mean the terms and conditions for use, reproduction, + and distribution as defined by Sections 1 through 9 of this document. + + "Licensor" shall mean the copyright owner or entity authorized by + the copyright owner that is granting the License. + + "Legal Entity" shall mean the union of the acting entity and all + other entities that control, are controlled by, or are under common + control with that entity. For the purposes of this definition, + "control" means (i) the power, direct or indirect, to cause the + direction or management of such entity, whether by contract or + otherwise, or (ii) ownership of fifty percent (50%) or more of the + outstanding shares, or (iii) beneficial ownership of such entity. + + "You" (or "Your") shall mean an individual or Legal Entity + exercising permissions granted by this License. + + "Source" form shall mean the preferred form for making modifications, + including but not limited to software source code, documentation + source, and configuration files. + + "Object" form shall mean any form resulting from mechanical + transformation or translation of a Source form, including but + not limited to compiled object code, generated documentation, + and conversions to other media types. + + "Work" shall mean the work of authorship, whether in Source or + Object form, made available under the License, as indicated by a + copyright notice that is included in or attached to the work + (an example is provided in the Appendix below). + + "Derivative Works" shall mean any work, whether in Source or Object + form, that is based on (or derived from) the Work and for which the + editorial revisions, annotations, elaborations, or other modifications + represent, as a whole, an original work of authorship. For the purposes + of this License, Derivative Works shall not include works that remain + separable from, or merely link (or bind by name) to the interfaces of, + the Work and Derivative Works thereof. + + "Contribution" shall mean any work of authorship, including + the original version of the Work and any modifications or additions + to that Work or Derivative Works thereof, that is intentionally + submitted to Licensor for inclusion in the Work by the copyright owner + or by an individual or Legal Entity authorized to submit on behalf of + the copyright owner. For the purposes of this definition, "submitted" + means any form of electronic, verbal, or written communication sent + to the Licensor or its representatives, including but not limited to + communication on electronic mailing lists, source code control systems, + and issue tracking systems that are managed by, or on behalf of, the + Licensor for the purpose of discussing and improving the Work, but + excluding communication that is conspicuously marked or otherwise + designated in writing by the copyright owner as "Not a Contribution." + + "Contributor" shall mean Licensor and any individual or Legal Entity + on behalf of whom a Contribution has been received by Licensor and + subsequently incorporated within the Work. + + 2. Grant of Copyright License. Subject to the terms and conditions of + this License, each Contributor hereby grants to You a perpetual, + worldwide, non-exclusive, no-charge, royalty-free, irrevocable + copyright license to reproduce, prepare Derivative Works of, + publicly display, publicly perform, sublicense, and distribute the + Work and such Derivative Works in Source or Object form. + + 3. Grant of Patent License. Subject to the terms and conditions of + this License, each Contributor hereby grants to You a perpetual, + worldwide, non-exclusive, no-charge, royalty-free, irrevocable + (except as stated in this section) patent license to make, have made, + use, offer to sell, sell, import, and otherwise transfer the Work, + where such license applies only to those patent claims licensable + by such Contributor that are necessarily infringed by their + Contribution(s) alone or by combination of their Contribution(s) + with the Work to which such Contribution(s) was submitted. If You + institute patent litigation against any entity (including a + cross-claim or counterclaim in a lawsuit) alleging that the Work + or a Contribution incorporated within the Work constitutes direct + or contributory patent infringement, then any patent licenses + granted to You under this License for that Work shall terminate + as of the date such litigation is filed. + + 4. Redistribution. You may reproduce and distribute copies of the + Work or Derivative Works thereof in any medium, with or without + modifications, and in Source or Object form, provided that You + meet the following conditions: + + (a) You must give any other recipients of the Work or + Derivative Works a copy of this License; and + + (b) You must cause any modified files to carry prominent notices + stating that You changed the files; and + + (c) You must retain, in the Source form of any Derivative Works + that You distribute, all copyright, patent, trademark, and + attribution notices from the Source form of the Work, + excluding those notices that do not pertain to any part of + the Derivative Works; and + + (d) If the Work includes a "NOTICE" text file as part of its + distribution, then any Derivative Works that You distribute must + include a readable copy of the attribution notices contained + within such NOTICE file, excluding those notices that do not + pertain to any part of the Derivative Works, in at least one + of the following places: within a NOTICE text file distributed + as part of the Derivative Works; within the Source form or + documentation, if provided along with the Derivative Works; or, + within a display generated by the Derivative Works, if and + wherever such third-party notices normally appear. The contents + of the NOTICE file are for informational purposes only and + do not modify the License. You may add Your own attribution + notices within Derivative Works that You distribute, alongside + or as an addendum to the NOTICE text from the Work, provided + that such additional attribution notices cannot be construed + as modifying the License. + + You may add Your own copyright statement to Your modifications and + may provide additional or different license terms and conditions + for use, reproduction, or distribution of Your modifications, or + for any such Derivative Works as a whole, provided Your use, + reproduction, and distribution of the Work otherwise complies with + the conditions stated in this License. + + 5. Submission of Contributions. Unless You explicitly state otherwise, + any Contribution intentionally submitted for inclusion in the Work + by You to the Licensor shall be under the terms and conditions of + this License, without any additional terms or conditions. + Notwithstanding the above, nothing herein shall supersede or modify + the terms of any separate license agreement you may have executed + with Licensor regarding such Contributions. + + 6. Trademarks. This License does not grant permission to use the trade + names, trademarks, service marks, or product names of the Licensor, + except as required for reasonable and customary use in describing the + origin of the Work and reproducing the content of the NOTICE file. + + 7. Disclaimer of Warranty. Unless required by applicable law or + agreed to in writing, Licensor provides the Work (and each + Contributor provides its Contributions) on an "AS IS" BASIS, + WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or + implied, including, without limitation, any warranties or conditions + of TITLE, NON-INFRINGEMENT, MERCHANTABILITY, or FITNESS FOR A + PARTICULAR PURPOSE. You are solely responsible for determining the + appropriateness of using or redistributing the Work and assume any + risks associated with Your exercise of permissions under this License. + + 8. Limitation of Liability. In no event and under no legal theory, + whether in tort (including negligence), contract, or otherwise, + unless required by applicable law (such as deliberate and grossly + negligent acts) or agreed to in writing, shall any Contributor be + liable to You for damages, including any direct, indirect, special, + incidental, or consequential damages of any character arising as a + result of this License or out of the use or inability to use the + Work (including but not limited to damages for loss of goodwill, + work stoppage, computer failure or malfunction, or any and all + other commercial damages or losses), even if such Contributor + has been advised of the possibility of such damages. + + 9. Accepting Warranty or Additional Liability. While redistributing + the Work or Derivative Works thereof, You may choose to offer, + and charge a fee for, acceptance of support, warranty, indemnity, + or other liability obligations and/or rights consistent with this + License. However, in accepting such obligations, You may act only + on Your own behalf and on Your sole responsibility, not on behalf + of any other Contributor, and only if You agree to indemnify, + defend, and hold each Contributor harmless for any liability + incurred by, or claims asserted against, such Contributor by reason + of your accepting any such warranty or additional liability. + + END OF TERMS AND CONDITIONS + + APPENDIX: How to apply the Apache License to your work. + + To apply the Apache License to your work, attach the following + boilerplate notice, with the fields enclosed by brackets "{}" + replaced with your own identifying information. (Don't include + the brackets!) The text should be enclosed in the appropriate + comment syntax for the file format. We also recommend that a + file or class name and description of purpose be included on the + same "printed page" as the copyright notice for easier + identification within third-party archives. + + Copyright {yyyy} {name of copyright owner} + + Licensed under the Apache License, Version 2.0 (the "License"); + you may not use this file except in compliance with the License. + You may obtain a copy of the License at + + http://www.apache.org/licenses/LICENSE-2.0 + + Unless required by applicable law or agreed to in writing, software + distributed under the License is distributed on an "AS IS" BASIS, + WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + See the License for the specific language governing permissions and + limitations under the License. diff --git a/bixby/README.md b/bixby/README.md new file mode 100644 index 0000000..86171ae --- /dev/null +++ b/bixby/README.md @@ -0,0 +1,81 @@ +Bixby: I'd buy that for a dollar! +================================= + +Code: +[![Gem Version](https://badge.fury.io/rb/bixby.svg)](https://badge.fury.io/rb/bixby) +[![Build Status](https://circleci.com/gh/samvera/bixby.svg?style=svg)](https://circleci.com/gh/samvera/bixby) + +Docs: +[![Contribution Guidelines](http://img.shields.io/badge/CONTRIBUTING-Guidelines-blue.svg)](./CONTRIBUTING.md) +[![Apache 2.0 License](http://img.shields.io/badge/APACHE2-license-blue.svg)](./LICENSE) + +Community Support: [![Samvera Community Slack](https://img.shields.io/badge/samvera-slack-blueviolet)](http://slack.samvera.org/) + +

+ Murphy Sketch +

+ +# What is Bixby? + +Bixby is a Ruby Gem containing the default configuration settings for [RuboCop](https://github.com/rubocop/rubocop) used to enforce common Ruby style guidelines across Samvera community projects. + +# Help + +The Samvera Community is here to help. Please see our [support guide](./.github/SUPPORT.md). + +See the Samvera Confluence for information at the architecture level: + +Additionally, new adopters and potential adopters may find the pages here useful: + +Further questions? [Get in touch](https://samvera.atlassian.net/wiki/spaces/samvera/pages/405211682/Getting+Started+in+the+Samvera+Community) + +## To Use This + +In your `Gemfile`: + +```ruby +gem 'bixby' +``` + +In your `.rubocop.yml`: + +```yaml +inherit_gem: + bixby: bixby_default.yml +``` + +## Versioning & Dependencies + +This project depends on `rubocop` and `rubocop-rspec`. It supports versions of those gems pessimistically. Beginning with release `1.0.0`, we will periodically add support for new versions of the dependencies and manage the included cops. When compatibility breaks, the major version of `bixby` will be bumped. + +Our goal is to insulate downstream projects from breakage due to pre-1.0 version updates in `rubocop`. + +## License + +Bixby is available under [the Apache 2.0 license](LICENSE.md). + +## Releasing + +1. `bundle install` +1. Increase the version number in `bixby.gemspec` +1. Increase the same version number in `.github_changelog_generator` +1. Update `CHANGELOG.md` by running this command: + ``` + github_changelog_generator --user samvera --project bixby --token YOUR_GITHUB_TOKEN_HERE + ``` +1. Commit these changes to the main branch +1. Run `rake release` + +## Contributing + +If you're working on a PR for this project, create a feature branch off of `main`. + +This repository follows the [Samvera Community Code of Conduct](https://samvera.atlassian.net/wiki/spaces/samvera/pages/405212316/Code+of+Conduct) and [language recommendations](https://github.com/samvera/maintenance/blob/main/templates/CONTRIBUTING.md#language). Please ***do not*** create a branch called `master` for this repository or as part of your pull request; the branch will either need to be removed or renamed before it can be considered for inclusion in the code base and history of this repository. + +## Acknowledgments + +The Alex J. Murphy sketch "logo" is courtesy of [acid_lich](https://www.instagram.com/acid_lich/), all rights reserved. + +This software has been developed by and is brought to you by the Samvera community. Learn more at the [Samvera Community website](https://samvera.org/). + +![Samvera Logo](https://samvera.org/wp-content/uploads/2017/06/samvera-logo-tm.svg) diff --git a/bixby/Rakefile b/bixby/Rakefile new file mode 100644 index 0000000..7398a90 --- /dev/null +++ b/bixby/Rakefile @@ -0,0 +1,3 @@ +# frozen_string_literal: true + +require 'bundler/gem_tasks' diff --git a/bixby/SUPPORT.md b/bixby/SUPPORT.md new file mode 100644 index 0000000..68109e5 --- /dev/null +++ b/bixby/SUPPORT.md @@ -0,0 +1,5 @@ +If you would like to report an issue, first search [the list of issues](https://github.com/samvera/bixby/issues/) to see if someone else has already reported it, and then feel free to [create a new issue](https://github.com/samvera/bixby/issues/new). + +If you have questions or need help, please email [the Samvera community tech list](https://groups.google.com/forum/#!forum/samvera-tech) or stop by the #dev channel in [the Samvera community Slack team](https://wiki.duraspace.org/pages/viewpage.action?pageId=87460391#Getintouch!-Slack). + +You can learn more about the various Samvera communication channels on the [Get in touch!](https://wiki.duraspace.org/pages/viewpage.action?pageId=87460391) wiki page. diff --git a/bixby/bixby.gemspec b/bixby/bixby.gemspec new file mode 100644 index 0000000..bdd6e15 --- /dev/null +++ b/bixby/bixby.gemspec @@ -0,0 +1,28 @@ +# frozen_string_literal: true + +Gem::Specification.new do |spec| + spec.authors = ['Tamsin Johnson'] + spec.email = ['johnson.tom@gmail.com'] + spec.description = 'A Style Configuration for RuboCop' + spec.summary = 'This is the recommended style configuration for use ' \ + 'by Samvera Community projects.' + spec.homepage = 'http://github.com/samvera/bixby' + spec.files = `git ls-files`.split($OUTPUT_RECORD_SEPARATOR) + spec.metadata = { "rubygems_mfa_required" => "true" } + + spec.name = 'bixby' + spec.require_paths = ['lib'] + + spec.version = '5.0.2' + spec.license = 'Apache-2.0' + + spec.required_ruby_version = '>= 2.5' + + spec.add_dependency 'rubocop', '1.28.2' + spec.add_dependency 'rubocop-ast' + spec.add_dependency 'rubocop-performance' + spec.add_dependency 'rubocop-rails' + spec.add_dependency 'rubocop-rspec' + + spec.add_development_dependency 'github_changelog_generator' +end diff --git a/bixby/bixby_default.yml b/bixby/bixby_default.yml new file mode 100644 index 0000000..e26c562 --- /dev/null +++ b/bixby/bixby_default.yml @@ -0,0 +1,921 @@ +require: rubocop-performance + +AllCops: + TargetRubyVersion: 2.6 + DisabledByDefault: true + DisplayCopNames: true + Exclude: + - 'db/**/*' + - 'script/**/*' + - 'tmp/**/*' + - 'vendor/**/*' + - 'node_modules/**/*' + +inherit_from: + - bixby_rails_enabled.yml + - bixby_rspec_enabled.yml + +Style/Alias: + Enabled: true + +Style/AndOr: + Enabled: true + +Style/ArrayJoin: + Enabled: true + +Style/Attr: + Enabled: true + +Style/BeginBlock: + Enabled: true + +Style/BarePercentLiterals: + Enabled: true + +Style/BlockComments: + Enabled: true + +Style/BlockDelimiters: + Enabled: true + +Style/CaseEquality: + Enabled: true + +Style/CharacterLiteral: + Enabled: true + +Style/ClassCheck: + Enabled: true + +Style/ClassMethods: + Enabled: true + +Style/ClassVars: + Enabled: true + +Style/ColonMethodCall: + Enabled: true + +Style/CollectionMethods: + PreferredMethods: + collect: 'map' + collect!: 'map!' + inject: 'reduce' + detect: 'find' + find_all: 'select' + Enabled: false + +Style/CommandLiteral: + Enabled: true + +Style/CommentAnnotation: + Enabled: true + +Style/ConditionalAssignment: + Enabled: true + +Style/DefWithParentheses: + Enabled: true + +Style/Documentation: + Enabled: false + Exclude: + - 'spec/**/*' + - 'test/**/*' + +Style/DoubleNegation: + Enabled: true + +Style/EachForSimpleLoop: + Enabled: true + +Style/EachWithObject: + Enabled: true + +Style/EmptyElse: + Enabled: true + +Style/EmptyCaseCondition: + Enabled: true + +Style/EmptyLiteral: + Enabled: true + +Style/EmptyMethod: + Enabled: true + +Style/EndBlock: + Enabled: true + +Style/EvenOdd: + Enabled: true + +Style/FrozenStringLiteralComment: + Enabled: true + +Style/For: + Enabled: true + +Style/FormatString: + Enabled: true + +Style/GlobalVars: + Enabled: true + +Style/GuardClause: + Enabled: true + +Style/HashSyntax: + Enabled: true + +Style/IfInsideElse: + Enabled: true + +Style/IfUnlessModifier: + Enabled: true + +Style/IfUnlessModifierOfIfUnless: + Enabled: true + +Style/IfWithSemicolon: + Enabled: true + +Style/IdenticalConditionalBranches: + Enabled: true + +Style/InfiniteLoop: + Enabled: true + +Style/Lambda: + Enabled: true + +Style/LambdaCall: + Enabled: true + +Style/LineEndConcatenation: + Enabled: true + +Style/MethodCallWithoutArgsParentheses: + Enabled: true + +Style/MethodDefParentheses: + Enabled: true + +Style/MissingRespondToMissing: + Enabled: true + +Style/ModuleFunction: + Enabled: true + +Style/MultilineBlockChain: + Enabled: true + +Style/MultilineIfThen: + Enabled: true + +Style/MultilineIfModifier: + Enabled: true + +Style/MultilineMemoization: + Enabled: true + +Style/MultilineTernaryOperator: + Enabled: true + +Style/MutableConstant: + Enabled: true + +Style/NegatedIf: + Enabled: true + +Style/NegatedWhile: + Enabled: true + +Style/NestedModifier: + Enabled: true + +Style/NestedParenthesizedCalls: + Enabled: true + +Style/NestedTernaryOperator: + Enabled: true + +Style/Next: + Enabled: true + +Style/NilComparison: + Enabled: true + +Style/NonNilCheck: + Enabled: true + +Style/Not: + Enabled: true + +Style/NumericLiterals: + Enabled: true + +Style/NumericLiteralPrefix: + Enabled: true + +Style/NumericPredicate: + # This will change to a new method call which isn't guaranteed to be on the + # object. Switching these methods has to be done with knowledge of the types + # of the variables which rubocop doesn't have. + AutoCorrect: false + Enabled: true + +Style/OneLineConditional: + Enabled: true + +Style/OptionalArguments: + Enabled: true + +Style/ParallelAssignment: + Enabled: true + +Style/ParenthesesAroundCondition: + Enabled: true + +Style/PercentLiteralDelimiters: + Enabled: true + +Style/PercentQLiterals: + Enabled: true + +Style/PerlBackrefs: + Enabled: true + +Style/PreferredHashMethods: + Enabled: true + +Style/Proc: + Enabled: true + +Style/RaiseArgs: + Enabled: true + +Style/RedundantBegin: + Enabled: true + +Style/RedundantException: + Enabled: true + +Style/RedundantFreeze: + Enabled: true + +Style/RedundantParentheses: + Enabled: true + +Style/RedundantReturn: + Enabled: true + +Style/RedundantSelf: + Enabled: true + +Style/RedundantSortBy: + Enabled: true + +Style/RescueModifier: + Enabled: true + +Style/Sample: + Enabled: true + +Style/SafeNavigation: + Enabled: true + +Style/SelfAssignment: + Enabled: true + +Style/Semicolon: + Enabled: true + +Style/SignalException: + Enabled: true + +Style/SingleLineMethods: + Enabled: true + + +Style/SpecialGlobalVars: + Enabled: true + +Style/StabbyLambdaParentheses: + Enabled: true + +Style/StringLiteralsInInterpolation: + Enabled: true + +Style/StructInheritance: + Enabled: true + +Style/SymbolLiteral: + Enabled: true + +Style/SymbolProc: + Enabled: true + +Style/TernaryParentheses: + Enabled: true + +Style/TrailingCommaInArguments: + Enabled: true + +Style/TrailingCommaInArrayLiteral: + Enabled: true + +Style/TrailingCommaInHashLiteral: + Enabled: true + +Style/TrivialAccessors: + Enabled: true + +Style/UnlessElse: + Enabled: true + +Style/RedundantCapitalW: + Enabled: true + +Style/RedundantInterpolation: + Enabled: true + +Style/RedundantPercentQ: + Enabled: true + +Style/TrailingUnderscoreVariable: + AllowNamedUnderscoreVariables: true + Enabled: true + +Style/VariableInterpolation: + Enabled: true + +Style/WhenThen: + Enabled: true + +Style/WhileUntilDo: + Enabled: true + +Style/WhileUntilModifier: + Enabled: true + +Style/ZeroLengthPredicate: + Enabled: true + +#################### Layout ############################### + +Layout/ArrayAlignment: + Enabled: true + +Layout/HashAlignment: + Enabled: true + +Layout/ParameterAlignment: + Enabled: true + +Layout/BlockAlignment: + Enabled: true + +Layout/BlockEndNewline: + Enabled: true + +Layout/CaseIndentation: + Enabled: true + +Layout/ClosingParenthesisIndentation: + Enabled: true + +Layout/ConditionPosition: + Enabled: true + +Layout/CommentIndentation: + Enabled: true + +Layout/DefEndAlignment: + Enabled: true + +Layout/DotPosition: + Enabled: true + +Layout/ElseAlignment: + Enabled: true + +Layout/EndAlignment: + Enabled: true + +Layout/EmptyLineBetweenDefs: + Enabled: true + +Layout/EmptyLines: + Enabled: true + +Layout/EmptyLinesAroundAccessModifier: + Enabled: true + +Layout/EmptyLinesAroundBlockBody: + Enabled: true + +Layout/EmptyLinesAroundClassBody: + Enabled: true + +Layout/EmptyLinesAroundModuleBody: + Enabled: true + +Layout/EmptyLinesAroundMethodBody: + Enabled: true + +Layout/EndOfLine: + Enabled: true + +Layout/ExtraSpacing: + Enabled: true + +Layout/IndentationStyle: + Enabled: true + +Layout/InitialIndentation: + Enabled: true + +Layout/FirstParameterIndentation: + Enabled: true + +Layout/IndentationConsistency: + Enabled: true + EnforcedStyle: normal + +Layout/IndentationWidth: + Enabled: true + +Layout/FirstArrayElementIndentation: + Enabled: true + +Layout/AssignmentIndentation: + Enabled: true + +Layout/FirstHashElementIndentation: + Enabled: true + +Layout/SpaceInLambdaLiteral: + Enabled: true + +Layout/LeadingCommentSpace: + Enabled: true + +Layout/LineLength: + Enabled: true + Max: 200 + Exclude: + - '**/*.gemspec' + +Layout/MultilineArrayBraceLayout: + Enabled: true + +Layout/MultilineBlockLayout: + Enabled: true + +Layout/MultilineHashBraceLayout: + Enabled: true + +Layout/MultilineMethodCallBraceLayout: + Enabled: true + +Layout/MultilineMethodCallIndentation: + Enabled: true + +Layout/MultilineMethodDefinitionBraceLayout: + Enabled: true + +Layout/MultilineOperationIndentation: + Enabled: true + +Layout/RescueEnsureAlignment: + Enabled: true + +Layout/SpaceBeforeFirstArg: + Enabled: true + +Layout/SpaceAfterColon: + Enabled: true + +Layout/SpaceAfterComma: + Enabled: true + +Layout/SpaceAfterMethodName: + Enabled: true + +Layout/SpaceAfterNot: + Enabled: true + +Layout/SpaceAfterSemicolon: + Enabled: true + +Layout/SpaceBeforeBlockBraces: + Enabled: true + +Layout/SpaceBeforeComma: + Enabled: true + +Layout/SpaceBeforeComment: + Enabled: true + +Layout/SpaceBeforeSemicolon: + Enabled: true + +Layout/SpaceInsideBlockBraces: + Enabled: true + +Layout/SpaceAroundBlockParameters: + Enabled: true + +Layout/SpaceAroundEqualsInParameterDefault: + Enabled: true + +Layout/SpaceAroundKeyword: + Enabled: true + +Layout/SpaceAroundOperators: + Enabled: true + +Layout/SpaceInsideArrayPercentLiteral: + Enabled: true + +Layout/SpaceInsidePercentLiteralDelimiters: + Enabled: true + +Layout/SpaceInsideReferenceBrackets: + Enabled: true + +Layout/SpaceInsideArrayLiteralBrackets: + Enabled: true + +Layout/SpaceInsideHashLiteralBraces: + Enabled: true + +Layout/SpaceInsideParens: + Enabled: true + +Layout/SpaceInsideRangeLiteral: + Enabled: true + +Layout/SpaceInsideStringInterpolation: + Enabled: true + +Layout/TrailingEmptyLines: + Enabled: true + +Layout/TrailingWhitespace: + Enabled: true + +#################### Naming ################################ + +Naming/AccessorMethodName: + Enabled: true + +Naming/AsciiIdentifiers: + Enabled: true + +Naming/BinaryOperatorParameterName: + Enabled: true + +Naming/ClassAndModuleCamelCase: + Enabled: true + +Naming/ConstantName: + Enabled: true + +Naming/FileName: + Enabled: true + Exclude: + - '**/Gemfile' + - '**/*.rake' + - 'Capfile' + - 'config/deploy/*' + +Naming/MethodName: + Enabled: true + +Naming/PredicateName: + Enabled: true + +Naming/VariableName: + Enabled: true + +Naming/VariableNumber: + Enabled: true + CheckSymbols: false + +#################### Metrics ############################### + +Metrics/AbcSize: + Enabled: true + Max: 32 + +Metrics/BlockNesting: + Enabled: true + +Metrics/ClassLength: + Enabled: true + Exclude: + - '**/*/catalog_controller.rb' + +Metrics/ModuleLength: + Enabled: true + +Metrics/CyclomaticComplexity: + Enabled: true + Max: 10 + +Metrics/MethodLength: + Enabled: true + Max: 14 + +Metrics/BlockLength: + Enabled: true + Exclude: + - '**/*.gemspec' + - 'config/**/*' + - '**/*/catalog_controller.rb' + +Metrics/ParameterLists: + Enabled: true + +Metrics/PerceivedComplexity: + Enabled: true + Max: 11 + +#################### Lint ################################## +### Warnings + +Lint/AmbiguousOperator: + Enabled: true + +Lint/AmbiguousRegexpLiteral: + Enabled: true + +Lint/AssignmentInCondition: + Enabled: true + +Lint/CircularArgumentReference: + Enabled: true + +Lint/Debugger: + Enabled: true + +Lint/DeprecatedClassMethods: + Enabled: true + +Lint/DuplicateCaseCondition: + Enabled: true + +Lint/DuplicateMethods: + Enabled: true + +Lint/DuplicateHashKey: + Enabled: true + +Lint/EachWithObjectArgument: + Enabled: true + +Lint/ElseLayout: + Enabled: true + +Lint/EmptyEnsure: + Enabled: true + AutoCorrect: false + +Lint/EmptyExpression: + Enabled: true + +Lint/EmptyInterpolation: + Enabled: true + +Lint/EmptyWhen: + Enabled: true + +Lint/EnsureReturn: + Enabled: true + +Lint/FlipFlop: + Enabled: true + +Lint/FloatOutOfRange: + Enabled: true + +Lint/FormatParameterMismatch: + Enabled: true + +Lint/SuppressedException: + Enabled: true + +Lint/ImplicitStringConcatenation: + Enabled: true + +Lint/IneffectiveAccessModifier: + Enabled: true + +Lint/InheritException: + Enabled: true + +Lint/LiteralAsCondition: + Enabled: true + +Lint/LiteralInInterpolation: + Enabled: true + +Lint/Loop: + Enabled: true + +Lint/MissingSuper: + Enabled: true + +Lint/MultipleComparison: + Enabled: true + +Lint/NestedMethodDefinition: + Enabled: true + +Lint/NextWithoutAccumulator: + Enabled: true + +Lint/NonLocalExitFromIterator: + Enabled: true + +Lint/ParenthesesAsGroupedExpression: + + Enabled: true + +Lint/PercentStringArray: + Enabled: true + +Lint/PercentSymbolArray: + Enabled: true + +Lint/RandOne: + Enabled: true + +Lint/RequireParentheses: + Enabled: true + +Lint/RescueException: + Enabled: true + +Lint/SafeNavigationChain: + Enabled: true + +Lint/ShadowedException: + Enabled: true + +Lint/ShadowingOuterLocalVariable: + Enabled: true + +Lint/RedundantStringCoercion: + Enabled: true + +Lint/UnderscorePrefixedVariableName: + Enabled: true + +Lint/UnifiedInteger: + Enabled: true + +Lint/RedundantSplatExpansion: + Enabled: true + +Lint/UnusedBlockArgument: + Enabled: true + +Lint/UnusedMethodArgument: + Enabled: true + +Lint/UnreachableCode: + Enabled: true + +Lint/UselessAccessModifier: + Enabled: true + ContextCreatingMethods: [] + MethodCreatingMethods: [] + +Lint/UselessAssignment: + Enabled: true + +Lint/BinaryOperatorWithIdenticalOperands: + Enabled: true + +Lint/UselessSetterCall: + Enabled: true + +Lint/Void: + Enabled: true + +#################### Performance ########################### + +Performance/Casecmp: + Enabled: true + +Performance/CaseWhenSplat: + Enabled: true + +Performance/Count: + # This cop has known compatibility issues with `ActiveRecord` and other + # frameworks. ActiveRecord's `count` ignores the block that is passed to it. + # For more information, see the documentation in the cop itself. + # If you understand the known risk, you can disable `SafeAutoCorrect`. + SafeAutoCorrect: true + Enabled: true + +Performance/Detect: + # This cop has known compatibility issues with `ActiveRecord` and other + # frameworks. `ActiveRecord` does not implement a `detect` method and `find` + # has its own meaning. Correcting `ActiveRecord` methods with this cop + # should be considered unsafe. + SafeAutoCorrect: true + Enabled: true + +Performance/DoubleStartEndWith: + Enabled: true + +Performance/EndWith: + # This will change to a new method call which isn't guaranteed to be on the + # object. Switching these methods has to be done with knowledge of the types + # of the variables which rubocop doesn't have. + AutoCorrect: false + Enabled: true + +Performance/FixedSize: + Enabled: true + +Performance/FlatMap: + Enabled: true + EnabledForFlattenWithoutParams: false + # If enabled, this cop will warn about usages of + # `flatten` being called without any parameters. + # This can be dangerous since `flat_map` will only flatten 1 level, and + # `flatten` without any parameters can flatten multiple levels. + +Performance/RangeInclude: + Enabled: true + +Performance/RedundantBlockCall: + Enabled: true + +Performance/RedundantMatch: + Enabled: true + +Performance/RedundantMerge: + Enabled: true + +Performance/RegexpMatch: + Enabled: true + +Performance/ReverseEach: + Enabled: true + +Performance/Size: + Enabled: true + +Performance/CompareWithBlock: + Enabled: true + +Performance/StartWith: + # This will change to a new method call which isn't guaranteed to be on the + # object. Switching these methods has to be done with knowledge of the types + # of the variables which rubocop doesn't have. + AutoCorrect: false + Enabled: true + +Performance/StringReplacement: + Enabled: true + +Performance/TimesMap: + Enabled: true + +#################### Security ############################## + +Security/Eval: + Enabled: true + +Security/JSONLoad: + Enabled: true + # Autocorrect here will change to a method that may cause crashes depending + # on the value of the argument. + AutoCorrect: false + +Security/MarshalLoad: + Enabled: true + +Security/YAMLLoad: + Enabled: true + +#################### Bundler ############################### + +Bundler/DuplicatedGem: + Enabled: true + Include: + - '**/Gemfile' + - '**/gems.rb' + +Bundler/OrderedGems: + Enabled: true + Include: + - '**/Gemfile' + - '**/gems.rb' diff --git a/bixby/bixby_rails_enabled.yml b/bixby/bixby_rails_enabled.yml new file mode 100644 index 0000000..c328309 --- /dev/null +++ b/bixby/bixby_rails_enabled.yml @@ -0,0 +1,96 @@ +--- +require: rubocop-rails + +Rails: + Enabled: true + +Rails/ActionFilter: + Enabled: true + +Rails/Date: + Enabled: true + +Rails/Delegate: + Enabled: true + +Rails/DelegateAllowBlank: + Enabled: true + +# This one breaks things unexpectedly. +# E.g., it changes ISO_639.find_by_code(language_code) to ISO_639.find_by(code: language_code) +# which results in an error. +Rails/DynamicFindBy: + Enabled: false + +Rails/EnumUniqueness: + Enabled: true + +Rails/Exit: + Enabled: true + +Rails/FilePath: + Enabled: true + EnforcedStyle: arguments + +Rails/FindBy: + Enabled: true + +Rails/FindEach: + Enabled: true + +Rails/HasAndBelongsToMany: + Enabled: true + +Rails/HelperInstanceVariable: + Enabled: false + +Rails/HttpPositionalArguments: + Enabled: true + Include: + - 'spec/**/*' + - 'test/**/*' + +Rails/InverseOf: + Enabled: false + +Rails/LexicallyScopedActionFilter: + Enabled: false + +Rails/NotNullColumn: + Enabled: true + +Rails/Output: + Enabled: true + +Rails/OutputSafety: + Enabled: true + +Rails/PluralizationGrammar: + Enabled: true + +Rails/ReadWriteAttribute: + Enabled: true + +Rails/RequestReferer: + Enabled: true + +Rails/ReversibleMigration: + Enabled: true + +Rails/SafeNavigation: + Enabled: true + +Rails/ScopeArgs: + Enabled: true + +Rails/TimeZone: + Enabled: true + +Rails/UniqBeforePluck: + Enabled: true + +Rails/SkipsModelValidations: + Enabled: true + +Rails/Validation: + Enabled: true diff --git a/bixby/bixby_rspec_enabled.yml b/bixby/bixby_rspec_enabled.yml new file mode 100644 index 0000000..e82d851 --- /dev/null +++ b/bixby/bixby_rspec_enabled.yml @@ -0,0 +1,125 @@ +--- +require: rubocop-rspec + +RSpec: + Include: + - _spec.rb + - "(?:^|/)spec/" + +RSpec/AnyInstance: + Enabled: true + +RSpec/BeEql: + Enabled: true + +RSpec/DescribeClass: + Enabled: true + +RSpec/DescribedClass: + SkipBlocks: false + Enabled: true + +RSpec/DescribeMethod: + Enabled: true + +RSpec/EmptyExampleGroup: + Enabled: true + +RSpec/ExampleLength: + Enabled: true + Max: 5 + +RSpec/ExampleWording: + Enabled: true + CustomTransform: + be: is + have: has + not: does not + IgnoredWords: [] + +RSpec/ExpectActual: + Enabled: true + +RSpec/ExpectOutput: + Enabled: true + +RSpec/Focus: + Enabled: true + +RSpec/HookArgument: + Enabled: true + EnforcedStyle: implicit + SupportedStyles: + - implicit + - each + - example + +RSpec/ImplicitExpect: + Enabled: true + EnforcedStyle: is_expected + SupportedStyles: + - is_expected + - should + +RSpec/InstanceVariable: + AssignmentOnly: false + Enabled: true + +RSpec/LeadingSubject: + Enabled: true + +RSpec/LetSetup: + Enabled: true + +RSpec/MessageChain: + Enabled: true + +RSpec/MessageExpectation: + Enabled: false + EnforcedStyle: allow + SupportedStyles: + - allow + - expect + +RSpec/MessageSpies: + Enabled: true + EnforcedStyle: have_received + SupportedStyles: + - have_received + - receive + +RSpec/MultipleDescribes: + Enabled: true + +RSpec/NamedSubject: + Enabled: true + +RSpec/NestedGroups: + Enabled: true + Max: 5 + +RSpec/NotToNot: + EnforcedStyle: not_to + SupportedStyles: + - not_to + - to_not + Enabled: true + +RSpec/RepeatedDescription: + Enabled: true + +RSpec/RepeatedExample: + Enabled: true + +RSpec/SingleArgumentMessageChain: + Enabled: true + +RSpec/ScatteredSetup: + Enabled: true + +RSpec/SubjectStub: + Enabled: true + +RSpec/VerifiedDoubles: + Enabled: true + IgnoreSymbolicNames: false diff --git a/bixby/logo/murphy.jpg b/bixby/logo/murphy.jpg new file mode 100644 index 0000000..813d333 Binary files /dev/null and b/bixby/logo/murphy.jpg differ