Skip to content

panorama-ed/panolint-rails

Repository files navigation

panolint-rails

Build Status

A small gem containing rules for linting Ruby on Rails code at Panorama Education.

This gem inherits RuboCop configuration from panolint-ruby.

Installation

Add these lines to your application's Gemfile:

gem "panolint-ruby", git: "https://github.com/panorama-ed/panolint-ruby.git", branch: "main"
gem "panolint-rails", git: "https://github.com/panorama-ed/panolint-rails.git", branch: "main"

It is necessary to have panolint-ruby in your application's Gemfile. This is necessary despite panolint-rails's Rubocop configuration inheriting from panolint-ruby because we want to point to the up-to-date GitHub repository rather than the initial version on RubyGems. panolint-rails cannot simply have panolint-ruby as a dependency in its gemspec because the gemspec can only point to RubyGems but not GitHub repositories as we would desire it to.

And then execute:

$ bundle

Do not install this gem from RubyGems, as updates are only pushed to this repo. We have only pushed an initial version to RubyGems to avoid supply chain attacks from malicious squatters.

Usage

Brakeman

You can use panolint-rails's brakeman configuration in your project by pointing the brakeman run at the configuration file in this repo:

$ bundle exec brakeman -c "$(bundle show brakeman)/brakeman.yml"

RuboCop

You can use panolint-rails's RuboCop configuration in your project with the following addition to the top of your project's .rubocop.yml:

inherit_gem:
  panolint-rails: panolint-rails-rubocop.yml

This gem uses a gem-specific named file instead of the traditional .rubocop.yml due to a previous issue with RuboCop extensions in VS Code reading the wrong repository's .rubocop.yml file.

Contributing

While this gem is intended for internal use by Panorama Education engineers, bug reports and pull requests are welcome on GitHub at https://github.com/panorama-ed/panolint-rails. This project is intended to be a safe, welcoming space for collaboration, and contributors are expected to adhere to the Contributor Covenant code of conduct.

License

The gem is available as open source under the terms of the MIT License.

Code of Conduct

Everyone interacting in the panolint-rails's project’s codebases, issue trackers, chat rooms and mailing lists is expected to follow the code of conduct.

About

Rules for linting Rails code at Panorama Education

Resources

License

Code of conduct

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published

Languages