Skip to content

Commit d5764b0

Browse files
shenxianpeng2bndy5
andauthored
Ready to merge master-py to master (#27)
* Parse better with python (#22) * upload new demo image * Revert "upload new demo image" This reverts commit 1aff6c7. * update readme & upload new demo pic * avoids duplicated checks on commits to open PR * fix workflow from the last commit * Revert "fix workflow from the last commit" This reverts commit 778e10d. * create python scripts * output event payload & pip3 ver * echo pip3 list * switch action to this branch * echo pip3 list * install pip and list modules * typo * pip3 install requests * switching to only python * should've read the docker docs * switching back to ENTRYPOINT * typo * don't upgrade if files exist outside /use dir * use python as an entrypoint * add project.toml * bad syntax * try again * hard_code version in setup.py * try pip install * only upgrade pip * test on source files * headers are dicts * test on source files * fix posting comment using requsts * fix passing verbosity to CLI args * action uses current branch for now * parsing everything; no diff action yet * show all debug in logs * use bot's id not mine * double trigger action * auto-verbose logging on repeated runs * show me then run number * support sync events in PRs * switch to mkdocs * fix bad indent in yml * install pkg before documenting * typo * compatible w/ windows; add diff-only input option * diff comments working on PR from clang-tidy advice * rolling back diff comments; update docs * use bot id * disable diff-only in demo * Update setup.py * try mkdocs gh-deploy * use a gh action to publish docs * oops. ignoe release only condition for now * change doc's favicon * [no ci] publish docs only on release event * rename docs CI workflow * prototype badge * [no ci] augment doc build instructions * update readme & demo picture * [no ci] pub docs on release * update docs * disable mkdocs CI (switching to rtfd CI) * fix some review suggestions * update badge in readme * Use lazy % formatting in logging functions * fix more code-inspector notices * slight refactor and switch to pylint * fix pylint workflow * run pylint on PR synch events too * Tell code-inspector to ignore python srcs * Tell code inspector to ignore mkdocs.yml * ran black * self review changes * Update .github/workflows/run-pylint.yml * add gitpod badge to root README.md * try to fix verify_files_are_present() * remove <br> to auto adjust and easy copying * fixed typo * solution to #24 * using check=True causes #24 * log non-zero exit codes as warnings * warn (in log) about no git checkout * Update action name Update the name to make it easier to search in the marketplace when users search with clang-format or clang-tidy. * Revert "Update action name" This reverts commit 4a41a5e. * Upadate README.md * Check all files (#26) * initial attempt (#25) * change test action to my branch * adjust workflow triggers * try log grouping with logger.critical() * change logger's format * don't upgrade pip; test some new features * test fake submodule; show me args.ignore on boot * considering alternate fmt for ignore option * remove fake submodule (it worked); * action inputs can't take a sequence; delimit by \n * specifying `--ignore` better * fix exit early when no files found * list_source_files() is malfunctioning??? * Revert "list_source_files() is malfunctioning???" This reverts commit 59522e0. * is ignore option causing malfunction? * show me what paths are being skipped * show me which paths are crawled * show me which files are considered as src files * show me comparison of ignored paths * change done debug statements * fix debugging statement in is_file_ignored() * skip comparing empty strings in ignored paths * maybe a bug about ignoring root dir * try getting python latest from src * python src build needs deps. revert to apt build * try using tojson() * bad yml fmt * try a different json approach * make yml array an explicit str * try forcing it as a py list * abandon json idea * try new log_cmder and !ignore prefix * need to separate a single str into multi args * use pipe char as delimiters * slightly different approach to passing ignore val * might need to switch to 1 line of input * how to handle spaces in a path among multiple * no need to escape quotes * fix debug prompts; and workflow-triggered paths * fix cpp-linter-test action's triggered paths * check action stil works without using new features * try log cmds to annotate * try abbotations again * use a long unlikely string as default ignore * try annotating with line and columns * try \n with minimal parameters * does file need changes to show annotation? * use html <br> and line's columns * trigger annotations * adjust annotation's output * try CRLF * simply can't use mult-line annotation msg * almost ready for PR * use proper casing in chosen style name * adjust last commit for GNU style as well * remove artifact * we don't need the `re` module anymore * new thread-comments option; update docs & README * avoid duplicate clang-tidy comments * [no ci] proofread README * Fix indent in root README for mkdocs * Use sub-headings instead of list points in README * reviewed errors in docs * switch test workflow to upstream action * Update the new example yml and remove old demo link Co-authored-by: Brendan <[email protected]>
1 parent 368dead commit d5764b0

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

41 files changed

+2631
-74
lines changed

.ci-ignore

+2
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,2 @@
1+
python_action
2+
mkdocs.yml

.github/workflows/build-docs.bak

+32
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,32 @@
1+
name: dev-docs
2+
3+
on:
4+
push:
5+
pull_request:
6+
types: [opened]
7+
8+
jobs:
9+
using-mkdocs:
10+
runs-on: ubuntu-latest
11+
steps:
12+
- uses: actions/checkout@v2
13+
- uses: actions/setup-python@v1
14+
with:
15+
python-version: 3.7
16+
- name: Install doc's deps
17+
run: |
18+
python3 -m pip install -r docs/requirements.txt
19+
python3 -m pip install .
20+
- name: Build docs
21+
run: mkdocs build
22+
- name: Save artifact
23+
uses: actions/upload-artifact@v2
24+
with:
25+
name: "cpp linter action dev docs"
26+
path: site/**
27+
- name: upload to github pages
28+
if: ${{ github.event_name == 'release'}}
29+
uses: peaceiris/actions-gh-pages@v3
30+
with:
31+
github_token: ${{ secrets.GITHUB_TOKEN }}
32+
publish_dir: site

.github/workflows/cpp-linter.yml

+6-3
Original file line numberDiff line numberDiff line change
@@ -2,21 +2,24 @@ name: cpp-linter
22

33
on:
44
push:
5+
paths-ignore: "docs/**"
56
pull_request:
6-
types: [opened]
7+
paths-ignore: "docs/**"
78

89
jobs:
910
cpp-linter:
1011
runs-on: ubuntu-latest
1112
steps:
1213
- uses: actions/checkout@v2
13-
- name: C/C++ Lint Action
14-
uses: shenxianpeng/cpp-linter-action@master
14+
- uses: shenxianpeng/cpp-linter-action@master
1515
id: linter
1616
env:
1717
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
1818
with:
1919
style: file
20+
files-changed-only: false
21+
# to ignore all demo folder contents except for demo.cpp
22+
# ignore: demo|!demo/demo.cpp
2023

2124
- name: Fail fast?!
2225
if: steps.linter.outputs.checks-failed > 0

.github/workflows/run-pylint.yml

+29
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,29 @@
1+
name: "Check python code"
2+
3+
on:
4+
push:
5+
paths:
6+
- "**.py"
7+
- .pylintrc
8+
pull_request:
9+
types: opened
10+
paths:
11+
- "**.py"
12+
- .pylintrc
13+
14+
jobs:
15+
using-pylint:
16+
runs-on: ubuntu-latest
17+
steps:
18+
- uses: actions/checkout@v2
19+
- uses: actions/setup-python@v1
20+
with:
21+
python-version: 3.7
22+
- name: Install pylint and action deps
23+
run: |
24+
python3 -m pip install --upgrade pylint
25+
python3 -m pip install -r requirements.txt
26+
- name: run pylint
27+
run: |
28+
pylint python_action/**
29+
pylint setup.py

.gitignore

+182-3
Original file line numberDiff line numberDiff line change
@@ -1,3 +1,182 @@
1-
.cpp_linter_action_changed_files.json
2-
clang_format_report.txt
3-
clang_tidy_report.txt
1+
# local demo specific
2+
.changed_files.json
3+
clang_format*.txt
4+
clang_tidy*.txt
5+
act.exe
6+
clang_tidy_output.yml
7+
clang_format_output.xml
8+
event_payload.json
9+
comments.json
10+
11+
#### ignores for Python
12+
# Byte-compiled / optimized / DLL files
13+
__pycache__/
14+
*.py[cod]
15+
*$py.class
16+
17+
# Distribution / packaging
18+
.Python
19+
build/
20+
develop-eggs/
21+
dist/
22+
downloads/
23+
eggs/
24+
.eggs/
25+
lib/
26+
lib64/
27+
parts/
28+
sdist/
29+
var/
30+
wheels/
31+
pip-wheel-metadata/
32+
share/python-wheels/
33+
*.egg-info/
34+
.installed.cfg
35+
*.egg
36+
MANIFEST
37+
38+
# PyInstaller
39+
# Usually these files are written by a python script from a template
40+
# before PyInstaller builds the exe, so as to inject date/other infos into it.
41+
*.manifest
42+
*.spec
43+
44+
# Installer logs
45+
pip-log.txt
46+
pip-delete-this-directory.txt
47+
48+
# Unit test / coverage reports
49+
htmlcov/
50+
.tox/
51+
.nox/
52+
.coverage
53+
.coverage.*
54+
.cache
55+
nosetests.xml
56+
coverage.xml
57+
*.cover
58+
*.py,cover
59+
.hypothesis/
60+
.pytest_cache/
61+
62+
# Translations
63+
*.mo
64+
*.pot
65+
66+
# Django stuff:
67+
*.log
68+
local_settings.py
69+
db.sqlite3
70+
db.sqlite3-journal
71+
72+
# Flask stuff:
73+
instance/
74+
.webassets-cache
75+
76+
# Scrapy stuff:
77+
.scrapy
78+
79+
# Sphinx documentation
80+
docs/_build/
81+
82+
# PyBuilder
83+
target/
84+
85+
# Jupyter Notebook
86+
.ipynb_checkpoints
87+
88+
# IPython
89+
profile_default/
90+
ipython_config.py
91+
92+
# pyenv
93+
.python-version
94+
95+
# pipenv
96+
# According to pypa/pipenv#598, it is recommended to include Pipfile.lock in version control.
97+
# However, in case of collaboration, if having platform-specific dependencies or dependencies
98+
# having no cross-platform support, pipenv may install dependencies that don't work, or not
99+
# install all needed dependencies.
100+
#Pipfile.lock
101+
102+
# PEP 582; used by e.g. github.com/David-OConnor/pyflow
103+
__pypackages__/
104+
105+
# Celery stuff
106+
celerybeat-schedule
107+
celerybeat.pid
108+
109+
# SageMath parsed files
110+
*.sage.py
111+
112+
# Environments
113+
.env
114+
.venv
115+
env/
116+
venv/
117+
ENV/
118+
env.bak/
119+
venv.bak/
120+
121+
# Spyder project settings
122+
.spyderproject
123+
.spyproject
124+
125+
# Rope project settings
126+
.ropeproject
127+
128+
# mkdocs documentation
129+
/site
130+
131+
# mypy
132+
.mypy_cache/
133+
.dmypy.json
134+
dmypy.json
135+
136+
# Pyre type checker
137+
.pyre/
138+
139+
# exclude local VSCode's settings folder
140+
.vscode/
141+
142+
#### ignores for C++
143+
# Prerequisites
144+
*.d
145+
146+
# Compiled Object files
147+
*.slo
148+
*.lo
149+
*.o
150+
*.obj
151+
152+
# Precompiled Headers
153+
*.gch
154+
*.pch
155+
156+
# Compiled Dynamic libraries
157+
*.so
158+
*.dylib
159+
*.dll
160+
161+
# Fortran module files
162+
*.mod
163+
*.smod
164+
165+
# Compiled Static libraries
166+
*.lai
167+
*.la
168+
*.a
169+
*.lib
170+
171+
# Executables
172+
*.exe
173+
*.out
174+
*.app
175+
176+
# Cmake build-in-source generated stuff
177+
CMakeUserPresets.json
178+
CMakeCache.txt
179+
CPackConfig.cmake
180+
CPackSourceConfig.cmake
181+
CMakeFiles
182+
cmake_install.cmake

0 commit comments

Comments
 (0)