forked from Plemya-x/ALR
Compare commits
No commits in common. "chore/add-linters" and "master" have entirely different histories.
chore/add-
...
master
@ -1,26 +0,0 @@
|
||||
run:
|
||||
timeout: 5m
|
||||
|
||||
linters-settings:
|
||||
goimports:
|
||||
local-prefixes: "plemya-x.ru/alr"
|
||||
gofmt:
|
||||
simplify: true
|
||||
gofumpt:
|
||||
extra-rules: true
|
||||
|
||||
linters:
|
||||
enable:
|
||||
- gofmt
|
||||
- gofumpt
|
||||
- goimports
|
||||
- gocritic
|
||||
- govet
|
||||
- staticcheck
|
||||
- unused
|
||||
- errcheck
|
||||
- typecheck
|
||||
# - forbidigo
|
||||
|
||||
issues:
|
||||
fix: true
|
6
Makefile
6
Makefile
@ -11,8 +11,6 @@ ZSH_COMPLETION := $(COMPLETIONS_DIR)/zsh
|
||||
INSTALLED_BASH_COMPLETION := $(DESTDIR)$(PREFIX)/share/bash-completion/completions/$(NAME)
|
||||
INSTALLED_ZSH_COMPLETION := $(DESTDIR)$(PREFIX)/share/zsh/site-functions/_$(NAME)
|
||||
|
||||
GOLANGCI_LINT := go run github.com/golangci/golangci-lint/cmd/golangci-lint@v1.62.2
|
||||
|
||||
.PHONY: build install clean clear uninstall check-no-root
|
||||
|
||||
build: check-no-root $(BIN)
|
||||
@ -27,10 +25,6 @@ check-no-root:
|
||||
exit 1; \
|
||||
fi
|
||||
|
||||
# TODO: remove --tests=false
|
||||
fmt:
|
||||
$(GOLANGCI_LINT) run --fix --tests=false
|
||||
|
||||
install: \
|
||||
$(INSTALED_BIN) \
|
||||
$(INSTALLED_BASH_COMPLETION) \
|
||||
|
1
build.go
1
build.go
@ -23,7 +23,6 @@ import (
|
||||
"path/filepath"
|
||||
|
||||
"github.com/urfave/cli/v2"
|
||||
|
||||
"plemya-x.ru/alr/internal/config"
|
||||
"plemya-x.ru/alr/internal/osutils"
|
||||
"plemya-x.ru/alr/internal/types"
|
||||
|
1
fix.go
1
fix.go
@ -22,7 +22,6 @@ import (
|
||||
"os"
|
||||
|
||||
"github.com/urfave/cli/v2"
|
||||
|
||||
"plemya-x.ru/alr/internal/config"
|
||||
"plemya-x.ru/alr/internal/db"
|
||||
"plemya-x.ru/alr/pkg/loggerctx"
|
||||
|
1
gen.go
1
gen.go
@ -4,7 +4,6 @@ import (
|
||||
"os"
|
||||
|
||||
"github.com/urfave/cli/v2"
|
||||
|
||||
"plemya-x.ru/alr/pkg/gen"
|
||||
)
|
||||
|
||||
|
@ -6,13 +6,12 @@ import (
|
||||
"strings"
|
||||
|
||||
"github.com/urfave/cli/v2"
|
||||
"mvdan.cc/sh/v3/expand"
|
||||
"mvdan.cc/sh/v3/interp"
|
||||
|
||||
"plemya-x.ru/alr/internal/cpu"
|
||||
"plemya-x.ru/alr/internal/shutils/helpers"
|
||||
"plemya-x.ru/alr/pkg/distro"
|
||||
"plemya-x.ru/alr/pkg/loggerctx"
|
||||
"mvdan.cc/sh/v3/expand"
|
||||
"mvdan.cc/sh/v3/interp"
|
||||
)
|
||||
|
||||
var helperCmd = &cli.Command{
|
||||
|
3
info.go
3
info.go
@ -23,14 +23,13 @@ import (
|
||||
"os"
|
||||
|
||||
"github.com/urfave/cli/v2"
|
||||
"gopkg.in/yaml.v3"
|
||||
|
||||
"plemya-x.ru/alr/internal/cliutils"
|
||||
"plemya-x.ru/alr/internal/config"
|
||||
"plemya-x.ru/alr/internal/overrides"
|
||||
"plemya-x.ru/alr/pkg/distro"
|
||||
"plemya-x.ru/alr/pkg/loggerctx"
|
||||
"plemya-x.ru/alr/pkg/repos"
|
||||
"gopkg.in/yaml.v3"
|
||||
)
|
||||
|
||||
var infoCmd = &cli.Command{
|
||||
|
@ -22,7 +22,6 @@ import (
|
||||
"fmt"
|
||||
|
||||
"github.com/urfave/cli/v2"
|
||||
|
||||
"plemya-x.ru/alr/internal/cliutils"
|
||||
"plemya-x.ru/alr/internal/config"
|
||||
"plemya-x.ru/alr/internal/db"
|
||||
|
@ -24,7 +24,6 @@ import (
|
||||
"strings"
|
||||
|
||||
"github.com/AlecAivazis/survey/v2"
|
||||
|
||||
"plemya-x.ru/alr/internal/config"
|
||||
"plemya-x.ru/alr/internal/db"
|
||||
"plemya-x.ru/alr/internal/pager"
|
||||
|
@ -24,7 +24,6 @@ import (
|
||||
"sync"
|
||||
|
||||
"github.com/pelletier/go-toml/v2"
|
||||
|
||||
"plemya-x.ru/alr/internal/types"
|
||||
"plemya-x.ru/alr/pkg/loggerctx"
|
||||
)
|
||||
|
@ -24,9 +24,8 @@ import (
|
||||
"strings"
|
||||
"sync"
|
||||
|
||||
"golang.org/x/text/language"
|
||||
|
||||
"plemya-x.ru/alr/pkg/loggerctx"
|
||||
"golang.org/x/text/language"
|
||||
)
|
||||
|
||||
var (
|
||||
|
@ -25,7 +25,6 @@ import (
|
||||
"sync"
|
||||
|
||||
"github.com/pelletier/go-toml/v2"
|
||||
|
||||
"plemya-x.ru/alr/pkg/loggerctx"
|
||||
)
|
||||
|
||||
|
@ -28,11 +28,10 @@ import (
|
||||
"sync"
|
||||
|
||||
"github.com/jmoiron/sqlx"
|
||||
"golang.org/x/exp/slices"
|
||||
"modernc.org/sqlite"
|
||||
|
||||
"plemya-x.ru/alr/internal/config"
|
||||
"plemya-x.ru/alr/pkg/loggerctx"
|
||||
"golang.org/x/exp/slices"
|
||||
"modernc.org/sqlite"
|
||||
)
|
||||
|
||||
// CurrentVersion is the current version of the database.
|
||||
|
@ -14,7 +14,7 @@
|
||||
*
|
||||
* You should have received a copy of the GNU General Public License
|
||||
* along with this program. If not, see <http://www.gnu.org/licenses/>.
|
||||
*/
|
||||
*/
|
||||
|
||||
// Пакет dl содержит абстракции для загрузки файлов и каталогов
|
||||
// из различных источников.
|
||||
@ -39,7 +39,6 @@ import (
|
||||
"golang.org/x/crypto/blake2b"
|
||||
"golang.org/x/crypto/blake2s"
|
||||
"golang.org/x/exp/slices"
|
||||
|
||||
"plemya-x.ru/alr/internal/dlcache"
|
||||
"plemya-x.ru/alr/pkg/loggerctx"
|
||||
)
|
||||
@ -300,6 +299,8 @@ func linkDir(src, dest string) error {
|
||||
return nil
|
||||
}
|
||||
|
||||
|
||||
|
||||
rel, err := filepath.Rel(src, path)
|
||||
if err != nil {
|
||||
return err
|
||||
|
@ -33,7 +33,6 @@ import (
|
||||
|
||||
"github.com/mholt/archiver/v4"
|
||||
"github.com/schollz/progressbar/v3"
|
||||
|
||||
"plemya-x.ru/alr/internal/shutils/handlers"
|
||||
)
|
||||
|
||||
|
@ -22,12 +22,11 @@ import (
|
||||
"reflect"
|
||||
"strings"
|
||||
|
||||
"golang.org/x/exp/slices"
|
||||
"golang.org/x/text/language"
|
||||
|
||||
"plemya-x.ru/alr/internal/cpu"
|
||||
"plemya-x.ru/alr/internal/db"
|
||||
"plemya-x.ru/alr/pkg/distro"
|
||||
"golang.org/x/exp/slices"
|
||||
"golang.org/x/text/language"
|
||||
)
|
||||
|
||||
type Opts struct {
|
||||
|
@ -25,13 +25,12 @@ import (
|
||||
"strings"
|
||||
|
||||
"github.com/mitchellh/mapstructure"
|
||||
"plemya-x.ru/alr/internal/overrides"
|
||||
"plemya-x.ru/alr/pkg/distro"
|
||||
"golang.org/x/exp/slices"
|
||||
"mvdan.cc/sh/v3/expand"
|
||||
"mvdan.cc/sh/v3/interp"
|
||||
"mvdan.cc/sh/v3/syntax"
|
||||
|
||||
"plemya-x.ru/alr/internal/overrides"
|
||||
"plemya-x.ru/alr/pkg/distro"
|
||||
)
|
||||
|
||||
var ErrNotPointerToStruct = errors.New("val must be a pointer to a struct")
|
||||
|
@ -10,9 +10,9 @@ import (
|
||||
"syscall"
|
||||
"time"
|
||||
|
||||
"plemya-x.ru/fakeroot"
|
||||
"mvdan.cc/sh/v3/expand"
|
||||
"mvdan.cc/sh/v3/interp"
|
||||
"plemya-x.ru/fakeroot"
|
||||
)
|
||||
|
||||
// FakerootExecHandler was extracted from github.com/mvdan/sh/interp/handler.go
|
||||
|
@ -31,9 +31,8 @@ import (
|
||||
"github.com/go-git/go-git/v5"
|
||||
"github.com/go-git/go-git/v5/plumbing/object"
|
||||
"golang.org/x/exp/slices"
|
||||
"mvdan.cc/sh/v3/interp"
|
||||
|
||||
"plemya-x.ru/alr/internal/shutils/handlers"
|
||||
"mvdan.cc/sh/v3/interp"
|
||||
)
|
||||
|
||||
var (
|
||||
|
@ -24,10 +24,9 @@ import (
|
||||
"sync"
|
||||
|
||||
"go.elara.ws/logger"
|
||||
"plemya-x.ru/alr/pkg/loggerctx"
|
||||
"go.elara.ws/translate"
|
||||
"golang.org/x/text/language"
|
||||
|
||||
"plemya-x.ru/alr/pkg/loggerctx"
|
||||
)
|
||||
|
||||
//go:embed files
|
||||
|
3
list.go
3
list.go
@ -22,13 +22,12 @@ import (
|
||||
"fmt"
|
||||
|
||||
"github.com/urfave/cli/v2"
|
||||
"golang.org/x/exp/slices"
|
||||
|
||||
"plemya-x.ru/alr/internal/config"
|
||||
"plemya-x.ru/alr/internal/db"
|
||||
"plemya-x.ru/alr/pkg/loggerctx"
|
||||
"plemya-x.ru/alr/pkg/manager"
|
||||
"plemya-x.ru/alr/pkg/repos"
|
||||
"golang.org/x/exp/slices"
|
||||
)
|
||||
|
||||
var listCmd = &cli.Command{
|
||||
|
1
main.go
1
main.go
@ -28,7 +28,6 @@ import (
|
||||
"github.com/mattn/go-isatty"
|
||||
"github.com/urfave/cli/v2"
|
||||
"go.elara.ws/logger"
|
||||
|
||||
"plemya-x.ru/alr/internal/config"
|
||||
"plemya-x.ru/alr/internal/db"
|
||||
"plemya-x.ru/alr/internal/translations"
|
||||
|
@ -52,7 +52,6 @@ import (
|
||||
|
||||
"github.com/goreleaser/nfpm/v2"
|
||||
"github.com/goreleaser/nfpm/v2/files"
|
||||
|
||||
"plemya-x.ru/alr/internal/cliutils"
|
||||
"plemya-x.ru/alr/internal/config"
|
||||
"plemya-x.ru/alr/internal/cpu"
|
||||
|
@ -8,7 +8,6 @@ import (
|
||||
"strings"
|
||||
|
||||
"github.com/goreleaser/nfpm/v2"
|
||||
|
||||
"plemya-x.ru/alr/internal/types"
|
||||
"plemya-x.ru/alr/pkg/loggerctx"
|
||||
)
|
||||
|
@ -23,11 +23,10 @@ import (
|
||||
"os"
|
||||
"strings"
|
||||
|
||||
"plemya-x.ru/alr/internal/shutils/handlers"
|
||||
"mvdan.cc/sh/v3/expand"
|
||||
"mvdan.cc/sh/v3/interp"
|
||||
"mvdan.cc/sh/v3/syntax"
|
||||
|
||||
"plemya-x.ru/alr/internal/shutils/handlers"
|
||||
)
|
||||
|
||||
// OSRelease contains information from an os-release file
|
||||
|
@ -12,7 +12,6 @@ import (
|
||||
|
||||
// Используем директиву //go:embed для встраивания содержимого файла шаблона в строку pipTmpl
|
||||
// Встраивание файла tmpls/pip.tmpl.sh
|
||||
//
|
||||
//go:embed tmpls/pip.tmpl.sh
|
||||
var pipTmpl string
|
||||
|
||||
|
@ -107,7 +107,6 @@ func (a *APTRpm) UpgradeAll(opts *Opts) error {
|
||||
}
|
||||
return nil
|
||||
}
|
||||
|
||||
func (y *APTRpm) ListInstalled(opts *Opts) (map[string]string, error) {
|
||||
out := map[string]string{}
|
||||
cmd := exec.Command("rpm", "-qa", "--queryformat", "%{NAME}\u200b%|EPOCH?{%{EPOCH}:}:{}|%{VERSION}-%{RELEASE}\\n")
|
||||
|
@ -35,10 +35,6 @@ import (
|
||||
"github.com/go-git/go-git/v5/plumbing/format/diff"
|
||||
"github.com/pelletier/go-toml/v2"
|
||||
"go.elara.ws/vercmp"
|
||||
"mvdan.cc/sh/v3/expand"
|
||||
"mvdan.cc/sh/v3/interp"
|
||||
"mvdan.cc/sh/v3/syntax"
|
||||
|
||||
"plemya-x.ru/alr/internal/config"
|
||||
"plemya-x.ru/alr/internal/db"
|
||||
"plemya-x.ru/alr/internal/shutils/decoder"
|
||||
@ -46,6 +42,9 @@ import (
|
||||
"plemya-x.ru/alr/internal/types"
|
||||
"plemya-x.ru/alr/pkg/distro"
|
||||
"plemya-x.ru/alr/pkg/loggerctx"
|
||||
"mvdan.cc/sh/v3/expand"
|
||||
"mvdan.cc/sh/v3/interp"
|
||||
"mvdan.cc/sh/v3/syntax"
|
||||
)
|
||||
|
||||
// Pull pulls the provided repositories. If a repo doesn't exist, it will be cloned
|
||||
|
3
repo.go
3
repo.go
@ -24,13 +24,12 @@ import (
|
||||
|
||||
"github.com/pelletier/go-toml/v2"
|
||||
"github.com/urfave/cli/v2"
|
||||
"golang.org/x/exp/slices"
|
||||
|
||||
"plemya-x.ru/alr/internal/config"
|
||||
"plemya-x.ru/alr/internal/db"
|
||||
"plemya-x.ru/alr/internal/types"
|
||||
"plemya-x.ru/alr/pkg/loggerctx"
|
||||
"plemya-x.ru/alr/pkg/repos"
|
||||
"golang.org/x/exp/slices"
|
||||
)
|
||||
|
||||
var addrepoCmd = &cli.Command{
|
||||
|
@ -23,10 +23,6 @@ import (
|
||||
"fmt"
|
||||
|
||||
"github.com/urfave/cli/v2"
|
||||
"go.elara.ws/vercmp"
|
||||
"golang.org/x/exp/maps"
|
||||
"golang.org/x/exp/slices"
|
||||
|
||||
"plemya-x.ru/alr/internal/config"
|
||||
"plemya-x.ru/alr/internal/db"
|
||||
"plemya-x.ru/alr/internal/types"
|
||||
@ -35,6 +31,9 @@ import (
|
||||
"plemya-x.ru/alr/pkg/loggerctx"
|
||||
"plemya-x.ru/alr/pkg/manager"
|
||||
"plemya-x.ru/alr/pkg/repos"
|
||||
"go.elara.ws/vercmp"
|
||||
"golang.org/x/exp/maps"
|
||||
"golang.org/x/exp/slices"
|
||||
)
|
||||
|
||||
var upgradeCmd = &cli.Command{
|
||||
|
Loading…
Reference in New Issue
Block a user