peek-travel / cocktail

Elixir date recurrence library based on iCalendar events
https://hexdocs.pm/cocktail
MIT License
218 stars 30 forks source link

Fix inspect protocol implementation for Elixir 1.14.1 and other improvements #267

Closed seantanly closed 1 year ago

seantanly commented 1 year ago

A compilation error occurs under Elixir 1.14.1

Compiling 21 files (.ex)
warning: redefining module Inspect.Kernel (current version loaded from _build/dev/lib/credo/ebin/Elixir.Inspect.Kernel.beam)
  lib/cocktail/rule.ex:31

warning: redefining module Inspect.Kernel (current version loaded from _build/dev/lib/credo/ebin/Elixir.Inspect.Kernel.beam)
  lib/cocktail/schedule.ex:251

== Compilation error in file lib/cocktail/schedule.ex ==
** (CompileError) lib/cocktail/schedule.ex:251: cannot define module Inspect.Kernel because it is currently being defined in lib/cocktail/rule.ex:31
    lib/cocktail/schedule.ex:251: (module)

This PR fixes the error by explicitly defining the module name instead of relying on __MODULE__.

In addition, deleted the unnecessary configs folder, when it's not necessary, as seen in new projects generated by mix new <app>.

Fixed Credo warnings on %struct in @specs and refactor opportunity of map + join -> map_join.

Deps updated along the way with tests passing.

seantanly commented 1 year ago

@coladarci please assist in reviewing and merging the PR to resolve the compilation error in Elixir 1.14.1 . Thank you.

vanvoljg commented 1 year ago

Hello. Thank you for the PR. This behaviour is a bug that was reported in this issue in the Elixir lang repo. It will be fixed in the next version of Elixir.

Feel free to submit the other changes in a separate PR, though!