dwyl / dwyl/gogs

Library guidelines

Open
#36 2 comments 1 reaction 0 assignees View on GitHub
enhancement
Dominant language
Elixir
Stars
10
Forks
0
PR merge metrics
No merged PRs in 30d

Description

Review guidelines for building library: https://hexdocs.pm/elixir/main/library-guidelines.html

- Check for possible error inside the library:
For example:
https://github.com/dwyl/gogs/blob/2c55a5be2da1dd2db9844fbf6755566988471d42/lib/gogs.ex#L162-L165
Here we call the `File.read` function without checking for errors. We can add a case statement here to make sure we read the file without any errors or report the error from the library itself to make is easier to debug
see: https://hexdocs.pm/elixir/main/library-guidelines.html#avoid-working-with-invalid-data

- Application configuration
At the moment we are using module constant to defined from environment variable. We had a few issues linked to this and it might be better to let the application using the library define these values in the config file.
see https://hexdocs.pm/elixir/main/library-guidelines.html#avoid-application-configuration

- Rename modules
Create the `Gogs` namespace and use it for other modules:
https://github.com/dwyl/gogs/blob/2c55a5be2da1dd2db9844fbf6755566988471d42/lib/helpers.ex#L1
become `Gogs.Helpers`
see: https://hexdocs.pm/elixir/main/library-guidelines.html#avoid-defining-modules-that-are-not-in-your-namespace

These are the main points that we can update for now.

Contributor guide

No contributing guide indexed for this repository

Assessment

This issue has not been assessed yet.

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.