Skip to content

Commit dc71f8c

Browse files
authored
fix mkdocstrings usage/reqs (#70)
* fix mkdocstrings usage/reqs - removed some unnecessary CSS * check mkdocs builds on all branches - only publish from master
1 parent f87ef79 commit dc71f8c

File tree

9 files changed

+24
-62
lines changed

9 files changed

+24
-62
lines changed

.github/workflows/mkdocs-deploy.yml

Lines changed: 4 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -2,7 +2,6 @@ name: MkDocs Deploy
22

33
on:
44
push:
5-
branches: [master]
65
workflow_dispatch:
76

87
jobs:
@@ -15,7 +14,11 @@ jobs:
1514
python-version: 3.x
1615
- name: Install python action for doc extraction
1716
run: pip install . -r docs/requirements.txt
17+
- name: check mkdocs build
18+
if: github.ref != 'refs/heads/master'
19+
run: mkdocs build
1820
- name: Build docs and deploy to gh-pages
21+
if: github.ref == 'refs/heads/master'
1922
run: |
2023
git config user.name 'github-actions'
2124
git config user.email '41898282+github-actions[bot]@users.noreply.github.com'

cpp_linter/clang_format_xml.py

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -118,7 +118,7 @@ def log_command(self, style: str) -> str:
118118

119119
def parse_format_replacements_xml(src_filename: str):
120120
"""Parse XML output of replacements from clang-format. Output is saved to
121-
[`format_advice`][cpp_linter.__init__.GlobalParser.format_advice].
121+
[`format_advice`][cpp_linter.GlobalParser.format_advice].
122122
123123
Args:
124124
src_filename: The source file's name for which the contents of the xml
@@ -146,7 +146,7 @@ def parse_format_replacements_xml(src_filename: str):
146146

147147
def print_fixits():
148148
"""Print all [`XMLFixit`][cpp_linter.clang_format_xml.XMLFixit] objects in
149-
[`format_advice`][cpp_linter.__init__.GlobalParser.format_advice]."""
149+
[`format_advice`][cpp_linter.GlobalParser.format_advice]."""
150150
for fixit in GlobalParser.format_advice:
151151
print(repr(fixit))
152152
for line_fix in fixit.replaced_lines:

cpp_linter/clang_tidy.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -102,7 +102,7 @@ def parse_tidy_output() -> None:
102102
def print_fixits():
103103
"""Print out all clang-tidy notifications from stdout (which are saved to
104104
clang_tidy_report.txt and allocated to
105-
[`tidy_notes`][cpp_linter.__init__.GlobalParser.tidy_notes]."""
105+
[`tidy_notes`][cpp_linter.GlobalParser.tidy_notes]."""
106106
for notification in GlobalParser.tidy_notes:
107107
print("found", len(GlobalParser.tidy_notes), "tidy_notes")
108108
print(repr(notification))

cpp_linter/clang_tidy_yml.py

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -99,7 +99,7 @@ def __repr__(self) -> str:
9999

100100
def parse_tidy_suggestions_yml():
101101
"""Read a YAML file from clang-tidy and create a list of suggestions from it.
102-
Output is saved to [`tidy_advice`][cpp_linter.__init__.GlobalParser.tidy_advice].
102+
Output is saved to [`tidy_advice`][cpp_linter.GlobalParser.tidy_advice].
103103
"""
104104
yml = {}
105105
with open("clang_tidy_output.yml", "r", encoding="utf-8") as yml_file:
@@ -130,7 +130,7 @@ def parse_tidy_suggestions_yml():
130130

131131
def print_fixits():
132132
"""Print all [`YMLFixit`][cpp_linter.clang_tidy_yml.YMLFixit] objects in
133-
[`tidy_advice`][cpp_linter.__init__.GlobalParser.tidy_advice]."""
133+
[`tidy_advice`][cpp_linter.GlobalParser.tidy_advice]."""
134134
for fix in GlobalParser.tidy_advice:
135135
for diag in fix.diagnostics:
136136
print(repr(diag))

cpp_linter/run.py

Lines changed: 5 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -214,7 +214,7 @@ def is_file_in_list(paths: list, file_name: str, prompt: str) -> bool:
214214

215215
def get_list_of_changed_files() -> None:
216216
"""Fetch the JSON payload of the event's changed files. Sets the
217-
[`FILES`][cpp_linter.__init__.Globals.FILES] attribute."""
217+
[`FILES`][cpp_linter.Globals.FILES] attribute."""
218218
start_log_group("Get list of specified source files")
219219
files_link = f"{GITHUB_API_URL}/repos/{GITHUB_REPOSITORY}/"
220220
if GITHUB_EVENT_NAME == "pull_request":
@@ -232,7 +232,7 @@ def filter_out_non_source_files(
232232
ext_list: list, ignored: list, not_ignored: list, lines_changed_only: bool
233233
) -> bool:
234234
"""Exclude undesired files (specified by user input 'extensions'). This filter
235-
applies to the event's [`FILES`][cpp_linter.__init__.Globals.FILES] attribute.
235+
applies to the event's [`FILES`][cpp_linter.Globals.FILES] attribute.
236236
237237
Args:
238238
ext_list: A list of file extensions that are to be examined.
@@ -327,7 +327,7 @@ def verify_files_are_present() -> None:
327327

328328
def list_source_files(ext_list: list, ignored_paths: list, not_ignored: list) -> bool:
329329
"""Make a list of source files to be checked. The resulting list is stored in
330-
[`FILES`][cpp_linter.__init__.Globals.FILES].
330+
[`FILES`][cpp_linter.Globals.FILES].
331331
332332
Args:
333333
ext_list: A list of file extensions that should by attended.
@@ -495,7 +495,7 @@ def capture_clang_tools_output(
495495
repo_root: str,
496496
):
497497
"""Execute and capture all output from clang-tidy and clang-format. This aggregates
498-
results in the [`OUTPUT`][cpp_linter.__init__.Globals.OUTPUT].
498+
results in the [`OUTPUT`][cpp_linter.Globals.OUTPUT].
499499
500500
Args:
501501
version: The version of clang-tidy to run.
@@ -733,7 +733,7 @@ def make_annotations(style: str, file_annotations: bool) -> bool:
733733
return ret_val
734734

735735

736-
def parse_ignore_option(paths: str):
736+
def parse_ignore_option(paths: str) -> tuple:
737737
"""Parse a given string of paths (separated by a '|') into `ignored` and
738738
`not_ignored` lists of strings.
739739

docs/API Reference/cpp_linter.md

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,3 +1,3 @@
11
# Base module
22

3-
::: cpp_linter.__init__
3+
::: cpp_linter

docs/requirements.txt

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,5 @@
11
mkdocs
2-
mkdocstrings
2+
mkdocstrings[python]
33
mkdocs-material
44
mkdocs-autorefs
55
mkdocs-include-markdown-plugin

docs/stylesheets/extra.css

Lines changed: 1 addition & 42 deletions
Original file line numberDiff line numberDiff line change
@@ -14,46 +14,5 @@ tr:hover {
1414
}
1515

1616
th {
17-
background-color: var(--md-primary-fg-color--light);
18-
}
19-
20-
.md-typeset table:not([class]) {
21-
/* border-radius: .1rem; */
22-
border-radius: 0 1rem 1rem 0;
23-
border-left: .2rem solid;
24-
border-left-color: var(--md-default-fg-color);
25-
}
26-
27-
.md-typeset details:not([open])>summary {
28-
/* border-radius: .1rem; */
29-
border-radius: 0 1rem 1rem 0;
30-
}
31-
32-
.md-typeset summary {
33-
border-top-right-radius: 1rem;
34-
}
35-
36-
.md-typeset .admonition,
37-
.md-typeset details {
38-
/* border-top-right-radius: .1rem; */
39-
border-top-right-radius: 1rem;
40-
border-bottom-right-radius: 1rem;
41-
}
42-
43-
.md-typeset .cite>.admonition-title,
44-
.md-typeset .cite>summary,
45-
.md-typeset .quote>.admonition-title,
46-
.md-typeset .quote>summary {
47-
/* background-color: hsla(0,0%,62%,.1); */
48-
/* border-color: #9e9e9e; */
49-
background-color: hsla(27.9, 68.9%, 41.6%, 0.33);
50-
border-color: hsl(27.9, 68.9%, 41.6%);
51-
}
52-
53-
.md-typeset .admonition.cite,
54-
.md-typeset .admonition.quote,
55-
.md-typeset details.cite,
56-
.md-typeset details.quote {
57-
/* border-color: #9e9e9e; */
58-
border-color: hsla(27.9, 68.9%, 41.6%);
17+
background-color: var(--md-default-fg-color--lightest);
5918
}

mkdocs.yml

Lines changed: 7 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -6,13 +6,13 @@ edit_uri: "blob/master/docs/"
66
repo_name: "cpp-linter/cpp-linter-action"
77
nav:
88
- index.md
9-
- "Dev Docs":
10-
- API Reference/cpp_linter.md
11-
- API Reference/cpp_linter.run.md
12-
- API Reference/cpp_linter.clang_tidy.md
13-
- API Reference/cpp_linter.clang_tidy_yml.md
14-
- API Reference/cpp_linter.clang_format_xml.md
15-
- API Reference/cpp_linter.thread_comments.md
9+
- 'Dev Docs':
10+
- 'API Reference/cpp_linter.md'
11+
- 'API Reference/cpp_linter.run.md'
12+
- 'API Reference/cpp_linter.clang_tidy.md'
13+
- 'API Reference/cpp_linter.clang_tidy_yml.md'
14+
- 'API Reference/cpp_linter.clang_format_xml.md'
15+
- 'API Reference/cpp_linter.thread_comments.md'
1616

1717
theme:
1818
name: material

0 commit comments

Comments
 (0)