Skip to content

Commit 030a522

Browse files
authored
fix: lint changes vs the default branch only (#902)
1 parent 8acc37d commit 030a522

File tree

3 files changed

+9
-12
lines changed

3 files changed

+9
-12
lines changed

.github/workflows/repo-hygiene.yaml

Lines changed: 4 additions & 10 deletions
Original file line numberDiff line numberDiff line change
@@ -3,7 +3,7 @@ on:
33
workflow_dispatch:
44
push:
55
branches:
6-
- main
6+
- master
77
pull_request:
88
schedule:
99
# run once a day at midnight
@@ -18,17 +18,11 @@ jobs:
1818
runs-on: ${{ matrix.os }}
1919
steps:
2020
- uses: actions/checkout@v2
21+
with:
22+
fetch-depth: 0
2123
- name: golangci-lint
2224
uses: golangci/golangci-lint-action@v2
2325
with:
24-
# Required: the version of golangci-lint is required and must be specified without patch version: we always use the latest patch version.
2526
version: v1.40
26-
# Optional: working directory, useful for monorepos
27-
# working-directory: somedir
28-
29-
# Optional: golangci-lint command line arguments.
30-
# args: --issues-exit-code=0
31-
args: --timeout=5m
32-
33-
# Optional: show only new issues if it's a pull request. The default value is `false`.
27+
args: --timeout=5m
3428
only-new-issues: true

Makefile

Lines changed: 4 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -470,7 +470,10 @@ PRETTYGOTEST := $(shell command -v gotest 2> /dev/null)
470470

471471
LINT_PKG ?= .
472472

473-
lint: $(GOLANGCI_LINT) ## Fast lint
473+
lint: $(GOLANGCI_LINT) ## Fast lint vs default branch showing only new issues
474+
$(GOLANGCI_LINT) run --new-from-rev=master -v $(LINT_PKG)/...
475+
476+
lint-old: $(GOLANGCI_LINT) ## Fast lint including previous issues
474477
$(GOLANGCI_LINT) run -v $(LINT_PKG)/...
475478

476479
# run all tests

README.md

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
# Microsoft Azure Container Networking
22

3-
[![Build Status](https://msazure.visualstudio.com/One/_apis/build/status/Custom/Networking/ContainerNetworking/Azure.azure-container-networking?branchName=master)](https://msazure.visualstudio.com/One/_build/latest?definitionId=95007&branchName=master) [![Go Report Card](https://goreportcard.com/badge/github.com/Azure/azure-container-networking)](https://goreportcard.com/report/github.com/Azure/azure-container-networking) ![GitHub release](https://img.shields.io/github/release/Azure/azure-container-networking.svg)
3+
[![Build Status](https://msazure.visualstudio.com/One/_apis/build/status/Custom/Networking/ContainerNetworking/Azure.azure-container-networking?branchName=master)](https://msazure.visualstudio.com/One/_build/latest?definitionId=95007&branchName=master) [![Go Report Card](https://goreportcard.com/badge/github.com/Azure/azure-container-networking)](https://goreportcard.com/report/github.com/Azure/azure-container-networking) [![golangci-lint](https://github.com/Azure/azure-container-networking/actions/workflows/repo-hygiene.yaml/badge.svg?event=schedule)](https://github.com/Azure/azure-container-networking/actions/workflows/repo-hygiene.yaml) ![GitHub release](https://img.shields.io/github/release/Azure/azure-container-networking.svg)
44

55
| Azure Network Policy Manager Conformance | |
66
| ----------- | ----------- |

0 commit comments

Comments
 (0)