Closed sthagen closed 3 years ago
first of all, hi @sthagen , huge thanks for the interest 😍. thanks for the effort , i was planning for a long time to refactor this but could not manage time to do so.
let me ask you something. Did the test pass? i cannot see any action log on your repo. As you have changed a lot of things, let me go through the code first.
I'll get back to you soon :).
also i need a maintainer for this repo ,let me know if you are interested :)
Hi, @sthagen I just checked your code. Great work. ❤️ , I'm impressed
However, It has some issues to solve.
for some reason the main command for cppcheck along with its options, not executing. I guess only cppcheck
is given as a command and the whole options are not getting added. That's why it is failing to generate the report. Please look at the vector
array.
If you find the issue let me know, else I'll take some time to look into it :+1:
I also encourage you to enable action on your repo and test it there.
there should be something like this in the log.
1/3 files checked 34% done
Checking __tests__/server/server.c ...
2/3 files checked 64% done
Checking __tests__/test.c ...
Checking __tests__/test.c: PROCESS...
Checking __tests__/test.c: THREAD...
3/3 files checked 100% done
please update to
skip_preprocessor: disable
(in the YAML file) while testing
I did activate the test action as suggested by @deep5050, amended the PR branch with a commit that passed local tests and exploratory testing, and saw the github test action succeed in the cppcheck step (but fail in the publish for a merge commit I had to perform to include the action activation changes).
Hope this helps.
publish action is not directly connected with my action. It's failing because your main
branch is way behind your cleaning-person
branch. that's not an issue.
glad to see cppcheck passed :cool: let me test this in a separate branch and then I will merge it into my main branch.
Let me ask you something, would you please take some time to add a little feature to it once I merge this?
Let users specify custom options ( without checking them inside my code). As many options are added to the cppcheck tool on every new release, It's not possible to cover all of them. so I was planning to add an environment variable like other_options
where users can add options on their own.
Hi @sthagen, I must say you are an excellent programmer. If you are interested let's build something together. Let's list our ideas and see if there is anything we can work by collaborating. Also, I will be grateful to you if you take care of this repo along with me in the future. :heart:
Hello @sthagen,
thank you for the additions!
i had an issue with option exclude_check, it seems to be ignored.
i guess it has to do with the -i {{}}
in entrypoint.py Line 99 ?
here is my .yml config: https://github.com/BaderEddineOuaich/Enigma/blob/master/.github/workflows/static-analysis.yml here is the latest action done: https://github.com/BaderEddineOuaich/Enigma/runs/1617993682 and thats the generated file: https://github.com/BaderEddineOuaich/Enigma/blob/master/CppCheck-Static-Analysis-Report.txt where ./Dependencies/ should be ignored. i hope that will help you solve the issue. thanks!
... i had an issue with option exclude_check, it seems to be ignored. i guess it has to do with the
-i {{}}
in entrypoint.py Line 99 ? ...
Yes. Thanks a lot for spotting. I sneaked the fix via an amended commit into PR #23
@deep5050
@sthagen #23 is still under review, but the issue mentioned by @BaderEddineOuaich needs to be solved ASAP as it is in the main branch.
I'm fixing it directly on my main branch.
@BaderEddineOuaich rerun the action and let me know if that worked. i have modified the code.
@deep5050 the issue still persists as ./Dependencies/ is still being analyzed in the latest run
Ah, an upstream problem. Thank you for providing the links to your assets.
@deep5050 the issue still persists as ./Dependencies/ is still being analyzed in the latest run
I fixed the problem by applying the single-space fix that cures commandline parsers since decades ... :wink:
The version 1.9 of cppcheck does accept -i source_root_to_be_ignored
while the newer one we are using does not.
When I remove the separating space between the -i
and the folder name the new version of cppcheck also accepts it.
I will provide a hotfix from the main branch ... and created the PR #25 - sorry for the inconvenience.
@deep5050: Where should I place my tests so we can avoid future regressions like these? I do not know much about constraints on github-actions source repositories, but I think I read only minimal files for deployment should be in there, but then I may very well be wrong (hopefully).
Thanks.
it works like a charm now. thank you guys for the effort!
Just in case this is a welcome enhancement I refactored the entry point script to make it more extensible and maintainable.
No hard feelings if you ignore or directly reject the request.
The latter may be very subjective.
I find it tricky to refactor without tests, so I wrote a context module (to mock the non-forgiving environemental reads) and a test module which I place side by side in my working are inside the src folder:
I understood from the github actions documentation that the tests files might be too much in the repo which seeds the market place action, so I just put them - as all my contributions under license MIT - into this PR as comment:
context.py:
test_entrypoint.py:
Executing these tests within a python 3.8 virtual environment with pytest installed gives:
And coverage seems to be OK ...
My linter only notices the original TODO:
Output:
Also, mypy thinks the types are OK (but then there are no annotations).