Skip to content
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
47 changes: 32 additions & 15 deletions .github/workflows/deploy.yml
Original file line number Diff line number Diff line change
@@ -1,32 +1,49 @@
name: Deploy Documentation
on:
push:
branches:
- main # Set the branch you want to trigger the deployment
branches: [main]
pull_request:
branches: [main]

jobs:
deploy:
build:
runs-on: ubuntu-latest
steps:
- name: Checkout Repository
uses: actions/checkout@v5

with:
persist-credentials: false

- name: Set up Python
uses: actions/setup-python@v4
with:
python-version: '3.x'

- name: Install Dependencies
run: |
python -m pip install --upgrade pip
pip install nox
nox -s docs
run: pipx run nox -s docs

- name: Upload docs build as artifact
uses: actions/upload-pages-artifact@v4
with:
name: ${{ github.event.repository.name }}_docs
path: ${{ github.workspace }}/site

deploy:
if: github.ref == 'refs/heads/main'
runs-on: ubuntu-latest
needs: [build]
permissions:
# to deploy to Pages
pages: write
# to verify the deployment originates from an appropriate source
id-token: write
# Deploy to the github-pages environment
environment:
name: github-pages
url: ${{ steps.deployment.outputs.page_url }}
steps:
- name: Deploy to GitHub Pages
uses: peaceiris/actions-gh-pages@v4
id: deployment
uses: actions/deploy-pages@v4
with:
github_token: ${{ secrets.GITHUB_TOKEN }}
publish_dir: ./site
user_name: 'github-actions[bot]'
user_email: 'github-actions[bot]@users.noreply.github.com'
commit_message: 'Deploy documentation'
artifact_name: ${{ github.event.repository.name }}_docs
26 changes: 11 additions & 15 deletions docs/getting-started.md
Original file line number Diff line number Diff line change
Expand Up @@ -4,11 +4,13 @@ Welcome to cpp-linter! This guide will help you integrate C/C++ linting into you

## Choose Your Integration

<!-- markdownlint-disable MD033 -->

Select the method that best fits your development workflow:

<div class="grid cards" markdown>

- :material-github: **GitHub Actions**
- :material-github: **GitHub Actions**

---

Expand All @@ -18,8 +20,7 @@ Select the method that best fits your development workflow:

[Get started with GitHub Actions →](https://cpp-linter.github.io/cpp-linter-action/){ .md-button .md-button--primary }


- :material-git: **Pre-commit Hooks**
- :material-git: **Pre-commit Hooks**

---

Expand All @@ -28,9 +29,8 @@ Select the method that best fits your development workflow:
**Perfect for:** Catching issues before commits, local enforcement

[Get started with pre-commit →](https://github.com/cpp-linter/cpp-linter-hooks){ .md-button .md-button--primary }


- :fontawesome-brands-python: **Command Line**
- :fontawesome-brands-python: **Command Line**

---

Expand All @@ -40,7 +40,7 @@ Select the method that best fits your development workflow:

[Get started with cpp-linter package →](https://cpp-linter.github.io/cpp-linter/){ .md-button .md-button--primary }

- :simple-rust: **Command Line (Rust)**
- :simple-rust: **Command Line (Rust)**

---

Expand All @@ -56,25 +56,23 @@ Select the method that best fits your development workflow:

<div class="grid cards" markdown>

- :fontawesome-brands-github: **clang-tools-static-binaries**
- :fontawesome-brands-github: **clang-tools-static-binaries**

---

Distribution clang tools static binaries for various platforms

[Download from →](https://github.com/cpp-linter/clang-tools-static-binaries){ .md-button .md-button--primary }


- :fontawesome-brands-docker: **clang-tools-docker**
- :fontawesome-brands-docker: **clang-tools-docker**

---

Distribution clang tools Docker images for various platforms

[Download from →](https://github.com/cpp-linter/clang-tools-docker){ .md-button .md-button--primary }


- :fontawesome-brands-python: **clang-tools-wheels**
- :fontawesome-brands-python: **clang-tools-wheels**

---

Expand All @@ -84,21 +82,19 @@ Select the method that best fits your development workflow:

</div>



## Easy Installation

<div class="grid cards" markdown>

- :fontawesome-brands-python: **clang-tools-pip**
- :fontawesome-brands-python: **clang-tools-pip**

---

Easy installation of clang tools static binaries via pip

[Get started with clang-tools CLI →](https://cpp-linter.github.io/clang-tools-pip/){ .md-button .md-button--primary }

- :fontawesome-brands-python: **clang-tools-asdf**
- :fontawesome-brands-python: **clang-tools-asdf**

---

Expand Down
32 changes: 16 additions & 16 deletions docs/index.md
Original file line number Diff line number Diff line change
Expand Up @@ -2,39 +2,31 @@
hide:
- navigation
- toc
template: home.html
title: C/C++ Linting
---

<div class="hero" markdown>
<!-- markdownlint-disable MD041 MD033 MD036 MD025 -->

# C/C++ linting that simply works

**Lint your C/C++ code in workflow** - automated, configurable, and reliable. Integrate seamlessly into any workflow in minutes.

[Get started :material-rocket-launch:](getting-started.md){ .md-button .md-button--primary }

</div>

<div class="grid cards" markdown>

</div>
# C/C++ Linting

## Everything you need for linting C/C++ code

<div class="grid cards" markdown>

- :material-chart-line: **Built in Open Source**
- :material-chart-line: **Built in Open Source**

---

Open-source and MIT-licensed. Bringing contributors together to empower impactful C/C++ lint projects in open source and beyond.

- :material-cog: **Zero Configuration**
- :material-cog: **Zero Configuration**

---

Works out of the box with sensible defaults. Advanced users can customize every aspect to match their coding standards.

- :material-devices: **Works Everywhere**
- :material-devices: **Works Everywhere**

---

Expand Down Expand Up @@ -138,7 +130,15 @@ hide:
- id: clang-format
args: [--style=Google] # Other coding style: LLVM, GNU, Chromium, Microsoft, Mozilla, WebKit.
- id: clang-tidy
args: [--checks='boost-*,bugprone-*,performance-*,readability-*,portability-*,modernize-*,clang-analyzer-*,cppcoreguidelines-*']
args:
Copy link
Contributor

@shenxianpeng shenxianpeng Sep 29, 2025

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

The yaml format seems incorrect if users just copy and use it. Maybe id and args need to be aligned

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

According to YAML specs

list-name: [item]
# is equivalent to
list-name:
  - item

I hadn't noticed the misaligned indent. That should be uniformed.

- --checks='boost-*
- bugprone-*
- performance-*
- readability-*
- portability-*
- modernize-*
- clang-analyzer-*
- cppcoreguidelines-*'
```

=== "Command Line"
Expand Down
20 changes: 20 additions & 0 deletions docs/overrides/home.html
Original file line number Diff line number Diff line change
@@ -0,0 +1,20 @@
{% extends "main.html" %}

{% block hero %}
<div class="hero">
<h1 id="cc-linting-that-simply-works">C/C++ linting that simply works</h1>
<p>
<strong>Lint your C/C++ code in your development workflow</strong>
- automated, configurable, and reliable.
Integrate seamlessly into any development workflow in minutes.
</p>
<p>
<a class="md-button md-button--primary" href="getting-started/">
Get started
<span class="twemoji">
<svg xmlns="http://www.w3.org/2000/svg" viewBox="0 0 24 24"><path d="m13.13 22.19-1.63-3.83c1.57-.58 3.04-1.36 4.4-2.27zM5.64 12.5l-3.83-1.63 6.1-2.77C7 9.46 6.22 10.93 5.64 12.5M21.61 2.39S16.66.269 11 5.93c-2.19 2.19-3.5 4.6-4.35 6.71-.28.75-.09 1.57.46 2.13l2.13 2.12c.55.56 1.37.74 2.12.46A19.1 19.1 0 0 0 18.07 13c5.66-5.66 3.54-10.61 3.54-10.61m-7.07 7.07c-.78-.78-.78-2.05 0-2.83s2.05-.78 2.83 0c.77.78.78 2.05 0 2.83s-2.05.78-2.83 0m-5.66 7.07-1.41-1.41zM6.24 22l3.64-3.64c-.34-.09-.67-.24-.97-.45L4.83 22zM2 22h1.41l4.77-4.76-1.42-1.41L2 20.59zm0-2.83 4.09-4.08c-.21-.3-.36-.62-.45-.97L2 17.76z"></path></svg>
</span>
</a>
</p>
</div>
{% endblock %}
55 changes: 35 additions & 20 deletions docs/stylesheets/extra.css
Original file line number Diff line number Diff line change
Expand Up @@ -2,34 +2,62 @@ th {
background-color: var(--md-default-fg-color--lightest);
}

:root > * {
--cpp-linter-logo-color-green: #40b385;
--cpp-linter-logo-color-yellow: #ffc20a;
}

/* Hero section styling */
.hero {
text-align: center;
padding: 4rem 0;
background: linear-gradient(135deg, var(--md-primary-fg-color) 0%, var(--md-accent-fg-color) 100%);
background-size: 200% 200%;
animation: gradientShift 8s ease infinite;
color: white;
margin: -1.5rem -1.5rem 3rem -1.5rem;
border-radius: 0 0 1rem 1rem;
background: var(--md-primary-fg-color);
color: var(--md-primary-bg-color);
}

.hero h1 {
font-size: 3rem;
font-weight: 700;
margin-bottom: 1rem;
text-shadow: 0 2px 4px rgba(0,0,0,0.3);
text-align: center;
color: unset;
}

.hero p {
font-size: 1.2rem;
margin-bottom: 2rem;
opacity: 0.9;
max-width: 600px;
width: 65%;
margin-left: auto;
margin-right: auto;
}

.hero .twemoji {
--md-icon-size: 1.125em;
display: inline-flex;
height: var(--md-icon-size);
vertical-align: text-top;
}

.hero .md-button {
background: var(--cpp-linter-logo-color-green);
color: black;
border: none;
border-radius: unset;
display: inline-block;
}

.hero .md-button:hover {
background: var(--cpp-linter-logo-color-yellow);
color: black;
border: none;
}

.md-typeset .md-button:hover {
color: black;
}

@keyframes gradientShift {
0% { background-position: 0% 50%; }
50% { background-position: 100% 50%; }
Expand Down Expand Up @@ -184,19 +212,6 @@ th {
}
}

.md-header {
background-color: #4051b5;
}

/* Make navigation tabs match header color */
.md-tabs {
background-color: #4051b5;
}

.md-tabs__list {
background-color: #4051b5;
}

/* Ensure tab items have proper contrast */
.md-tabs__item {
background-color: transparent;
Expand Down
10 changes: 7 additions & 3 deletions mkdocs.yml
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,7 @@ site_name: "cpp-linter"
site_description: "Documentation for the cpp-linter organization."
site_url: "https://cpp-linter.github.io/"
repo_url: https://github.com/cpp-linter

repo_name: "cpp-linter"
copyright: "© 2021-2025, cpp-linter"

nav:
Expand All @@ -11,11 +11,15 @@ nav:
- Discussion: discussion.md
# - Blog:
# - blog/index.md
exclude_docs: |
blog/**

theme:
name: material
custom_dir: docs/overrides
features:
- navigation.tabs
- navigation.tabs.sticky
- toc.integrate
- navigation.top
- navigation.sections
Expand All @@ -35,7 +39,7 @@ theme:
# Palette toggle for light mode
- media: "(prefers-color-scheme: light)"
scheme: default
primary: blue
primary: indigo
accent: cyan
toggle:
icon: material/lightbulb-outline
Expand All @@ -44,7 +48,7 @@ theme:
# Palette toggle for dark mode
- media: "(prefers-color-scheme: dark)"
scheme: slate
primary: blue
primary: indigo
accent: cyan
toggle:
icon: material/lightbulb
Expand Down