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

Parse better with python #22

Merged
merged 78 commits into from
Sep 30, 2021
Merged

Conversation

2bndy5
Copy link
Collaborator

@2bndy5 2bndy5 commented Sep 24, 2021

solves #17 . Keep in mind that comments made to push events will show up in a PR, but they cannot be removed via REST API without checking every commit in the PR for comments from push events.

I've added a new input option called diff-only (also listed in the README.md). This input option allows users to focus clang-tools on only changes found in the event's diff. Comments posted inside an event's diff are disabled until I can iron out the kinks with the latest experiments. So, setting diff-only to true will still post a thread comment if problems were observed by clang-tools.

I've also updated the demo_comment picture for the README.

This also introduces developer docs made with mkdocs. I'm still working on RTFD.org integration (I need to get these changes upstream first). Notice that the pictures have been moved to the docs/images folder (all links to pictures in the README have been updated accordingly).

We will be relying on python instead of bash script from here on. The run_checks.sh still exists for posterity.

@shenxianpeng
Copy link
Collaborator

shenxianpeng commented Sep 26, 2021

I don't think this code inspector bot is the best solution for linting python code. In fact I've only ever used "pylint" or "black" tools to lint my python code.

It's OK to use other linter tools... The code inspector can add lint results to related code which surprised me.

I will come back to learn your PR again two days later when I finished a presentation and some family affairs.

mkdocs.yml Show resolved Hide resolved
@2bndy5 2bndy5 marked this pull request as draft September 26, 2021 06:08
@2bndy5 2bndy5 marked this pull request as ready for review September 26, 2021 10:26
.ci-ignore Show resolved Hide resolved
Dockerfile Show resolved Hide resolved
@2bndy5
Copy link
Collaborator Author

2bndy5 commented Sep 28, 2021

I started working on a "check-python-sources" action that is similar to this action (but obviously for python). I aim to support different linters in the future, but for now I'm just using pylint (and black eventually).

@2bndy5 2bndy5 linked an issue Sep 28, 2021 that may be closed by this pull request
@shenxianpeng
Copy link
Collaborator

If you feel good, you can merge. 🥇

README.md Show resolved Hide resolved
@shenxianpeng
Copy link
Collaborator

I want to continue doing some tests for this PR, I'd like to merge it to master-py first (it was created from master) and finally merge back master

@shenxianpeng shenxianpeng changed the base branch from master to master-py September 30, 2021 01:57
@2bndy5
Copy link
Collaborator Author

2bndy5 commented Sep 30, 2021

sounds good to me

@shenxianpeng shenxianpeng merged commit 3f460f5 into cpp-linter:master-py Sep 30, 2021
@2bndy5
Copy link
Collaborator Author

2bndy5 commented Sep 30, 2021

I have made the default version of the docs shown at RTFD.org use the master-py branch for now. This way you can see changes to the docs after each commit! I will change this default version back to the master branch if/when these changes migrate to that branch.

observe http://cpp-linter-action.rtfd.io/

shenxianpeng added a commit that referenced this pull request Oct 11, 2021
* 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]>
@2bndy5 2bndy5 deleted the parse-better branch October 11, 2021 13:26
@shenxianpeng shenxianpeng added the enhancement New feature or request label Oct 11, 2021
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
enhancement New feature or request
Projects
None yet
Development

Successfully merging this pull request may close these issues.

use only 1 bot comment
2 participants