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

fix: convert strict JSON errors to warning #6017

Merged
merged 3 commits into from
Jan 30, 2025
Merged

Conversation

scarf005
Copy link
Member

Purpose of change (The Why)

Json error: data/json/items/generic/bathroom_house.json:27:14: cannot assign explicit value the same as default or inherited value

    "price_postapoc": "150 cent",
    "//": "the end of the world doesn't mean everyone is okay with having ZZ Top beards.  disposable razors are a hot commodity.",
    "weight":
             ^
              "100 g",
    "material": [ "plastic", "steel" ],
    "cutting": 2,

Hints like this should be an warning, not errors that break builds that has been running for 20 minutes, which is highly annoying.

Describe the solution (The How)

adds new macro, debugmsg_of which accepts debug level as first parameter.

Describe alternatives you've considered

Testing

21:18:32.078 WARNING DEBUGMSG : /var/home/scarf/repo/cata/Cataclysm/src/assign.cpp:11 [void report_strict_violation(const JsonObject &, const std::string &, const std::string &)] (json-error)
Json error: data/json/items/generic/bathroom_house.json:27:14: cannot assign explicit value the same as default or inherited value

    "price_postapoc": "150 cent",
    "//": "the end of the world doesn't mean everyone is okay with having ZZ Top beards.  disposable razors are a hot commodity.",
    "weight":
             ^
              "100 g",
    "material": [ "plastic", "steel" ],
    "cutting": 2,


Starting the actual test at Thu Jan 30 21:18:40 2025
[sol2] An exception occurred: Exception thrown on Cpp side!
21:19:56.941 INFO : Language set to 'en_US'
21:19:56.941 INFO : C locale set to 'en_US.UTF-8'
21:19:56.941 INFO : C++ locale set to 'en_US.UTF-8'
21:19:57.148 INFO : Language set to 'fr_FR'
21:19:57.151 INFO : C locale set to 'fr_FR.UTF-8'
21:19:57.151 INFO : C++ locale set to 'fr_FR.UTF-8'
21:19:57.389 INFO : Language set to 'ru_RU'
21:19:57.392 INFO : C locale set to 'ru_RU.UTF-8'
21:19:57.393 INFO : C++ locale set to 'ru_RU.UTF-8'
21:19:57.554 INFO : Language set to 'en_US'
21:19:57.554 INFO : C locale set to 'en_US.UTF-8'
21:19:57.554 INFO : C++ locale set to 'en_US.UTF-8'
===============================================================================
All tests passed (7243965 assertions in 545 test cases)

21:21:14.289 INFO : Setting active world to NULL
Ended test at Thu Jan 30 21:21:14 2025
The test took 153.842 seconds
  • caused duplicate value on purpose
  • tests passes

Additional context

#6014 bring me here

Checklist

Mandatory

Verified

This commit was created on GitHub.com and signed with GitHub’s verified signature.
needs to be used by realDebugMsg
@github-actions github-actions bot added the src changes related to source code. label Jan 30, 2025
@scarf005 scarf005 changed the title Fix/json error to warning fix: strict JSON errors to warning Jan 30, 2025
@scarf005 scarf005 changed the title fix: strict JSON errors to warning fix: convert strict JSON errors to warning Jan 30, 2025
@chaosvolt chaosvolt merged commit 44f0609 into main Jan 30, 2025
16 checks passed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
src changes related to source code.
Projects
None yet
Development

Successfully merging this pull request may close these issues.

None yet

2 participants