Skip to content

Using constants to avoid the use of hardcoded values#95

Merged
jenspapenhagen merged 8 commits intotoon-format:mainfrom
Invokedzz:main
Feb 5, 2026
Merged

Using constants to avoid the use of hardcoded values#95
jenspapenhagen merged 8 commits intotoon-format:mainfrom
Invokedzz:main

Conversation

@Invokedzz
Copy link
Contributor

Description

The use of hardcoded values is not good for a code that needs to be maintainable.
Therefore, I used the Constants.class with its values to remove a bunch of hardcoded strings.

Type of Change

  • Bug fix (non-breaking change that fixes an issue)
  • New feature (non-breaking change that adds functionality)
  • Breaking change (fix or feature that would cause existing functionality to not work as expected)
  • Documentation update
  • Refactoring (no functional changes)
  • Performance improvement
  • Test coverage improvement

Changes Made

  • Removed hardcoded strings, using constants instead
  • Added more tests to ConstantsTest.class, to make sure these constants are correct

Testing

  • All existing tests pass
  • Added new tests for changes
  • Tests cover edge cases and spec compliance

Pre-submission Checklist

  • My code follows the project's coding standards
  • I have run code formatting/linting tools
  • I have added tests that prove my fix/feature works
  • New and existing tests pass locally
  • I have updated documentation if needed
  • I have reviewed the TOON specification for relevant sections

Breaking Changes

  • No breaking changes
  • Breaking changes (describe migration path below)

@Invokedzz Invokedzz requested a review from a team as a code owner February 4, 2026 15:55
@jenspapenhagen jenspapenhagen self-assigned this Feb 5, 2026
@jenspapenhagen jenspapenhagen merged commit 10445d1 into toon-format:main Feb 5, 2026
1 check passed
@github-actions
Copy link
Contributor

github-actions bot commented Feb 5, 2026

Code Coverage

Overall Project 99.05% 🍏
Files changed 100% 🍏

File Coverage
DecodeHelper.java 100% 🍏
HeaderFormatter.java 100% 🍏
ListItemEncoder.java 100% 🍏
PrimitiveEncoder.java 100% 🍏
ObjectEncoder.java 100% 🍏
ArrayEncoder.java 100% 🍏
LineWriter.java 100% 🍏
Constants.java 100% 🍏
ValueDecoder.java 99.4% 🍏
TabularArrayDecoder.java 99.33% 🍏
ArrayDecoder.java 99.23% 🍏
KeyDecoder.java 98.84% 🍏
ListItemDecoder.java 96.43% 🍏
Flatten.java 94.72% 🍏
PrimitiveDecoder.java 93.27% 🍏

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

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants