From 51369733cef5effcb54dde651f8cf49e56ea75b5 Mon Sep 17 00:00:00 2001 From: kha7iq Date: Tue, 13 Apr 2021 22:04:51 +0800 Subject: [PATCH] chor: gitignore & makefile: --- .gitignore | 102 +++++++++++++++++++++++++++++++++++++++++++++++++++++ Makefile | 40 +++++++++++++++++++++ 2 files changed, 142 insertions(+) create mode 100644 .gitignore create mode 100644 Makefile diff --git a/.gitignore b/.gitignore new file mode 100644 index 0000000..2c83c59 --- /dev/null +++ b/.gitignore @@ -0,0 +1,102 @@ +# ---> macOS +# General +.DS_Store +.AppleDouble +.LSOverride + +# Icon must end with two \r +Icon +temp +# Thumbnails +._* + +# Files that might appear in the root of a volume +.DocumentRevisions-V100 +.fseventsd +.Spotlight-V100 +.TemporaryItems +.Trashes +.VolumeIcon.icns +.com.apple.timemachine.donotpresent +dist +# Directories potentially created on remote AFP share +.AppleDB +.AppleDesktop +Network Trash Folder +Temporary Items +.apdisk + +# ---> JetBrains +# Covers JetBrains IDEs: IntelliJ, RubyMine, PhpStorm, AppCode, PyCharm, CLion, Android Studio, WebStorm and Rider +# Reference: https://intellij-support.jetbrains.com/hc/en-us/articles/206544839 + +# User-specific stuff +.idea +.idea/**/workspace.xml +.idea/**/tasks.xml +.idea/**/usage.statistics.xml +.idea/**/dictionaries +.idea/**/shelf + +# Generated files +.idea/**/contentModel.xml + +# Sensitive or high-churn files +.idea/**/dataSources/ +.idea/**/dataSources.ids +.idea/**/dataSources.local.xml +.idea/**/sqlDataSources.xml +.idea/**/dynamic.xml +.idea/**/uiDesigner.xml +.idea/**/dbnavigator.xml + +# Gradle +.idea/**/gradle.xml +.idea/**/libraries + +# Gradle and Maven with auto-import +# When using Gradle or Maven with auto-import, you should exclude module files, +# since they will be recreated, and may cause churn. Uncomment if using +# auto-import. +# .idea/artifacts +# .idea/compiler.xml +# .idea/jarRepositories.xml +# .idea/modules.xml +# .idea/*.iml +# .idea/modules +# *.iml +# *.ipr + +# CMake +cmake-build-*/ + +# Mongo Explorer plugin +.idea/**/mongoSettings.xml + +# File-based project format +*.iws + +# IntelliJ +out/ + +# mpeltonen/sbt-idea plugin +.idea_modules/ + +# JIRA plugin +atlassian-ide-plugin.xml + +# Cursive Clojure plugin +.idea/replstate.xml + +# Crashlytics plugin (for Android Studio and IntelliJ) +com_crashlytics_export_strings.xml +crashlytics.properties +crashlytics-build.properties +fabric.properties + +# Editor-based Rest Client +.idea/httpRequests + +# Android studio 3.1+ serialized cache file +.idea/caches/build_file_checksums.ser + diff --git a/Makefile b/Makefile new file mode 100644 index 0000000..6028a13 --- /dev/null +++ b/Makefile @@ -0,0 +1,40 @@ +export GO111MODULE := on +export GOPROXY = https://proxy.golang.org,direct + +############################################################################### +# DEPENDENCIES +############################################################################### + +# Install all the build and lint dependencies +setup: + go mod download + go generate -v ./... + go mod tidy +.PHONY: setup + +############################################################################### +# TESTS +############################################################################### + +# Run all the tests +test: + go test -failfast -race -timeout=5m ./... +.PHONY: test + +############################################################################### +# CODE HEALTH +############################################################################### + +# gofumports and gci all go files +fmt: + find . -name '*.go' -not -wholename './vendor/*' | while read -r file; do gofumports -w "$$file"; done + gci -w -local github.com/kha7iq/pingme . +.PHONY: fmt + +# Run all the linters +lint: + golangci-lint run ./... +.PHONY: lint + +ci: test lint +.PHONY: ci