Skip to content

Fix Quark rules not matching when no spaces between arguments.#249

Merged
pulorsok merged 3 commits into
ev-flow:masterfrom
haeter525:fix_support_standard_api_format
Oct 5, 2021
Merged

Fix Quark rules not matching when no spaces between arguments.#249
pulorsok merged 3 commits into
ev-flow:masterfrom
haeter525:fix_support_standard_api_format

Conversation

@haeter525

@haeter525 haeter525 commented Sep 22, 2021

Copy link
Copy Markdown
Member

Description
Refer to #138
This PR inserts additional spaces into those APIs that don't have spaces in the arguments. The adjustment happens when Quark loading a JSON rule.

Code changes

  1. quark/utils/tools.py
    • add a function to add spaces to the API.
  2. quark/core/struct/ruleobject.py
    • support API without spaces.
  3. quark/core/rzapkinfo.py
    • remove the repeated code.

Test plan

  • All tests passed.

@pep8speaks

pep8speaks commented Sep 22, 2021

Copy link
Copy Markdown

Hello @haeter525! Thanks for updating this PR. We checked the lines you've touched for PEP 8 issues, and found:

There are currently no PEP 8 issues detected in this Pull Request. Cheers! 🍻

Comment last updated at 2021-10-03 11:23:33 UTC

@haeter525 haeter525 force-pushed the fix_support_standard_api_format branch 2 times, most recently from 143a4b2 to 28a7a1e Compare September 22, 2021 07:13
@codecov-commenter

codecov-commenter commented Sep 22, 2021

Copy link
Copy Markdown

Codecov Report

Merging #249 (524d8f6) into master (e5505e0) will increase coverage by 0.23%.
The diff coverage is 100.00%.

Impacted file tree graph

@@            Coverage Diff             @@
##           master     #249      +/-   ##
==========================================
+ Coverage   80.09%   80.32%   +0.23%     
==========================================
  Files          49       49              
  Lines        3481     3523      +42     
==========================================
+ Hits         2788     2830      +42     
  Misses        693      693              
Flag Coverage Δ
unittests 80.32% <100.00%> (+0.23%) ⬆️

Flags with carried forward coverage won't be shown. Click here to find out more.

Impacted Files Coverage Δ
quark/core/rzapkinfo.py 77.25% <100.00%> (-0.32%) ⬇️
quark/core/struct/ruleobject.py 95.45% <100.00%> (+0.58%) ⬆️
quark/utils/tools.py 100.00% <100.00%> (ø)
tests/core/struct/test_ruleobject.py 100.00% <100.00%> (ø)
tests/utils/test_tools.py 100.00% <100.00%> (ø)

Continue to review full report at Codecov.

Legend - Click here to learn more
Δ = absolute <relative> (impact), ø = not affected, ? = missing data
Powered by Codecov. Last update e5505e0...524d8f6. Read the comment docs.

@haeter525 haeter525 force-pushed the fix_support_standard_api_format branch from 28a7a1e to 48d87d4 Compare October 3, 2021 10:51
@pulorsok

pulorsok commented Oct 4, 2021

Copy link
Copy Markdown
Member

Hi @haeter525, can you describe how you solved this problem?

@haeter525

Copy link
Copy Markdown
Member Author

Hi @pulorsok ,

The solution is simple.
When parsing the JSON rules, I insert additional spaces into those APIs that don't have spaces in the arguments.
Thank you!

@pulorsok

pulorsok commented Oct 5, 2021

Copy link
Copy Markdown
Member

LGTM!
Nice work @haeter525, and thank you for the PR.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Projects

None yet

Development

Successfully merging this pull request may close these issues.

Rule does not match when no spaces between arguments in the Java signature of the descriptor

4 participants