forked from fsnotify/fsnotify
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
DA-992: Pair windows' delete + create event to generate a rename event (
#1) * made the changes related to recursive directory check * made changes in window.go for buffer size * added the oldname attribute * old name added to rename event, one event is generated for rename * added oldname in printing rename events * tests for checking the oldName attr for rename added * create fsnotify event added * input to create event changed * create fsnotify event function modified * ID added * logs added * added create fsnotify event in inotify * logs added * prints added * reviews * reviews addressed * Hangkun/da 992/window rename event (#2) * Let's begin * Add getpath * Init test workflow * 1.40.0 exits? * Linter fix * asdf * 100 Co-authored-by: hu13 <hangkun@preveil.com> * Clean up unused * Badge Co-authored-by: Hangkun Ung <hangkun.ung@gmail.com> Co-authored-by: hu13 <hangkun@preveil.com>
- Loading branch information
1 parent
57f1a48
commit 580c3c9
Showing
9 changed files
with
412 additions
and
67 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1 +1,2 @@ | ||
go.sum linguist-generated | ||
*.go text eol=lf |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,47 @@ | ||
name: CI | ||
on: | ||
push: | ||
branches: | ||
- preveil | ||
pull_request: | ||
|
||
jobs: | ||
|
||
test: | ||
name: Unit tests | ||
|
||
runs-on: windows-latest | ||
|
||
steps: | ||
- name: Set up Go 1.13 | ||
uses: actions/setup-go@v2 | ||
with: | ||
go-version: 1.13 | ||
|
||
- name: Check out code into the Go module directory | ||
if: github.event_name == 'push' | ||
uses: actions/checkout@v2 | ||
|
||
- name: Checkout pr's head commit | ||
if: github.event_name == 'pull_request' | ||
uses: actions/checkout@v2 | ||
with: | ||
# on pull_request, we don't want to build on | ||
# the merged commit | ||
ref: ${{ github.event.pull_request.head.sha }} | ||
|
||
- name: Run unit tests | ||
run: make test | ||
|
||
golangci: | ||
name: Linter | ||
runs-on: windows-latest | ||
steps: | ||
- uses: actions/checkout@v2 | ||
- name: golangci-lint | ||
uses: golangci/golangci-lint-action@v2 | ||
with: | ||
# Optional: version of golangci-lint to use in form of v1.2 or v1.2.3 or `latest` to use the latest version | ||
version: v1.40.0 | ||
|
||
args: --config golangci.yml ./... |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,57 @@ | ||
define USAGE | ||
USAGE: | ||
> make [ | ||
test: run all unit tests | ||
test-unit: run all unit tests | ||
lint: run golangci-linter | ||
|
||
clean: clean test cache and other deps | ||
|
||
help: print this help message | ||
] | ||
endef | ||
export USAGE | ||
|
||
SHELL := /bin/bash | ||
|
||
BIN := $(PWD)/bin | ||
GO := go | ||
GOTEST := $(BIN)/gotest | ||
LINT := $(BIN)/golangci-lint | ||
|
||
export PATH := $(PATH):$(BIN) | ||
|
||
help: | ||
@echo "$$USAGE" | ||
|
||
usage: | ||
@echo "$$USAGE" | ||
|
||
sense: | ||
@echo "$$USAGE" | ||
|
||
install-dep-tools: | ||
GOBIN=$(BIN) $(GO) get -u github.com/rakyll/gotest | ||
@make install-golangci-lint | ||
|
||
install-golangci-lint: | ||
# binary will be $(BIN) | ||
curl -sSfL https://raw.githubusercontent.com/golangci/golangci-lint/master/install.sh | sh -s -- -b $(BIN) v1.40.0 | ||
|
||
test: test-unit | ||
|
||
test-unit: install-dep-tools testclean | ||
$(GOTEST) ./... -v -race | ||
|
||
testclean: | ||
$(GO) clean -testcache || true | ||
|
||
clean: testclean | ||
rm -rf $(BIN)/* | ||
$(GO) clean -cache | ||
$(GO) clean -modcache | ||
|
||
lint: install-dep-tools | ||
$(LINT) run --config golangci.yml ./... | ||
|
||
ci: test lint |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,23 @@ | ||
run: | ||
deadline: 2m | ||
|
||
# all available settings of specific linters | ||
linters-settings: | ||
nolintlint: | ||
# Enable to require an explanation of nonzero length after each nolint directive. Default is false. | ||
require-explanation: true | ||
|
||
linters: | ||
disable-all: true | ||
enable: | ||
- gofmt | ||
- goimports | ||
- gosimple | ||
- ineffassign | ||
- misspell | ||
- govet | ||
- nolintlint | ||
- whitespace | ||
- dupl | ||
- rowserrcheck | ||
- unparam |
Oops, something went wrong.