Skip to content

Commit

Permalink
style: reinstate parentheses for zero-arity functions
Browse files Browse the repository at this point in the history
  • Loading branch information
ahamez committed Feb 26, 2025
1 parent 5ec4262 commit 97df1dc
Show file tree
Hide file tree
Showing 4 changed files with 10 additions and 10 deletions.
2 changes: 1 addition & 1 deletion .credo.exs
Original file line number Diff line number Diff line change
Expand Up @@ -102,7 +102,7 @@
{Credo.Check.Readability.ModuleDoc, []},
{Credo.Check.Readability.ModuleNames, []},
{Credo.Check.Readability.ParenthesesInCondition, []},
{Credo.Check.Readability.ParenthesesOnZeroArityDefs, false},
{Credo.Check.Readability.ParenthesesOnZeroArityDefs, [parens: true]},
{Credo.Check.Readability.PipeIntoAnonymousFunctions, []},
{Credo.Check.Readability.PredicateFunctionNames, []},
{Credo.Check.Readability.PreferImplicitTry, []},
Expand Down
2 changes: 1 addition & 1 deletion lib/protox/define_message.ex
Original file line number Diff line number Diff line change
Expand Up @@ -56,7 +56,7 @@ defmodule Protox.DefineMessage do
def unknown_fields(msg), do: msg.unquote(unknown_fields)

@spec unknown_fields_name() :: unquote(unknown_fields)
def unknown_fields_name, do: unquote(unknown_fields)
def unknown_fields_name(), do: unquote(unknown_fields)

@spec clear_unknown_fields(struct) :: struct
def clear_unknown_fields(msg), do: struct!(msg, [{unquote(unknown_fields), []}])
Expand Down
2 changes: 1 addition & 1 deletion lib/protox/string.ex
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,7 @@ defmodule Protox.String do

if Mix.env() == :test do
@max_size Bitwise.<<<(1, 20)
def max_size, do: @max_size
def max_size(), do: @max_size
else
# Reference: https://protobuf.dev/programming-guides/proto3/#scalar
@max_size Bitwise.<<<(1, 32)
Expand Down
14 changes: 7 additions & 7 deletions mix.exs
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
defmodule Protox.Mixfile do
use Mix.Project

def project do
def project() do
[
app: :protox,
version: "2.0.0-dev",
Expand All @@ -25,13 +25,13 @@ defmodule Protox.Mixfile do
defp elixirc_paths(:prod), do: ["lib"]
defp elixirc_paths(_), do: ["lib", "conformance", "benchmark", "test/support"]

def application do
def application() do
[
extra_applications: [:benchee, :eex, :mix]
]
end

defp deps do
defp deps() do
[
{:benchee, "~> 1.0", only: [:test, :dev], runtime: false},
{:benchee_html, "~> 1.0", only: [:test, :dev], runtime: false},
Expand Down Expand Up @@ -79,13 +79,13 @@ defmodule Protox.Mixfile do
end
end

defp description do
defp description() do
"""
A fast, easy to use and 100% conformant Elixir library for Google Protocol Buffers (aka protobuf)
"""
end

def escript do
def escript() do
[
# do not start any application: avoid propcheck app to fail when running escript
app: nil,
Expand All @@ -94,7 +94,7 @@ defmodule Protox.Mixfile do
]
end

defp package do
defp package() do
[
name: :protox,
files: ["lib", "mix.exs", "README*", "LICENSE"],
Expand All @@ -105,7 +105,7 @@ defmodule Protox.Mixfile do
]
end

defp docs do
defp docs() do
[
main: "readme",
extras: ["README.md", "documentation/reference.md"]
Expand Down

0 comments on commit 97df1dc

Please sign in to comment.