Skip to content

Commit 85739d3

Browse files
authored
docs: use the action's feature names on the home page (#70)
The home page section "Results show up on the pull request" named the reports its own way ("Suggestions you can commit", "Notes in the diff", "One summary comment", "Fixes pushed for you"). Readers who then open cpp-linter-action find different names there, so the cards now use the action README's headings, each with the input that turns it on, in the same order as the organization profile banner (cpp-linter/.github#112): - Annotations `file-annotations` - Thread Comment `thread-comments` - Step Summary `step-summary`, new: the same report in the job summary, which also works on forks and in private repositories, where thread comments are turned off - Pull Request Review `tidy-review`, new card: clang-tidy diagnostics with suggested changes - Pull Request Review `format-review` - Auto-fix `auto-fix` Six cards fill the two-column grid in three rows. The section intro and the cpp-linter-action tool card ("thread comments or pull request reviews") use the same words. A new rule sets the input chip beside each title to 13px; it inherited 8.5px from the header. Checked with `mkdocs serve` at 1280px and 375px wide: three even rows on desktop, one column on phones, no horizontal scroll. The step summary and review wording follows `action.yml` (`step-summary` reuses the thread comment's content; thread comments are disabled on private repositories).
1 parent 60d085f commit 85739d3

2 files changed

Lines changed: 62 additions & 17 deletions

File tree

‎docs/overrides/home.html‎

Lines changed: 57 additions & 17 deletions
Original file line numberDiff line numberDiff line change
@@ -147,7 +147,7 @@ <h1 class="cl-hero__title">
147147
{% set tools = [
148148
{
149149
"title": "On every pull request", "name": "cpp-linter-action", "icon": "octicons/git-pull-request-24",
150-
"text": "Annotates findings on the pull request. Pass GITHUB_TOKEN with pull-requests: write to add a summary comment or review suggestions. Linux, macOS and Windows runners.",
150+
"text": "Annotates findings on the pull request. Pass GITHUB_TOKEN with pull-requests: write to add thread comments or pull request reviews. Linux, macOS and Windows runners.",
151151
"code": "uses: cpp-linter/cpp-linter-action@v2",
152152
"href": "https://cpp-linter.github.io/cpp-linter-action/", "cta": "Read the docs",
153153
},
@@ -238,20 +238,9 @@ <h3>{{ title }}</h3>
238238
<div class="cl-head">
239239
<p class="cl-eyebrow">What reviewers see</p>
240240
<h2 class="cl-h2">Results show up on the pull request</h2>
241-
<p class="cl-sub">Annotations are on by default. Review suggestions, a summary comment and auto-fix each take one input plus write access for the job.</p>
241+
<p class="cl-sub">Annotations are on by default and each of the others takes one input. Thread comments, pull request reviews and auto-fix also need write access for the job; the step summary shows on the workflow run.</p>
242242
</div>
243243
<div class="cl-outcomes">
244-
<article class="cl-outcome">
245-
<div class="cl-outcome__art" aria-hidden="true">
246-
<div class="cl-mini cl-diff cl-diff--roomy">
247-
<div class="cl-diff__line cl-diff__line--del"><span class="cl-diff__mark">−</span><span class="cl-diff__code">int* p=0;</span></div>
248-
<div class="cl-diff__line cl-diff__line--fix"><span class="cl-diff__mark">+</span><span class="cl-diff__code">int *p = nullptr;</span></div>
249-
</div>
250-
<span class="cl-fake-btn cl-fake-btn--primary cl-fake-btn--end">Commit suggestion</span>
251-
</div>
252-
<h3 class="cl-h3">Suggestions you can commit</h3>
253-
<p>Set format-review or tidy-review and fixes for lines in the diff arrive as review suggestions. Needs pull-requests: write, so pull requests from forks get annotations only.</p>
254-
</article>
255244
<article class="cl-outcome">
256245
<div class="cl-outcome__art" aria-hidden="true">
257246
<div class="cl-mini cl-diff cl-diff--roomy">
@@ -261,8 +250,11 @@ <h3 class="cl-h3">Suggestions you can commit</h3>
261250
</div>
262251
<p class="cl-annotation"><span class="cl-ico cl-ico--warn">{% include ".icons/octicons/alert-16.svg" %}</span><span><strong>Line 18</strong> · readability-braces-around-statements</span></p>
263252
</div>
264-
<h3 class="cl-h3">Notes in the diff</h3>
265-
<p>clang-tidy findings in the checked file are annotated on their line (GitHub shows up to 10 warnings per step), and clang-format adds one note per file. Annotations need no write access, so they also work on pull requests from forks.</p>
253+
<div class="cl-outcome__title">
254+
<h3 class="cl-h3">Annotations</h3>
255+
<code class="cl-inline-code">file-annotations</code>
256+
</div>
257+
<p>On by default. clang-tidy findings in the checked file are annotated on their line (GitHub shows up to 10 warnings per step), and clang-format adds one note per file. Annotations need no write access, so they also work on pull requests from forks.</p>
266258
</article>
267259
<article class="cl-outcome">
268260
<div class="cl-outcome__art" aria-hidden="true">
@@ -272,9 +264,56 @@ <h3 class="cl-h3">Notes in the diff</h3>
272264
<p class="cl-summary__tags"><span class="cl-tag cl-tag--warn">clang-tidy (v21.1.0) reports: 2 concern(s)</span></p>
273265
</div>
274266
</div>
275-
<h3 class="cl-h3">One summary comment</h3>
267+
<div class="cl-outcome__title">
268+
<h3 class="cl-h3">Thread Comment</h3>
269+
<code class="cl-inline-code">thread-comments</code>
270+
</div>
276271
<p>Set thread-comments: update and one comment lists the results, edited on each push while there are findings. It is posted by github-actions[bot] or your own App, and needs pull-requests: write, so it fails on pull requests from forks.</p>
277272
</article>
273+
<article class="cl-outcome">
274+
<div class="cl-outcome__art" aria-hidden="true">
275+
<div class="cl-mini cl-summary">
276+
<p class="cl-summary__head"><strong>cpp-linter summary</strong></p>
277+
<p class="cl-summary__report"><strong>Cpp-Linter Report</strong> Some files did not pass the configured checks!</p>
278+
<p class="cl-summary__tags"><span class="cl-tag cl-tag--warn">clang-format (v21.1.0) reports: 1 file(s) not formatted</span></p>
279+
</div>
280+
</div>
281+
<div class="cl-outcome__title">
282+
<h3 class="cl-h3">Step Summary</h3>
283+
<code class="cl-inline-code">step-summary</code>
284+
</div>
285+
<p>Set step-summary: true and the same report is added to the job summary of the workflow run. It needs no write access, so it also works on pull requests from forks and in private repositories, where thread comments are turned off.</p>
286+
</article>
287+
<article class="cl-outcome">
288+
<div class="cl-outcome__art" aria-hidden="true">
289+
<p class="cl-annotation"><span><strong>clang-tidy diagnostics</strong> · use nullptr [modernize-use-nullptr]</span></p>
290+
<div class="cl-mini cl-diff cl-diff--roomy">
291+
<div class="cl-diff__line cl-diff__line--del"><span class="cl-diff__mark">−</span><span class="cl-diff__code">int *p = 0;</span></div>
292+
<div class="cl-diff__line cl-diff__line--fix"><span class="cl-diff__mark">+</span><span class="cl-diff__code">int *p = nullptr;</span></div>
293+
</div>
294+
<span class="cl-fake-btn cl-fake-btn--primary cl-fake-btn--end">Commit suggestion</span>
295+
</div>
296+
<div class="cl-outcome__title">
297+
<h3 class="cl-h3">Pull Request Review</h3>
298+
<code class="cl-inline-code">tidy-review</code>
299+
</div>
300+
<p>Set tidy-review: true and clang-tidy's fixes for lines in the diff are posted in a pull request review, as suggested changes under each diagnostic. Needs pull-requests: write, so pull requests from forks get annotations only.</p>
301+
</article>
302+
<article class="cl-outcome">
303+
<div class="cl-outcome__art" aria-hidden="true">
304+
<p class="cl-annotation"><span><strong>clang-format suggestion</strong></span></p>
305+
<div class="cl-mini cl-diff cl-diff--roomy">
306+
<div class="cl-diff__line cl-diff__line--del"><span class="cl-diff__mark">−</span><span class="cl-diff__code">int* p=nullptr;</span></div>
307+
<div class="cl-diff__line cl-diff__line--fix"><span class="cl-diff__mark">+</span><span class="cl-diff__code">int *p = nullptr;</span></div>
308+
</div>
309+
<span class="cl-fake-btn cl-fake-btn--primary cl-fake-btn--end">Commit suggestion</span>
310+
</div>
311+
<div class="cl-outcome__title">
312+
<h3 class="cl-h3">Pull Request Review</h3>
313+
<code class="cl-inline-code">format-review</code>
314+
</div>
315+
<p>Set format-review: true and clang-format's fixes for lines in the diff are posted in a pull request review, as suggested changes you commit in one click. Same permission as tidy-review.</p>
316+
</article>
278317
<article class="cl-outcome">
279318
<div class="cl-outcome__art" aria-hidden="true">
280319
<div class="cl-mini cl-commit">
@@ -287,7 +326,8 @@ <h3 class="cl-h3">One summary comment</h3>
287326
<p class="cl-annotation"><code class="cl-inline-code">auto-fix: true</code> plus <code class="cl-inline-code">contents: write</code></p>
288327
</div>
289328
<div class="cl-outcome__title">
290-
<h3 class="cl-h3">Fixes pushed for you</h3>
329+
<h3 class="cl-h3">Auto-fix</h3>
330+
<code class="cl-inline-code">auto-fix</code>
291331
<span class="cl-badge-new">New in v2.23</span>
292332
</div>
293333
<p>Set auto-fix: true and give the job contents: write, and the clang-format fixes are committed to the branch of a same-repository pull request, by default under the name of whoever triggered the run.</p>

‎docs/stylesheets/home.css‎

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1186,6 +1186,11 @@
11861186
gap: 12px;
11871187
}
11881188

1189+
/* the action input beside each card title */
1190+
.cl-outcome__title .cl-inline-code {
1191+
font-size: 13px;
1192+
}
1193+
11891194
.cl-mini {
11901195
overflow: hidden;
11911196
background: #fff;

0 commit comments

Comments
 (0)