Coder Social home page Coder Social logo

exception names are too limited about ameba HOT 7 CLOSED

stakach avatar stakach commented on June 3, 2024 1
exception names are too limited

from ameba.

Comments (7)

Sija avatar Sija commented on June 3, 2024 1

Yeah, in the same time rescue ex has 6.9k occurrences (~10x more than rescue exc) - i.e. all other uses are pretty marginal. I'm gonna add error to the defaults though, since it was unaccounted for.

from ameba.

stakach avatar stakach commented on June 3, 2024 1

thanks mate!

from ameba.

straight-shoota avatar straight-shoota commented on June 3, 2024 1

Perhaps use cases such as ex_ prefix could be enabled with regex matching support?

from ameba.

Sija avatar Sija commented on June 3, 2024

I feel like this should include version common names like error

It's not that common, therefore I didn't include it.
You can add it to your project's .ameba.yml file.

it should probably add something like || begins_with?("#{allowed}_") so nested exceptions can be handled like ex_parse ex_io etc

I disagree, exception variables should IMO have unified names.

Also e is not very descriptive ...

IMO it is - in the same way i (for index) is.

... and breaks other rules like descriptive block naming.

It shouldn't, since it's explicitly whitelisted:

allowed_names %w[_ e i j k v x y ex io ws op tx id ip k1 k2 v1 v2]

from ameba.

stakach avatar stakach commented on June 3, 2024

Seem pretty commonly used
https://github.com/search?q=%28language%3ACrystal+%29+AND+%22rescue+error%22&type=code

image

from ameba.

stakach avatar stakach commented on June 3, 2024

more common than rescue exception

image

from ameba.

stakach avatar stakach commented on June 3, 2024

also missing exc which is also quite commonly used

image

from ameba.

Related Issues (20)

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo 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.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.