Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

contributing: Add linting job and contributing guide #12

Merged
merged 6 commits into from
Feb 25, 2025
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
7 changes: 1 addition & 6 deletions .github/workflows/exoflow.cloud-ci.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -24,7 +24,7 @@ jobs:
build:
runs-on: ubuntu-latest
container:
image: exokomodo/exoflow-devcontainer:${{ inputs.image-tag || 'latest' }}
image: exokomodo/exoflow-devcontainer:${{ inputs.image-tag || (github.event_name == 'push' && 'latest') || (github.head_ref || github.ref_name) }}

steps:
- name: Checkout code
Expand All @@ -44,11 +44,6 @@ jobs:
run: |
npm run build

- name: Lint
working-directory: ${{ env.WORKING_DIR }}
run: |
npm run lint

- name: Generate
working-directory: ${{ env.WORKING_DIR }}
run: |
Expand Down
40 changes: 40 additions & 0 deletions .github/workflows/lint.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,40 @@
name: Lint

on:
pull_request:
branches:
- main
push:
branches:
- main
workflow_dispatch:
inputs:
image-tag:
description: Image tag to run
type: string

defaults:
run:
shell: bash

jobs:
lint:
runs-on: ubuntu-latest
container:
image: exokomodo/exoflow-devcontainer:${{ inputs.image-tag || (github.event_name == 'push' && 'latest') || (github.head_ref || github.ref_name) }}

steps:
- name: Checkout code
uses: actions/checkout@v4

- uses: actions/setup-node@v4
with:
node-version-file: .nvmrc

- name: Install dependencies
run: |
npm ci

- name: Lint
run: |
make lint
9 changes: 9 additions & 0 deletions .markdownlint.yaml
Original file line number Diff line number Diff line change
@@ -0,0 +1,9 @@
default: true
MD007:
indent: 4
MD013:
line_length: 120
MD024:
siblings_only: true
MD033: false
MD041: false
53 changes: 53 additions & 0 deletions CONTRIBUTING.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,53 @@
# Contributing Guide

Thank you for considering contributing to this project. Your help is greatly appreciated!

## Getting Started

Before you begin, please take a moment to review the [README](README.md) for an overview of the project.
Familiarize yourself with the following steps and guidelines.

## Code Contributions

- Ensure your local Git configuration (`user.name` and `user.email`) matches your GitHub profile.
- [Sign your commits](https://gist.github.com/Beneboe/3183a8a9eb53439dbee07c90b344c77e)
- Use clear, concise commit messages (under 80 characters, or under 120 character lines for body)

## Development Environment

```shell
git clone [email protected]:exokomodo/exoflow
# Local
make setup
# Docker compose (for a dev environment)
docker compose up
# devcontainer: use whatever tool you use here, including Github Codespaces
```

## Branching and Pull Requests

- Create a new branch for your changes.
- Make sure your branch is up-to-date with the `main` branch.
- Open a pull request describing your changes briefly.
- A maintainer or team member will review your changes and provide feedback.

## Communication

- [Create an issue](https://github.com/ExoKomodo/exoflow/issues/new) if you find a bug or have an enhancement suggestion.
- [Ask a question in the Discussions](https://github.com/ExoKomodo/exoflow/discussions) if you need to know something
a bit more specific or discuss a larger topic.
- If a thread evolves into something actionable, an [issue can be created from a discussion](https://github.com/orgs/community/discussions/2861#discussioncomment-696235)
- Don't feel the need to only start discussions that may become issues.

## Additional Guidelines

- Keep contributions minimal and focused.
- We do linear commit history with (generally) single commit pull requests.
- Sometimes we will accept a multi-commit PR as a linear rebase of commits.
- [This guide](https://www.bitsnbites.eu/a-tidy-linear-git-history/) explains our reasoning quite completely.
- Avoid guidelines that are overly specific to a particular technology or tool chain.
- Follow the project's existing structure and naming conventions.

## Epilogue

Thank you for your support and happy coding!
9 changes: 6 additions & 3 deletions Dockerfile
Original file line number Diff line number Diff line change
Expand Up @@ -48,10 +48,13 @@
RUN DEBIAN_FRONTEND=noninteractive apt-get update && \
apt-get install -y -qq \
apt-transport-https \
build-essential \
ca-certificates \
curl \
git \
gnupg-agent \
llvm \
make \
software-properties-common \
sudo \
zsh \
Expand All @@ -65,9 +68,6 @@

COPY --from=go-builder /usr/local/go /usr/local/go

ENV PATH=/usr/local/go/bin:$PATH
ENV PIP_ROOT_USER_ACTION=ignore

SHELL ["/usr/bin/zsh", "-o", "pipefail", "-c"]

# Install NVM
Expand All @@ -80,4 +80,7 @@

COPY --from=install / /

ENV PATH=/usr/local/go/bin:$PATH
ENV PIP_ROOT_USER_ACTION=ignore

CMD /usr/bin/zsh

Check warning on line 86 in Dockerfile

View workflow job for this annotation

GitHub Actions / devcontainer

JSON arguments recommended for ENTRYPOINT/CMD to prevent unintended behavior related to OS signals

JSONArgsRecommended: JSON arguments recommended for CMD to prevent unintended behavior related to OS signals More info: https://docs.docker.com/go/dockerfile/rule/json-args-recommended/
8 changes: 6 additions & 2 deletions Makefile
Original file line number Diff line number Diff line change
Expand Up @@ -4,13 +4,17 @@ SHELL := /bin/bash
.ONESHELL:

.PHONY: setup
setup: ## [all] Setup project
setup: ## [all] Setup
@$(MAKE) setup/infra

.PHONY: setup/infra
setup/infra: ## [infra] Setup project
setup/infra: ## [infra] Setup
@$(MAKE) -C infra setup

.PHONY: lint
lint: ## [all] Lint
@npm run lint

.PHONY: help
help: ## Displays help info
@awk 'BEGIN {FS = ":.*##"; printf "\nUsage:\n make \033[36m\033[0m\n"} /^[a-zA-Z_-]+:.*?##/ { printf " \033[36m%-15s\033[0m %s\n", $$1, $$2 } /^##@/ { printf "\n\033[1m%s\033[0m\n", substr($$0, 5) } ' $(MAKEFILE_LIST)
8 changes: 0 additions & 8 deletions apps/exoflow.cloud/.markdownlint.json

This file was deleted.

1 change: 1 addition & 0 deletions apps/exoflow.cloud/.markdownlint.yaml
Loading
Loading