Skip to content

Code Standards

Antoine edited this page Jan 24, 2025 · 6 revisions

Section about that aims to unify coding style and more "non-functional" aspects of everyone's coding style to have a more cohesive development.

Aspects include but not limited to: code quality, style, consistency, maintainability, readability, best practices and paradigms, avoid common semantic or even logical development pitfalls, ease of reviews, code artifacts / package organization, ease and consistency of tests, library/api specific conventions/standards/protocols, etc...

Ideally, most members would use the same or equivalent of these (especially amongst frontend and backend respectively) code standards tools so that project development and version control is "naturally coherent"

1. Linter(s)

We use golangci-lint to run multiple linters for our Go code. The linters enabled in our .golangci.yml file include at the very least:
govet errcheck staticcheck gosimple unused ineffassign gofmt goimports For JavaScript and TypeScript code, we use ESLint to ensure code quality and consistency.

2. Formatter(s)

For Go code, we use gofmt and goimports to format our code according to Go standards.
For JavaScript and TypeScript code, we use Prettier to format our code.

3. Git Hooks and Workflows to enforce style/standards

image

We use GitHub Actions to enforce code style and standards through continuous integration workflows. The workflows are defined in .github/workflows/ci.yaml and .github/workflows/go-ci.yaml.
JavaScript/TypeScript Workflow:
Runs ESLint to check for linting issues. Runs tests using npm run ci:test. Go Workflow:
Runs golangci-lint to check for linting issues. Runs go fmt to format the code. Runs go vet to examine the code for potential issues.

4. Static Analysis tools

[...]

4.5. Code (Security) Scanners

We use staticcheck as part of golangci-lint for static analysis of Go code, which includes security checks. For JavaScript and TypeScript, we rely on ESLint plugins to identify potential security issues.

5. Containers, Version Control, Dependency: General process

6. Code Refactoring & Review: General process

7. Integrated AI Dev tools (Optional, but helps productivity)

  • Cursor: Fork of VScode
  • AI code assistant e.g. Copilot
  • Various LLMs e.g. Claude, ChatGPT, LLama3/Llama mini local..
  • Models that could be used as preliminary Webpage / App template generator e.g. Soloist App

Clone this wiki locally