-
-
Notifications
You must be signed in to change notification settings - Fork 30
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Add Credo #56
Add Credo #56
Conversation
# exclude exercise analysis because of snippets in `feature do form do...` | ||
# they can be unusual, e.g. `_ignore || _ignore` | ||
"lib/elixir_analyzer/test_suite/", | ||
# exclude exercise analysis test because of example solutions used in tests | ||
# those mimic student solutions and might be "bad code" on purpose | ||
"test/elixir_analyzer/test_suite/" |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
This is the only change in this config that I made, compared to the default config.
@@ -23,6 +23,7 @@ defmodule ElixirAnalyzer.ExerciseTest do | |||
# | |||
|
|||
defmacro __before_compile__(env) do | |||
# credo:disable-for-previous-line Credo.Check.Refactor.CyclomaticComplexity |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
This is the only place where I was afraid of splitting this code to reduce cyclomatic complexity, so I took the easy way out...
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Looks good, forgot how opinionated credo is about cond
vs if
, but I'm good with it
elixir 1.11.3-otp-23 | ||
erlang 23.2.6 |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
👍🏻 Looks good!
This PR adds credo and fixes all problems reported by it. It also adds the credo check to the CI.
I'm also sneaking in
.tool-versions
, the same as the test runner and representer have.