# What about Rubocop rules?

**URL:** <https://www.ruby-forum.com/t/what-about-rubocop-rules/259444>\
**Category:** Development\
**Created:** [May 3, 2020, 1:54am UTC](https://www.ruby-forum.com/t/what-about-rubocop-rules/259444 "2020-05-03T01:54:34Z")\
**Posts on this page:** 5\
**Page:** 1

<div class="post-metadata">

**Author:** ![PaulGureghian](https://www.ruby-forum.com/letter_avatar_proxy/v4/letter/p/ba8739/32.png) [@PaulGureghian](https://www.ruby-forum.com/u/PaulGureghian)\
**Post date:** [May 3, 2020, 1:54am UTC](https://www.ruby-forum.com/t/what-about-rubocop-rules/259444/1 "2020-05-03T01:54:34Z")

</div>

![Ruby](https://www.ruby-forum.com/uploads/default/original/2X/2/2b9f5939d547401cec33c545c8bd10b698d7218c.png)

The first offense I don’t get. the shebang used is recommended and my .rb script executes

The second one I don’t get at all. what is Rubcop’s issue here ?

The next three I get, but should I fix them or can I edit a Rubocop config file so these offences won’t be offences anymore.

---

<div class="post-metadata">

**Author:** ![pcl](https://www.ruby-forum.com/letter_avatar_proxy/v4/letter/p/ecae2f/32.png) [@pcl](https://www.ruby-forum.com/u/pcl)\
**Post date:** [May 4, 2020, 2:00am UTC](https://www.ruby-forum.com/t/what-about-rubocop-rules/259444/2 "2020-05-04T02:00:50Z")

</div>

The first one might be a windows/linux issue: on linux, you can `chmod +x` a script to make it executable, but that flag may not exist on windows.

The second one is a recommendation - it’s recommending you to use frozen strings, as that may become a default in future. See: [Class: RuboCop::Cop::Style::FrozenStringLiteralComment — Documentation for rubocop (1.52.1)](https://rubydoc.info/gems/rubocop/RuboCop/Cop/Style/FrozenStringLiteralComment)

There’s a config file: in the gems folder “/rubocop-0.82.0/config/default.yml” where you can edit out the things you don’t want checked.

e.g.find `Style/StringLiterals` and change the `Enabled` line to false.

(I think I got too set in my ways, as I don’t like most of the suggestions rubocop makes!)

---

<div class="post-metadata">

**Author:** ![PaulGureghian](https://www.ruby-forum.com/letter_avatar_proxy/v4/letter/p/ba8739/32.png) [@PaulGureghian](https://www.ruby-forum.com/u/PaulGureghian)\
**Post date:** [May 4, 2020, 2:49am UTC](https://www.ruby-forum.com/t/what-about-rubocop-rules/259444/3 "2020-05-04T02:49:11Z")

</div>

I fixed them all. thanks.  
So, the default Rubocop rules are too strict ?

---

<div class="post-metadata">

**Author:** ![pcl](https://www.ruby-forum.com/letter_avatar_proxy/v4/letter/p/ecae2f/32.png) [@pcl](https://www.ruby-forum.com/u/pcl)\
**Post date:** [May 4, 2020, 3:08am UTC](https://www.ruby-forum.com/t/what-about-rubocop-rules/259444/4 "2020-05-04T03:08:44Z")

</div>

The rules are, I think, based on this style guide: [https://rubystyle.guide/](https://rubystyle.guide/)

A lot of them are ‘down to taste’, and I have different preferences in many places:

- I like having explicit returns from multi-line methods
- I never liked the alternate literal hash syntax (why have a different syntax for a different data type?).
- Double-quoted strings are more natural to me, from other languages, and you don’t have to change them when you later decide to do some interpolation.

etc.

But then I write ruby code for myself!

---

<div class="post-metadata">

**Author:** ![PaulGureghian](https://www.ruby-forum.com/letter_avatar_proxy/v4/letter/p/ba8739/32.png) [@PaulGureghian](https://www.ruby-forum.com/u/PaulGureghian)\
**Post date:** [May 4, 2020, 6:43pm UTC](https://www.ruby-forum.com/t/what-about-rubocop-rules/259444/5 "2020-05-04T18:43:02Z")

</div>

Lets see if I can find that Rubocop config file and take a look around.
