https://github.com/nxt-insurance/nxt_cop
Shared, minimal rubocop config
https://github.com/nxt-insurance/nxt_cop
linter rubocop ruby
Last synced: 6 months ago
JSON representation
Shared, minimal rubocop config
- Host: GitHub
- URL: https://github.com/nxt-insurance/nxt_cop
- Owner: nxt-insurance
- License: mit
- Created: 2020-07-15T11:55:41.000Z (almost 5 years ago)
- Default Branch: main
- Last Pushed: 2024-11-06T07:17:09.000Z (7 months ago)
- Last Synced: 2024-12-01T04:40:09.449Z (6 months ago)
- Topics: linter, rubocop, ruby
- Language: Ruby
- Homepage:
- Size: 120 KB
- Stars: 4
- Watchers: 18
- Forks: 0
- Open Issues: 6
-
Metadata Files:
- Readme: README.md
- Changelog: CHANGELOG.md
- License: LICENSE
Awesome Lists containing this project
README
# nxt_cop
Getsafe shared Rubocop Config.
## Installation
Add this line to your application's Gemfile:
```ruby
group :test, :development do
gem 'nxt_cop'
end
```Or, for a Ruby library, add this to your gemspec:
```ruby
spec.add_development_dependency 'nxt_cop'
```And then run:
```bash
$ bundle install
```## Usage
Create a `.rubocop.yml` with the following directives:
```yaml
inherit_gem:
nxt_cop:
- default.yml
```Now, run:
```bash
$ bundle exec rubocop
```You do not need to include rubocop directly in your application's dependencies. nxt_cop will include a specific version of `rubocop` that is shared across all projects.
It is also possible to override styles or add styles to your application.
**NOTE:** Don't configure `AllCops` as it will override many of the rules in this gem.
```
inherit_gem:
nxt_cop:
- default.ymlLint/Style:
Exclude:
- db/schema.rb
- db/migrate/*.rb
```## Development
After checking out the repo, run `bin/setup` to install dependencies. Then, run `rake spec` to run the tests. You can also run `bin/console` for an interactive prompt that will allow you to experiment.
To install this gem onto your local machine, run `bundle exec rake install`.
## Release a new version
### Setup credentials
```shell
bundle config set gem.push_key rubygems
```Add to `~/.gem/credentials` (create if it doesn't exist):
```shell
:rubygems:
```### Release process
- Merge all Depfu updates
- Run `bundle install` to update dependencies
- Run `rubocop` to see if new rules were added
- If yes, add them to `default.yml` to prevent "New rules" warning
- Update the version number in `version.rb`
- Run `bundle install` again to update the version in Gemfile.lock
- Update the `CHANGELOG.md`
- Open the PR, merge everything to `main`Once PR is merged, switch to main and run `bundle exec rake release` which will create a git tag for the version, push git commits and tags, and push the `.gem` file to [rubygems.org](https://rubygems.org).
## Contributing
Bug reports and pull requests are welcome on GitHub at https://github.com/nxt-insurance/nxt_cop.
## License
The gem is available as open source under the terms of the [MIT License](https://opensource.org/licenses/MIT).