the release's defaults run before the project's does, so, usually the
github/gitlab/gitea names are set.
however, in some cases, the release's defaults might be skipped, in
which case they'll be empty.
this breaks things like `goreleaser changelog`, especially on non-go
repositories.
this pr tries to extract the project name from the git remote url in the
project's defaulter.
it might be possible now to move it to run before the release defaulter,
even.
---------
Signed-off-by: Carlos Alexandro Becker <caarlos0@users.noreply.github.com>
If all other strategies fail, try to infer the `package_name` property
from the `go.mod` file, using its last segment as the actual package
name.
This is not perfect, but usually this will only be used when running
against a new project, with no git url, empty/default config, etc... so,
in reality, it'll rarely be used.
closes#3825
Signed-off-by: Carlos A Becker <caarlos0@users.noreply.github.com>
alternative to #3806
the idea is that both `context.New` and `context.Context{}` are never
used in tests.
not sure yet how much I like it, so far code does look a bit more
readable though.
---------
Signed-off-by: Carlos A Becker <caarlos0@users.noreply.github.com>
* chore(deps): bump github.com/golangci/golangci-lint from 1.23.7 to 1.27.0
Signed-off-by: Carlos Alexandro Becker <caarlos0@gmail.com>
* fix: tests
Signed-off-by: Carlos Alexandro Becker <caarlos0@gmail.com>