-
-
Notifications
You must be signed in to change notification settings - Fork 32
Closed
Labels
help wanted 🤝x:action/improveImprove existing functionality/contentImprove existing functionality/contentx:knowledge/intermediateQuite a bit of Exercism knowledge requiredQuite a bit of Exercism knowledge requiredx:module/analyzerWork on AnalyzersWork on Analyzersx:size/largeLarge amount of workLarge amount of workx:status/claimedSomeone is working on this issueSomeone is working on this issuex:type/codingWrite code that is not student-facing content (e.g. test-runners, generators, but not exercises)Write code that is not student-facing content (e.g. test-runners, generators, but not exercises)
Description
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/contentImprove existing functionality/contentx:knowledge/intermediateQuite a bit of Exercism knowledge requiredQuite a bit of Exercism knowledge requiredx:module/analyzerWork on AnalyzersWork on Analyzersx:size/largeLarge amount of workLarge amount of workx:status/claimedSomeone is working on this issueSomeone is working on this issuex:type/codingWrite code that is not student-facing content (e.g. test-runners, generators, but not exercises)Write code that is not student-facing content (e.g. test-runners, generators, but not exercises)