From 54dee45cd3c214eb9456070976ef0dd69019c37b Mon Sep 17 00:00:00 2001 From: Zach Ahn Date: Sun, 11 Aug 2024 22:01:05 -0400 Subject: [PATCH] Update README --- README.md | 45 ++++++++++++++++++++++++++++++++++++++++++--- 1 file changed, 42 insertions(+), 3 deletions(-) diff --git a/README.md b/README.md index c48e7a9..a251114 100644 --- a/README.md +++ b/README.md @@ -4,6 +4,16 @@ This set of rules serves to remove Sorbet from a codebase. I like Sorbet a lot! But sometimes, I need to remove it from a codebase. +I use it to remove Sorbet type definitions in the gems I ship. + +## Note!!! + +* This gem does not cover all use-cases. +* This gem hasn't been tested very thoroughly. +* This gem produces ugly code. I recommend running your regular linter after. +* Please use version control! Please remember to commit your changes! +* Please run your tests to make sure your code is still okay! + ## Installation Install the gem and add to the application's Gemfile by executing: @@ -12,17 +22,46 @@ Install the gem and add to the application's Gemfile by executing: ## Usage -Put this into your `.rubocop.yml`. +I strongly recommend that you use version control and commit all your changes +before using this gem. This gem edits your code, and honestly it isn't tested +too well. + +Here's an example of how to run this and automatically remove all instances of +Sorbet: + +```bash +bundle exec rubocop \ + --require rubocop-no_sorbet --only NoSorbet --autocorrect \ + app lib exe *.gemspec +``` + +Optionally, you can create a configuration file: ```yaml +# Name this file `.rubocop_no_sorbet.yml` +--- require: - rubocop-no_sorbet + +AllCops: + DisabledByDefault: true + Exclude: + - bin/**/* + - test/**/* + Include: + - app/**/*.rb + - exe/**/* + - lib/**/*.rb + - '*.gemspec' + +NoSorbet: + Enabled: Yes ``` -You can also specify this at runtime. +You can then run the slightly shorter: ```bash -rubocop --require rubocop-no_sorbet +bundle exec rubocop --config .rubocop_no_sorbet.yml --autocorrect ``` ## Development