Skip to content

Fix properties mapping utility function handling of overlapping keys #266

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

Merged
merged 1 commit into from
Sep 1, 2021
Merged

Fix properties mapping utility function handling of overlapping keys #266

merged 1 commit into from
Sep 1, 2021

Conversation

per1234
Copy link
Contributor

@per1234 per1234 commented Sep 1, 2021

The Arduino project configuration fields have an odd usage of the properties.Map format. Dots may sometimes indicate nested keys, but in other cases they are merely a character in the key string. Previously, the utility function used to recursively map to a configurable depth was not correctly handling this situation due to using the same code both for the recursive mapping to subkeys as well as for the flat mapping at the final depth. The fix for the bug also makes the function more efficient by avoiding calling SubTree() when it's already known there is no subtree.

The Arduino project configuration fields have an odd usage of the properties.Map format. Dots may sometimes indicate
nested keys, but in other cases they are merely a character in the key string. Previously, the utility function used to
recursively map to a configurable depth was not correctly handling this situation due to using the same code both for the
recursive mapping to subkeys as well as for the flat mapping at the final depth. The fix for the bug also makes the
function more efficient by avoiding calling SubTree() when it's already known there is no subtree.
@per1234 per1234 added type: bug topic: code Related to content of the project itself labels Sep 1, 2021
@codecov-commenter
Copy link

codecov-commenter commented Sep 1, 2021

Codecov Report

Merging #266 (d18887a) into main (1af853e) will decrease coverage by 0.14%.
The diff coverage is 85.14%.

Impacted file tree graph

@@            Coverage Diff             @@
##             main     #266      +/-   ##
==========================================
- Coverage   89.83%   89.69%   -0.15%     
==========================================
  Files          43       44       +1     
  Lines        6327     6491     +164     
==========================================
+ Hits         5684     5822     +138     
- Misses        531      548      +17     
- Partials      112      121       +9     
Flag Coverage Δ
unit 89.69% <85.14%> (-0.15%) ⬇️

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

Impacted Files Coverage Δ
...ternal/rule/ruleconfiguration/ruleconfiguration.go 100.00% <ø> (ø)
internal/rule/rulefunction/platform.go 96.65% <ø> (ø)
ruledocsgen/main.go 83.95% <83.95%> (ø)
internal/project/general/general.go 100.00% <100.00%> (ø)
internal/result/result.go 91.44% <100.00%> (+0.13%) ⬆️

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 a4c8fdc...d18887a. Read the comment docs.

@per1234 per1234 merged commit 3b6da1c into arduino:main Sep 1, 2021
@per1234 per1234 deleted the fix-overlapping-prop-mapping branch September 1, 2021 09:42
@rsora rsora added the type: imperfection Perceived defect in any part of project label Sep 22, 2021
@per1234 per1234 self-assigned this Nov 20, 2021
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
topic: code Related to content of the project itself type: imperfection Perceived defect in any part of project
Projects
None yet
Development

Successfully merging this pull request may close these issues.

4 participants