Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Update golangci-lint #28

Merged
merged 3 commits into from
May 25, 2024
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
2 changes: 1 addition & 1 deletion .github/workflows/build.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -41,7 +41,7 @@ jobs:
if: matrix.os != 'windows-latest'
uses: golangci/golangci-lint-action@v6
with:
version: v1.55.2
version: v1.58.2

- name: Set up gotestfmt
run: go install github.com/gotesttools/gotestfmt/v2/cmd/gotestfmt@latest
Expand Down
2 changes: 1 addition & 1 deletion .golangci.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -56,7 +56,7 @@ linters:
- gocognit # Computes and checks the cognitive complexity of functions
- goconst # Finds repeated strings that could be replaced by a constant
- gocritic # The most opinionated Go source code linter
- goerr113 # Golang linter to check the errors handling expressions
- err113 # Golang linter to check the errors handling expressions
- gofmt # Gofmt checks whether code was gofmt-ed. By default this tool runs with -s option to check for code simplification
- gofumpt # Gofumpt checks whether code was gofumpt-ed.
- goheader # Checks is file header matches to pattern
Expand Down
40 changes: 23 additions & 17 deletions flake.nix
Original file line number Diff line number Diff line change
Expand Up @@ -5,39 +5,45 @@
flake-utils.url = "github:numtide/flake-utils";
nixpkgs.url = "github:NixOS/nixpkgs/nixos-unstable";
};
outputs = {
self,
nixpkgs,
flake-utils,
}:
flake-utils.lib.eachDefaultSystem
(
system: let
outputs =
{
self,
nixpkgs,
flake-utils,
}:
flake-utils.lib.eachDefaultSystem (
system:
let
pkgs = nixpkgs.legacyPackages.${system};
frameworks = pkgs.darwin.apple_sdk.frameworks;
in {
in
{
devShell = pkgs.mkShell {
buildInputs = with pkgs;
buildInputs =
with pkgs;
[
pkg-config
clang
golangci-lint
reuse
go
]
++ lib.optionals pkgs.stdenv.isLinux [
pcsclite
pcsctools
]
++ lib.optionals pkgs.stdenv.isDarwin [
frameworks.PCSC
];
++ lib.optionals pkgs.stdenv.isDarwin [ frameworks.PCSC ];

shellHook = if pkgs.stdenv.isDarwin then ''
export CGO_LDFLAGS="-F${frameworks.PCSC}/Library/Frameworks";
'' else "";
shellHook =
if pkgs.stdenv.isDarwin then
''
export CGO_LDFLAGS="-F${frameworks.PCSC}/Library/Frameworks";
''
else
"";
};

formatter = nixpkgs.alejandra;
formatter = nixpkgs.nixfmt-rfc-style;
}
);
}
Loading