Skip to content
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

Style refactors #62

Merged
merged 13 commits into from
Jun 29, 2020
Merged

Style refactors #62

merged 13 commits into from
Jun 29, 2020

Conversation

niklaslong
Copy link
Collaborator

@niklaslong niklaslong commented Jun 26, 2020

Closes #59.

Changes I included:

  • use def func(), do: syntax for one-line functions
  • remove single pipes
  • start pipes with raw value and not a function call
  • use pipes instead of reassignment where possible
  • use __MODULE__ where possible
  • consolidate aliases under same namespace with Mod.{ModA, ModB}

Changes I didn't include (i.e. larger refactoring opportunities).

  • doctests, see Run tests on documentation examples #63
  • nested control flow (making logic hard to follow)
  • large functions should be broken up into smaller ones doing only one thing
  • pattern matching in function heads should be mainly used for control flow
  • module imports spacing, I've left this mostly as is, as it's mostly down to personal preference

@niklaslong niklaslong marked this pull request as ready for review June 29, 2020 16:20
Copy link
Member

@oliverbarnes oliverbarnes left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

This is great 🙌 Nicely scoped, and the codebase already feels cleaner and more idiomatic.

@oliverbarnes oliverbarnes merged commit 4c5b69a into liquidvotingio:master Jun 29, 2020
@niklaslong niklaslong deleted the style-refactors branch June 29, 2020 18:39
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

Run formatter
2 participants