Giter Club home page Giter Club logo

bixby's Introduction

Bixby: I'd buy that for a dollar!

Code: Gem Version Build Status

Docs: Contribution Guidelines Apache 2.0 License

Community Support: Samvera Community Slack

Murphy Sketch

What is Bixby?

Bixby is a Ruby Gem containing the default configuration settings for RuboCop used to enforce common Ruby style guidelines across Samvera community projects.

Product Owner & Maintenance

bixby was a Core Component of the Samvera Community. Given a decline in available labor required for maintenance, this project no longer has a dedicated Product Owner. The documentation for what this means can be found here.

Product Owner

Vacant

Until a Product Owner has been identified, we ask that you please direct all requests for support, bug reports, and general questions to the #dev Channel on the Samvera Slack.

Help

The Samvera Community is here to help. Please see our support guide.

See the Samvera Confluence for information at the architecture level: https://samvera.atlassian.net/wiki/home

Additionally, new adopters and potential adopters may find the pages here useful: https://samvera.org/

Further questions? Get in touch

To Use This

In your Gemfile:

gem 'bixby'

In your .rubocop.yml:

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.

Releasing

  1. bundle install
  2. Increase the version number in bixby.gemspec
  3. Increase the same version number in .github_changelog_generator
  4. 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
  2. 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 and language recommendations. 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, 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.

Samvera Logo

bixby's People

Contributors

bess avatar bwatson78 avatar cjcolvar avatar dlpierce avatar fnibbit avatar hackartisan avatar jeremyf avatar jrgriffiniii avatar kelynch avatar mark-dce avatar rotated8 avatar

Stargazers

 avatar  avatar  avatar  avatar

Watchers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

bixby's Issues

Bixby not compatible with latest Rubocop

/home/ubuntu/valkyrie/valkyrie/.rubocop.yml: Style/PredicateName has the wrong namespace - should be Naming
/home/ubuntu/valkyrie/valkyrie/vendor/valk_bundle/ruby/2.3.0/gems/bixby-0.2.2/bixby_default.yml: Style/AccessorMethodName has the wrong namespace - should be Naming
/home/ubuntu/valkyrie/valkyrie/vendor/valk_bundle/ruby/2.3.0/gems/bixby-0.2.2/bixby_default.yml: Style/AsciiIdentifiers has the wrong namespace - should be Naming
/home/ubuntu/valkyrie/valkyrie/vendor/valk_bundle/ruby/2.3.0/gems/bixby-0.2.2/bixby_default.yml: Style/ClassAndModuleCamelCase has the wrong namespace - should be Naming
/home/ubuntu/valkyrie/valkyrie/vendor/valk_bundle/ruby/2.3.0/gems/bixby-0.2.2/bixby_default.yml: Style/ConstantName has the wrong namespace - should be Naming
/home/ubuntu/valkyrie/valkyrie/vendor/valk_bundle/ruby/2.3.0/gems/bixby-0.2.2/bixby_default.yml: Style/FileName has the wrong namespace - should be Naming
/home/ubuntu/valkyrie/valkyrie/vendor/valk_bundle/ruby/2.3.0/gems/bixby-0.2.2/bixby_default.yml: Style/MethodName has the wrong namespace - should be Naming
/home/ubuntu/valkyrie/valkyrie/vendor/valk_bundle/ruby/2.3.0/gems/bixby-0.2.2/bixby_default.yml: Style/PredicateName has the wrong namespace - should be Naming
/home/ubuntu/valkyrie/valkyrie/vendor/valk_bundle/ruby/2.3.0/gems/bixby-0.2.2/bixby_default.yml: Style/VariableName has the wrong namespace - should be Naming
/home/ubuntu/valkyrie/valkyrie/vendor/valk_bundle/ruby/2.3.0/gems/bixby-0.2.2/bixby_default.yml: Style/VariableNumber has the wrong namespace - should be Naming
Error: The `Style/OpMethods` cop has been renamed and moved to `Naming/BinaryOperatorParameter`.
(obsolete configuration found in /home/ubuntu/valkyrie/valkyrie/vendor/valk_bundle/ruby/2.3.0/gems/bixby-0.2.2/bixby_default.yml, please update it)

Should we be defining rubocop versions?

Removal of Rubocop Cop that is stopping the build process.

Descriptive summary

For Bixby v4.0.0, the error below occurs when attempting to build an application (in this case, Hyrax bl7bootstrap4 branch) that runs off of Ruby 2.7.4.

Error: unrecognized cop or department Lint/UselessElseWithoutRescue found in vendor/bundle/ruby/2.7.0/gems/bixby-4.0.0/bixby_default.yml
Did you mean `Lint/UselessSetterCall`?

After researching, I found that the latest version of Rubocop (a Bixby dependency) has removed this Cop because Ruby v2.6+ has stopped allowing the use of begin...else syntax. Reference: rubocop/rubocop#10577

Rationale

The presence of Lint/UselessElseWithoutRescue in the bixby_default.yml file is preventing the application building process.

RENAME: Update references of hard-coded legacy master branch name to main branch name

Descriptive summary

This repository’s default branch has already been renamed using GitHub’s renaming tool. Links that reference the old branch name are automatically forwarded to the new default branch. But string references are not automatically updated.

Check this repository for hard-coded string references to the legacy “master” default branch and update them to the new default branch name “main.”

Important places to check include, but are not limited to:

  • READMEs
  • wikis
  • other documentation

NOTE: READMEs, wikis, and other documentation are important to update to avoid confusion and correct errors in long lasting documentation.

Less common places to check:

  • code
  • Issues/PRs

NOTE: String references to themaster branch in Issues, PRs, and code are uncommon. Also Issues and PRs are temporal in nature, making it less critical to update those occurrences.

Rationale

Git's default "master" branch derives from "master/slave" jargon which perpetuates systemic racist language and systems (see email Replacing "master" reference in git branch names). To uphold our Code of Conduct, we must move away from the term "master" in our technical language (as well as words like blacklist or whitelist).

Related work

Upgrade for new rubocop

The Bixby config is not compatible with newer rubocop:

Error: The `Style/TrailingCommaInLiteral` cop no longer exists. Please use `Style/TrailingCommaInArrayLiteral` and/or `Style/TrailingCommaInHashLiteral` instead.
(obsolete configuration found in /Users/jcoyne/.rbenv/versions/2.5.1/lib/ruby/gems/2.5.0/gems/bixby-1.0.0/bixby_default.yml, please update it)
The `Performance/HashEachMethods` cop has been removed since it no longer provides performance benefits in modern rubies.
(obsolete configuration found in /Users/jcoyne/.rbenv/versions/2.5.1/lib/ruby/gems/2.5.0/gems/bixby-1.0.0/bixby_default.yml, please update it)
The `Style/MethodMissing` cop has been split into `Style/MethodMissingSuper` and `Style/MissingRespondToMissing`.
(obsolete configuration found in /Users/jcoyne/.rbenv/versions/2.5.1/lib/ruby/gems/2.5.0/gems/bixby-1.0.0/bixby_default.yml, please update it)

Explore ramifications of rubocop versioning policy

https://docs.rubocop.org/rubocop/0.85/versioning.html#pending-cops explains how rubocop has adopted a better approach to newly added cops instead of the new cops on by default that was part of if not the main driver for creating bixby. Is there still enough value in a shared style configuration to justify maintaining bixby? If so, how should bixby make use of this new policy? Should the NewCops cop be disabled? How often should new cops be integrated and major releases cut?

Add tmp dir to AllCops exclusion

In a Rails project, I sometimes move ruby source files to my tmp dir to stash them for later. When I run rubocop, I get false failures coming from the tmp dir.

Can we add an exclusion to the AllCops so that rubocop will ignore anything under tmp?

RENAME: Add language to README about branch naming

Add the following branch renaming language to the README for this repository.

## 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/master/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.

Rationale

Git's default "master" branch derives from "master/slave" jargon which perpetuates systemic racist language and systems (see email Replacing "master" reference in git branch names). To uphold our Code of Conduct, we must move away from the term "master" in our technical language (as well as words like blacklist or whitelist).

Related work

Update rubocop-rspec

FactoryGirl gives deprecation warnings telling us to use FactoryBot/AttributeDefinedStatically cop to fix the deprecations:

https://travis-ci.org/samvera/hyrax/jobs/417432846#L3205

DEPRECATION WARNING: Static attributes will be removed in FactoryBot 5.0. Please use dynamic
attributes instead by wrapping the attribute value in a block:
with_permission_template { false }
To automatically update from static attributes to dynamic ones,
install rubocop-rspec and run:
rubocop \
  --require rubocop-rspec \
  --only FactoryBot/AttributeDefinedStatically \
  --auto-correct

However, this cop doesn't exist in rubocop-rspec 1.22.2. The latest version is 1.29.0

Reduction in line character limit

I have been working within the Hyku codespace for a little while and have been struggling with the higher character limit that you permit for each line of code - I believe this is currently set to 200 characters per line.

As someone who struggles periodically due to mild dyslexia, incredibly long lines of code are far harder to comprehend in their entirety than those which have been broken up for brevity.

I will provide an example below and please note I mean no disrespect to the owner of this code, it is only used because of its length of 184 characters - 16 character below your upper limit:

if Hyrax::PresenterFactory.build_for(ids: [collection.thumbnail_id], presenter_class: Hyrax::FileSetPresenter, presenter_args: [current_ability, request]).first&.solr_document&.public?

If this were broken up so that the options for the build_for method were on a seperate line, the entire condition can be much more easily comprehended:

options = { 
    ids: [collection.thumbnail_id], 
    presenter_class: Hyrax::FileSetPresenter, 
    presenter_args: [current_ability, request] 
} 
if Hyrax::PresenterFactory.build_for(options).first&.solr_document&.public?

Thank you.

Rename master branch to main

The Renaming Branch Working Group is in the process of renaming the default branch from master to main in Samvera and Samvera-Labs repos. This brings repositories into compliance with 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/master/templates/CONTRIBUTING.md#language).

This issue will be complete when the master has been renamed to main.

Related issues will have a title beginning with RENAME.

Should we allow long blocks in CatalogController?

Starting a new Hyrax project on bixby, I found I needed to introduce only two exceptions to the style guide here to get to green CI (after rubocop:auto_correct). Both are related to the length of CatalogController` and its internal blocks.

The proposed rule would be something like:

Metrics/BlockLength:
  Exclude:
    - 'config/**/*'
    - '**/*/catalog_controller.rb'

Metrics/ClassLength:
  Exclude:
    - '**/*/catalog_controller.rb'

See: curationexperts/epigaea@d76c5f1#diff-11a0d7906801d9dea0eccb85667ad811R4

RENAME: Add Circle CI step that fails if branch name is master

Descriptive summary

This repository’s default branch has already been renamed to main using GitHub’s renaming tool. In order to preserve automatic redirection of links that reference the old branch name master to the new default main branch, a branch with the old name should not be recreated.

CircleCI can be used to prevent the recreation of the old default branch name by preventing PRs with a branch named master from being merged by causing a test failure during continuous integration.

Rationale

Git's default "master" branch derives from "master/slave" jargon which perpetuates systemic racist language and systems (see email Replacing "master" reference in git branch names). To uphold our Code of Conduct, we must move away from the term "master" in our technical language (as well as words like blacklist or whitelist).

Expected behavior

If a PR is submitted with a branch named master, the continuous integration tests should fail.

Actual behavior

If a PR is submitted with a branch named master, the continuous integration tests will not fail because of the branch name.

Related work

Background on the renaming effort is available in the working group notes.

Figure out how to work with inherit_from remote

When setting up codeclimate, I've had to configure codeclimate to fetch the bixby configs and then reference them locally since bixby_default.yml locally inherits from the other two configs. It would be nice to skip the fetching and use inherit_from with the uri to the bixby configs hosted on github. Documentation supporting this use case would be nice.

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.