Comments (4)
I disagree, this argument has been based on a false assertion of high false positive rate of
UselessAssign
rule.
Not really, this is just the latest occurrence. In the past there was Lint/NotNil
, and the change in all the Naming/*
rules. It just feels like a lot of the rules are becoming more subjective. Plus with them being enabled by default, it forces the users to conform, or disable the rules.
I don't have any strong feelings around a way forward, but one idea that comes to mind is introducing new rules, keeping them disabled, then at some point in the future, do a new major release that changes the default rules.
EDIT: Another idea is having some sort of tiered rule system. Where tier 1 can be the most useful objective rules, then tier 2 gets a bit less objective, but still conforms to convention, and tier 3+ are Ameba's opinionated rules.
from ameba.
@sanks02 False positive you've mentioned was fixed in #443
from ameba.
But in general, I think it would be very helpful to avoid required user interaction every time a new rule is added. That's especially if the rule has a high rate of false positives (such as
Lint/UselessAssign
). That just keeps annoying users.
I disagree, this argument has been based on a false assertion of high false positive rate of UselessAssign
rule. Yes, there were several, due to the recent changes, yet this doesn't constitute this rule as having "high rate of false positives".
Maybe for a project with existing ameba configuration, all rules that have been added since the version that generated the ameba config could be disabled by default? I.e. if I have a config from ameba 1.6, ameba will only consider rules from 1.6 until I explicitly upgrade to a new version and ruleset.
This would mean an extra DX hassle which I'd like to avoid. Let's think about this more.
from ameba.
I would note that I'm having the same issue.
Though I think it predates Ameba. Here is what is disabled in .rubocop.yml
in one of my Ruby projects:
Metrics/AbcSize:
Enabled: false
Metrics/BlockLength:
Enabled: false
Metrics/ClassLength:
Enabled: false
Metrics/CyclomaticComplexity:
Enabled: false
Metrics/MethodLength:
Enabled: false
Metrics/ModuleLength:
Enabled: false
Metrics/ParameterLists:
Enabled: false
Metrics/PerceivedComplexity:
Enabled: false
Minitest/MultipleAssertions:
Enabled: false
Rails/CreateTableWithTimestamps:
Enabled: false
Rails/DangerousColumnNames:
Enabled: false
Rails/FindEach:
Enabled: false
Rails/I18nLocaleTexts:
Enabled: false
Rails/Pluck:
Enabled: false
Style/Documentation:
Enabled: false
Style/EmptyCaseCondition:
Enabled: false
I often have to disable a couple new rules when updating RuboCop.
Here's what .ameba.yml
looks like in one of my projects:
Documentation/DocumentationAdmonition:
Enabled: false
Lint/UselessAssign:
Enabled: false
Metrics/CyclomaticComplexity:
Enabled: false
Naming/BlockParameterName:
Enabled: false
Three of these were added in the latest minor release, with Lint/UselessAssign
having a false positive here (see IHDR
usage):
- https://github.com/phenopolis/pluto/blob/53b7ec2adcc7b23088a26b9f9a7c511911bf1b59/src/pluto/format/binding/lib_spng.cr#L10-L12
- https://github.com/phenopolis/pluto/blob/53b7ec2adcc7b23088a26b9f9a7c511911bf1b59/src/pluto/format/binding/lib_spng.cr#L68-L76
- https://github.com/phenopolis/pluto/blob/53b7ec2adcc7b23088a26b9f9a7c511911bf1b59/src/pluto/format/png.cr#L11-L27
from ameba.
Related Issues (20)
- warn on redundant use of `.try` HOT 3
- Recognize unused variable from type declaration HOT 2
- ComparisonToBoolean with Bool unions HOT 2
- exception names are too limited HOT 7
- A dedicated `rules` command HOT 1
- `Lint/UselessAssign` reports type declarations within `lib` definitions
- Add lsp server option HOT 1
- `Lint/UselessAssign` when using generics HOT 9
- `Lint/UselessAssign` reports macros accepting `Crystal::Macros::TypeDeclaration` HOT 16
- Naming/BlockParameterName + stdlib methods like sort HOT 4
- spec helpers getting flagged HOT 1
- Custom macro generates "Useless assignment to variable" HOT 3
- Naming/BlockParameterName with ignored names HOT 1
- Ameba trips on folder named `*.cr`
- [Feature Request] Unused `rescue` variable name
- [Feature Request] Lint against accessing instance variables outside of the instance of a class HOT 4
- ameba no longer works in WSL
- Add rule enforcing explicit return HOT 5
- False positive `Lint/UselessAssign`
Recommend Projects
-
React
A declarative, efficient, and flexible JavaScript library for building user interfaces.
-
Vue.js
🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
-
Typescript
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
-
TensorFlow
An Open Source Machine Learning Framework for Everyone
-
Django
The Web framework for perfectionists with deadlines.
-
Laravel
A PHP framework for web artisans
-
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.
-
Visualization
Some thing interesting about visualization, use data art
-
Game
Some thing interesting about game, make everyone happy.
Recommend Org
-
Facebook
We are working to build community through open source technology. NB: members must have two-factor auth.
-
Microsoft
Open source projects and samples from Microsoft.
-
Google
Google ❤️ Open Source for everyone.
-
Alibaba
Alibaba Open Source for everyone
-
D3
Data-Driven Documents codes.
-
Tencent
China tencent open source team.
from ameba.