Skip to content

Add a common check for is_foo? function names that mix up two separate naming patterns #168

@angelikatyborska

Description

@angelikatyborska

I saw this in one of the community solutions:

defp is_allowed_char?(char), do: (char >= 97 and char <= 122) or char == 95

The correct name is either allowed_char? or is_allowed_char, not both. Source: https://hexdocs.pm/elixir/naming-conventions.html#is_-prefix-is_foo

We should add a common check that looks for functions and macros named is_foo? and points to the explanation that it should be either foo? or is_foo (but we don't need to try to detect which it should be).

Edit based on the discussion below:

We should add checks that follow this table:

definition is_foo? is_foo foo?
def/depf 🚫 🚫
defguard/defguardp 🚫 🚫
defmacro/defmacrop 🚫

Metadata

Metadata

Assignees

Labels

help wanted 🤝x:action/improveImprove existing functionality/contentx:knowledge/intermediateQuite a bit of Exercism knowledge requiredx:module/analyzerWork on Analyzersx:size/largeLarge amount of workx:status/claimedSomeone is working on this issuex:type/codingWrite code that is not student-facing content (e.g. test-runners, generators, but not exercises)

Type

No type

Projects

No projects

Milestone

No milestone

Relationships

None yet

Development

No branches or pull requests

Issue actions