worldline-go / guide

Code Style Guide

Geek Repo:Geek Repo

Github PK Tool:Github PK Tool

Guide

This repository contains code style guides and continuous integration workflows.

It is a living document, and will be updated as we learn more about what works and what doesn't.


Table of Contents
Go - style guide
Lint - customized linter
Hooks - git hooks
CI - reference
Build - script/makefile
Badge

Lint

File Description
.golangci.yml Linting configuration for golangci-lint

Hooks

git hooks for pre-commit.

File Description
hooks/pre-commit Pre-commit hook for golangci-lint

CI

ci directory contains the workflows for testing, linting, building and deploy the code.

Workflow Description
ci/github-lib Build, lint and test (SonarCloud)

Copy the workflow you want to use into your repository:

cp -a ci/github-lib/. <myrepo>/.github

SONAR_TOKEN is required in most workflows.
Token already exists in the our organization secrets.

SonarCloud not supported direct initialize a new repo.
First init repo in SonarCloud after that go to the administation -> Analysis Method -> Disable automatic analysis. And just restart the failed workflow.

Build

build directory contains the building scripts. Change project variables in build file.

File Description
build/Makefile Build script for Go projects
build/.goreleaser.yaml Goreleaser script

About

Code Style Guide

License:Apache License 2.0


Languages

Language:Makefile 84.8%Language:Shell 15.2%