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

Lint markdown files on CI #275

Merged
merged 3 commits into from
Jan 23, 2024
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: 7 additions & 0 deletions .github/workflows/code-quality.yml
Original file line number Diff line number Diff line change
Expand Up @@ -33,5 +33,12 @@ jobs:
with:
version: v1.54.2

- name: Lint Markdown docs
- uses: DavidAnson/markdownlint-cli2-action@v15
with:
globs: |
*.md
docs/*.md

- name: Check auto generated files
run: make check-generate
2 changes: 2 additions & 0 deletions .markdownlint.yaml
Original file line number Diff line number Diff line change
@@ -0,0 +1,2 @@
# Global configuration for markdownlint
MD013: false
1 change: 0 additions & 1 deletion CHANGELOG.md
Original file line number Diff line number Diff line change
@@ -1,4 +1,3 @@
<!-- markdownlint-disable MD013 -->
<!-- markdownlint-disable MD024 -->
# Changelog

Expand Down
2 changes: 2 additions & 0 deletions CODE_OF_CONDUCT.md
Original file line number Diff line number Diff line change
@@ -1,3 +1,4 @@
<!-- markdownlint-disable -->
# Contributor Covenant Code of Conduct

## Our Pledge
Expand Down Expand Up @@ -74,3 +75,4 @@ available at https://www.contributor-covenant.org/version/1/4/code-of-conduct.ht

For answers to common questions about this code of conduct, see
https://www.contributor-covenant.org/faq
<!-- markdownlint-enable -->
2 changes: 2 additions & 0 deletions CONTRIBUTING.md
Original file line number Diff line number Diff line change
@@ -1,3 +1,4 @@
<!-- markdownlint-disable -->
# Contributing to Cartesi

Thank you for your interest in Cartesi!
Expand Down Expand Up @@ -165,3 +166,4 @@ We are happy to automate this for you via DocuSign upon request in the Google Fo

When contributing in a deeper manner to this repository, please first discuss the change you wish to make via our
[Discord channel here](https://discord.gg/Pt2NrnS), or contact us at [email protected] email before working on the change.
<!-- markdownlint-enable -->
8 changes: 7 additions & 1 deletion Makefile
Original file line number Diff line number Diff line change
Expand Up @@ -15,6 +15,12 @@ lint: ## Run the linter
@echo "Running the linter"
@golangci-lint run

.PHONY: md-lint
md-lint: ## Lint Markdown docs. Each dir has its own .markdownlint.yaml.
@echo "Running markdownlint-cli"
@docker run -v $$PWD:/workdir ghcr.io/igorshubovych/markdownlint-cli:latest "*.md"
@docker run -v $$PWD/docs:/workdir ghcr.io/igorshubovych/markdownlint-cli:latest "*.md"

.PHONY: generate
generate: ## Generate the file that are commited to the repo
@echo "Generating Go files"
Expand All @@ -27,7 +33,7 @@ graphql-schema: ## Generate the graphql schema file
@mv offchain/schema.graphql api/graphql/reader.graphql

.PHONY: check-generate
check-generate: generate graphql-schema ## Check whether the generated files are in sync
check-generate: generate graphql-schema ## Check whether the generated files are in sync
@echo "Checking differences on the repository..."
@if git diff --exit-code; then \
echo "No differences found."; \
Expand Down
1 change: 0 additions & 1 deletion README.md
Original file line number Diff line number Diff line change
@@ -1,4 +1,3 @@
<!-- markdownlint-disable MD013 -->
# Cartesi Node Reference Implementation

The [Cartesi Node](https://docs.cartesi.io/cartesi-rollups/main-concepts/#cartesi-nodes) is the part of the [Cartesi Rollups Framework](https://docs.cartesi.io/cartesi-rollups/overview/) that is responsible for handling the communication between the on-chain smart contracts and the [Cartesi Machine](https://docs.cartesi.io/machine/intro/).
Expand Down
7 changes: 7 additions & 0 deletions docs/.markdownlint.yaml
Original file line number Diff line number Diff line change
@@ -0,0 +1,7 @@
# Configuration related to docs generated automatically
# by https://pkg.go.dev/github.com/spf13/cobra/doc.
MD010: false
MD012: false
MD013: false
MD040: false
MD041: false
Loading