-
Notifications
You must be signed in to change notification settings - Fork 7
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
chore: Rename LogLevel enum values to use PascalCase; prefix enum class specific values with the enum name (fixes #39). #46
base: main
Are you sure you want to change the base?
Conversation
…ific values with the enum name.
Warning Rate limit exceeded@junhaoliao has exceeded the limit for the number of commits or files that can be reviewed per hour. Please wait 16 minutes and 50 seconds before requesting another review. ⌛ How to resolve this issue?After the wait time has elapsed, a review can be triggered using the We recommend that you space out your commits to avoid hitting the rate limit. 🚦 How do rate limits work?CodeRabbit enforces hourly rate limits for each developer per organization. Our paid plans have higher rate limits than the trial, open-source and free plans. In all cases, we re-allow further reviews after a brief timeout. Please see our FAQ for further information. 📒 Files selected for processing (2)
WalkthroughThis pull request focuses on renaming log level enumeration constants in the Changes
Possibly related issues
Thank you for using CodeRabbit. We offer it for free to the OSS community and would appreciate your support in helping us grow. If you find it useful, would you consider giving us a shout-out on your favorite social media? 🪧 TipsChatThere are 3 ways to chat with CodeRabbit:
Note: Be mindful of the bot's finite context window. It's strongly recommended to break down tasks such as reading entire modules into smaller chunks. For a focused discussion, use review comments to chat about specific files and their changes, instead of using the PR comments. CodeRabbit Commands (Invoked using PR comments)
Other keywords and placeholders
CodeRabbit Configuration File (
|
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Actionable comments posted: 0
🧹 Nitpick comments (1)
src/clp_ffi_js/constants.hpp (1)
Line range hint
30-37
: Check for consistency between the sentinel enum name and its string counterpart.The first entry in
cLogLevelNames
mapsLogLevelNone
to"NONE"
. This is fully functional but mildly inconsistent. If you prefer complete alignment, consider also adjusting the string value to"LogLevelNone"
or a more descriptive label such as"Invalid"
."NONE", // This isn't a valid log level. +"LogLevelNone", // Or "Invalid" "Trace", "DEBUG", ...
📜 Review details
Configuration used: CodeRabbit UI
Review profile: CHILL
Plan: Pro
📒 Files selected for processing (4)
src/clp_ffi_js/constants.hpp
(1 hunks)src/clp_ffi_js/ir/StructuredIrUnitHandler.cpp
(4 hunks)src/clp_ffi_js/ir/StructuredIrUnitHandler.hpp
(1 hunks)src/clp_ffi_js/ir/UnstructuredIrStreamReader.cpp
(1 hunks)
✅ Files skipped from review due to trivial changes (1)
- src/clp_ffi_js/ir/StructuredIrUnitHandler.hpp
🧰 Additional context used
📓 Path-based instructions (3)
src/clp_ffi_js/ir/StructuredIrUnitHandler.cpp (1)
Pattern **/*.{cpp,hpp,java,js,jsx,ts,tsx}
: - Prefer false == <expression>
rather than !<expression>
.
src/clp_ffi_js/ir/UnstructuredIrStreamReader.cpp (1)
Pattern **/*.{cpp,hpp,java,js,jsx,ts,tsx}
: - Prefer false == <expression>
rather than !<expression>
.
src/clp_ffi_js/constants.hpp (1)
Pattern **/*.{cpp,hpp,java,js,jsx,ts,tsx}
: - Prefer false == <expression>
rather than !<expression>
.
🔇 Additional comments (7)
src/clp_ffi_js/constants.hpp (2)
14-21
: Enum naming looks consistent with PascalCase.
These updated enum constants align with the naming convention requested in this pull request. The approach of prefixing only the sentinels (LogLevelNone
and LogLevelLength
) with “LogLevel” while allowing the actual log levels (Trace
, Debug
, etc.) to retain simpler names is consistent and leads to readable code.
23-23
: Index initialization logic is correct.
By setting cValidLogLevelsBeginIdx
to LogLevel::Trace
, the code properly excludes the sentinel value. This logic ensures iteration or range validation does not treat LogLevelNone
as a legitimate log level.
src/clp_ffi_js/ir/StructuredIrUnitHandler.cpp (4)
31-31
: Documentation accurately matches the new enumeration.
The return documentation for parse_log_level
now aligns with LogLevel::LogLevelNone
instead of LogLevel::NONE
. This is a clear indication of the renamed sentinel value.
51-51
: Return of LogLevel::LogLevelNone
for unexpected input is valid.
Returning LogLevelNone
here correctly signals an invalid or unrecognized log level. This change is consistent with the updated enum’s usage.
99-99
: Initialization with LogLevel::LogLevelNone
aligns with the updated enum changes.
Starting out as LogLevelNone
ensures that the variable distinctly represents an “uninitialized” or invalid log level.
116-116
: Updated boundary check with LogLevel::LogLevelLength
looks correct.
Checking against enum_to_underlying_type(LogLevel::LogLevelLength)
ensures a valid log level range. No issues found.
src/clp_ffi_js/ir/UnstructuredIrStreamReader.cpp (1)
110-110
: Renamed sentinel value maintains consistency.
Changing the initialization to LogLevel::LogLevelNone
eliminates ambiguity, matching the new enum naming scheme applied across the codebase. No other logic concerns observed.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
How do you feel about just leaving "None" as is. And not changing to "LogLevelNone" since it is not a property of enum. The rest looks good.
Description
Validation performed
task
to build the project and ensured there was no compilation error or warnings.Summary by CodeRabbit
New Features
Bug Fixes
Documentation