-
Notifications
You must be signed in to change notification settings - Fork 0
Open
Labels
Description
Review guidelines for building library: https://hexdocs.pm/elixir/main/library-guidelines.html
-
Check for possible error inside the library:
For example:
Lines 162 to 165 in 2c55a5b
def local_file_read(org_name, repo_name, file_name) do file_path = Path.join([local_repo_path(org_name, repo_name), file_name]) File.read(file_path) end
Here we call theFile.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 theGogs
namespace and use it for other modules:
Line 1 in 2c55a5b
defmodule GogsHelpers do
becomeGogs.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.
nelsonic