Skip to content

Commit

Permalink
update devenv.lock (#17)
Browse files Browse the repository at this point in the history
* update devenv.lock

* cleanup devenv.nix

* run.skip-dirs is deprecated

Use issues.exclude-dirs instead

* remove unused linters

* please the linter gods
  • Loading branch information
endorama authored Jun 24, 2024
1 parent 9a14b07 commit ea948e7
Show file tree
Hide file tree
Showing 14 changed files with 35 additions and 83 deletions.
8 changes: 4 additions & 4 deletions .golangci.yaml
Original file line number Diff line number Diff line change
@@ -1,5 +1,6 @@
run:
skip-dirs:
---
issues:
exclude-dirs:
- internal/tmp

output:
Expand All @@ -19,9 +20,8 @@ linters:
- govet
- makezero
- noctx
- rowserrcheck
# - scopelint
- sqlclosecheck
# - sqlclosecheck
- staticcheck
- typecheck
# complexity
Expand Down
2 changes: 1 addition & 1 deletion cmd/backup.go
Original file line number Diff line number Diff line change
Expand Up @@ -41,7 +41,7 @@ This command loads the current persona from DEVID_ACTIVE_PERSONA environment var
value takes precedence over the --persona flag.
`,
Args: cobra.NoArgs,
Run: func(cmd *cobra.Command, args []string) {
Run: func(cmd *cobra.Command, _ []string) {
p, err := utils.LoadPersona(cmd)
if err != nil {
ui.Fatal(fmt.Errorf("cannot instantiate persona: %w", err), noPersonaLoadedExitCode)
Expand Down
2 changes: 1 addition & 1 deletion cmd/delete.go
Original file line number Diff line number Diff line change
Expand Up @@ -43,7 +43,7 @@ further details.
This command loads the current persona from DEVID_ACTIVE_PERSONA environment variable, and this
value takes precedence over the --persona flag.
`,
Run: func(cmd *cobra.Command, args []string) {
Run: func(cmd *cobra.Command, _ []string) {
p, err := utils.LoadPersona(cmd)
if err != nil {
ui.Fatal(fmt.Errorf("cannot instantiate persona: %w", err), noPersonaLoadedExitCode)
Expand Down
2 changes: 1 addition & 1 deletion cmd/edit.go
Original file line number Diff line number Diff line change
Expand Up @@ -40,7 +40,7 @@ Allowed EDITOR values: %s
This command loads the current persona from DEVID_ACTIVE_PERSONA environment variable, and this
value takes precedence over the --persona flag.
`, utils.AllowedEditors),
Run: func(cmd *cobra.Command, args []string) {
Run: func(cmd *cobra.Command, _ []string) {
p, err := cmdutils.LoadPersona(cmd)
if err != nil {
ui.Fatal(fmt.Errorf("cannot instantiate persona: %w", err), genericExitCode)
Expand Down
2 changes: 1 addition & 1 deletion cmd/list.go
Original file line number Diff line number Diff line change
Expand Up @@ -32,7 +32,7 @@ func List() *cobra.Command {
Use: "list",
Short: "list personas",
Long: `List all available personas.`,
Run: func(cmd *cobra.Command, args []string) {
Run: func(_ *cobra.Command, _ []string) {
files, err := os.ReadDir(viper.GetString("personas_location"))
if err != nil {
ui.Fatal(fmt.Errorf("cannot read folder content: %w", err), noPersonaLoadedExitCode)
Expand Down
2 changes: 1 addition & 1 deletion cmd/new.go
Original file line number Diff line number Diff line change
Expand Up @@ -41,7 +41,7 @@ trigger an unknown command execution trough this command.
Allowed EDITOR values: %s
`, utils.AllowedEditors),
Args: cobra.MinimumNArgs(1),
Run: func(cmd *cobra.Command, args []string) {
Run: func(_ *cobra.Command, args []string) {
runCommand(args)
},
}
Expand Down
2 changes: 1 addition & 1 deletion cmd/root.go
Original file line number Diff line number Diff line change
Expand Up @@ -50,7 +50,7 @@ Environment variables:
- DEVID_PERSONAS_LOCATION (default $XDG_DATA_HOME/devid/personas): specify where devid will look
for persona's folders.
`,
PersistentPreRun: func(cmd *cobra.Command, args []string) {
PersistentPreRun: func(_ *cobra.Command, _ []string) {
if !verbose {
log.SetOutput(io.Discard)
}
Expand Down
2 changes: 1 addition & 1 deletion cmd/shell.go
Original file line number Diff line number Diff line change
Expand Up @@ -21,7 +21,7 @@ func Shell() *cobra.Command {
This command loads the current persona from DEVID_ACTIVE_PERSONA environment variable, and this
value takes precedence over the --persona flag.`,
Run: func(cmd *cobra.Command, args []string) {
Run: func(cmd *cobra.Command, _ []string) {
p, err := utils.LoadPersona(cmd)
if err != nil {
ui.Fatal(fmt.Errorf("cannot instantiate persona: %w", err), noPersonaLoadedExitCode)
Expand Down
2 changes: 1 addition & 1 deletion cmd/whoami.go
Original file line number Diff line number Diff line change
Expand Up @@ -39,7 +39,7 @@ If no persona is loaded print nothing and exit with code 128.
This command loads the current persona from DEVID_ACTIVE_PERSONA environment variable, and this
value takes precedence over the --persona flag.
`,
Run: func(cmd *cobra.Command, args []string) {
Run: func(cmd *cobra.Command, _ []string) {
p, err := utils.LoadPersona(cmd)
if err != nil {
ui.Fatal(fmt.Errorf("cannot instantiate persona: %w", err), noPersonaLoadedExitCode)
Expand Down
72 changes: 19 additions & 53 deletions devenv.lock
Original file line number Diff line number Diff line change
Expand Up @@ -3,11 +3,11 @@
"devenv": {
"locked": {
"dir": "src/modules",
"lastModified": 1686054274,
"narHash": "sha256-93aebyN7EMmeFFXisFIvp28UEbrozu79vd3pKPjvNR0=",
"lastModified": 1717245169,
"narHash": "sha256-+mW3rTBjGU8p1THJN0lX/Dd/8FbnF+3dB+mJuSaxewE=",
"owner": "cachix",
"repo": "devenv",
"rev": "c51a56bac8853c019241fe8d821c0a0d82422835",
"rev": "c3f9f053c077c6f88a3de5276d9178c62baa3fc3",
"type": "github"
},
"original": {
Expand All @@ -20,11 +20,11 @@
"flake-compat": {
"flake": false,
"locked": {
"lastModified": 1673956053,
"narHash": "sha256-4gtG9iQuiKITOjNQQeQIpoIB6b16fm+504Ch3sNKLd8=",
"lastModified": 1696426674,
"narHash": "sha256-kvjfFW7WAETZlt09AgDn1MrtKzP7t90Vf7vypd3OL1U=",
"owner": "edolstra",
"repo": "flake-compat",
"rev": "35bb57c0c8d8b62bbfd284272c928ceb64ddbde9",
"rev": "0f9255e01c2351cc7d116c072cb317785dd33b33",
"type": "github"
},
"original": {
Expand All @@ -33,24 +33,6 @@
"type": "github"
}
},
"flake-utils": {
"inputs": {
"systems": "systems"
},
"locked": {
"lastModified": 1685518550,
"narHash": "sha256-o2d0KcvaXzTrPRIo0kOLV0/QXHhDQ5DTi+OxcjO8xqY=",
"owner": "numtide",
"repo": "flake-utils",
"rev": "a1720a10a6cfe8234c0e93907ffe81be440f4cef",
"type": "github"
},
"original": {
"owner": "numtide",
"repo": "flake-utils",
"type": "github"
}
},
"gitignore": {
"inputs": {
"nixpkgs": [
Expand All @@ -59,11 +41,11 @@
]
},
"locked": {
"lastModified": 1660459072,
"narHash": "sha256-8DFJjXG8zqoONA1vXtgeKXy68KdJL5UaXR8NtVMUbx8=",
"lastModified": 1709087332,
"narHash": "sha256-HG2cCnktfHsKV0s4XW83gU3F57gaTljL9KNSuG6bnQs=",
"owner": "hercules-ci",
"repo": "gitignore.nix",
"rev": "a20de23b925fd8264fd7fad6454652e142fd7f73",
"rev": "637db329424fd7e46cf4185293b9cc8c88c95394",
"type": "github"
},
"original": {
Expand All @@ -74,11 +56,11 @@
},
"nixpkgs": {
"locked": {
"lastModified": 1685938391,
"narHash": "sha256-96Jw6TbWDLSopt5jqCW8w1Fc1cjQyZlhfBnJ3OZGpME=",
"lastModified": 1717399147,
"narHash": "sha256-eCWaE/q1VItpFAxxLVt171MdtDcjEnwi6QB/yuF73JU=",
"owner": "NixOS",
"repo": "nixpkgs",
"rev": "31cd1b4afbaf0b1e81272ee9c31d1ab606503aed",
"rev": "4a4ecb0ab415c9fccfb005567a215e6a9564cdf5",
"type": "github"
},
"original": {
Expand All @@ -90,36 +72,35 @@
},
"nixpkgs-stable": {
"locked": {
"lastModified": 1685801374,
"narHash": "sha256-otaSUoFEMM+LjBI1XL/xGB5ao6IwnZOXc47qhIgJe8U=",
"lastModified": 1710695816,
"narHash": "sha256-3Eh7fhEID17pv9ZxrPwCLfqXnYP006RKzSs0JptsN84=",
"owner": "NixOS",
"repo": "nixpkgs",
"rev": "c37ca420157f4abc31e26f436c1145f8951ff373",
"rev": "614b4613980a522ba49f0d194531beddbb7220d3",
"type": "github"
},
"original": {
"owner": "NixOS",
"ref": "nixos-23.05",
"ref": "nixos-23.11",
"repo": "nixpkgs",
"type": "github"
}
},
"pre-commit-hooks": {
"inputs": {
"flake-compat": "flake-compat",
"flake-utils": "flake-utils",
"gitignore": "gitignore",
"nixpkgs": [
"nixpkgs"
],
"nixpkgs-stable": "nixpkgs-stable"
},
"locked": {
"lastModified": 1686050334,
"narHash": "sha256-R0mczWjDzBpIvM3XXhO908X5e2CQqjyh/gFbwZk/7/Q=",
"lastModified": 1716213921,
"narHash": "sha256-xrsYFST8ij4QWaV6HEokCUNIZLjjLP1bYC60K8XiBVA=",
"owner": "cachix",
"repo": "pre-commit-hooks.nix",
"rev": "6881eb2ae5d8a3516e34714e7a90d9d95914c4dc",
"rev": "0e8fcc54b842ad8428c9e705cb5994eaf05c26a0",
"type": "github"
},
"original": {
Expand All @@ -134,21 +115,6 @@
"nixpkgs": "nixpkgs",
"pre-commit-hooks": "pre-commit-hooks"
}
},
"systems": {
"locked": {
"lastModified": 1681028828,
"narHash": "sha256-Vy1rq5AaRuLzOxct8nz4T6wlgyUR7zLU309k9mBC768=",
"owner": "nix-systems",
"repo": "default",
"rev": "da67096a3b9bf56a91d16901293e51ba5b49a27e",
"type": "github"
},
"original": {
"owner": "nix-systems",
"repo": "default",
"type": "github"
}
}
},
"root": "root",
Expand Down
17 changes: 1 addition & 16 deletions devenv.nix
Original file line number Diff line number Diff line change
@@ -1,10 +1,6 @@
{ pkgs, ... }:

{
# https://devenv.sh/basics/
env.GREET = "devenv";

# https://devenv.sh/packages/
packages = [
pkgs.git
pkgs.go
Expand All @@ -14,23 +10,12 @@
pkgs.silver-searcher
];

# https://devenv.sh/scripts/
scripts.hello.exec = "echo hello from $GREET";

enterShell = ''
git --version
go version
task --version
golangci-lint --version
'';

# https://devenv.sh/languages/
# languages.nix.enable = true;

# https://devenv.sh/pre-commit-hooks/
# pre-commit.hooks.shellcheck.enable = true;

# https://devenv.sh/processes/
# processes.ping.exec = "ping example.com";

# See full reference at https://devenv.sh/reference/options/
}
1 change: 1 addition & 0 deletions internal/utils/walk.go
Original file line number Diff line number Diff line change
Expand Up @@ -48,6 +48,7 @@ func Walk(source string) ([]string, error) {
if err != nil {
walkErrs = append(walkErrs, err)
}

if !info.IsDir() {
files = append(files, path)
}
Expand Down
2 changes: 1 addition & 1 deletion plugins/ssh/cmds/create-key.go
Original file line number Diff line number Diff line change
Expand Up @@ -18,7 +18,7 @@ var CreateKey = &cobra.Command{ //nolint:gochecknoglobals // required by cobra
Short: "create a SSH key",
Long: `Perform secure SSH key generation.
`,
Run: func(cmd *cobra.Command, args []string) {
Run: func(cmd *cobra.Command, _ []string) {
p, err := utils.LoadPersona(cmd)
if err != nil {
ui.Fatal(err, 1)
Expand Down
2 changes: 1 addition & 1 deletion plugins/ssh/cmds/print-pubkey.go
Original file line number Diff line number Diff line change
Expand Up @@ -15,7 +15,7 @@ var PrintPubKey = &cobra.Command{ //nolint:gochecknoglobals // required by cobra
Short: "Print public key",
Long: `Print SSH public key to be reused or copied outside of devid.
`,
Run: func(cmd *cobra.Command, args []string) {
Run: func(cmd *cobra.Command, _ []string) {
p, err := utils.LoadPersona(cmd)
if err != nil {
ui.Fatal(err, 1)
Expand Down

0 comments on commit ea948e7

Please sign in to comment.