🔧 feat: Normalize artifact names to uppercase with proper spacing#1948
🔧 feat: Normalize artifact names to uppercase with proper spacing#1948
Conversation
There was a problem hiding this comment.
Pull request overview
This PR normalizes artifact names in the codebase to use uppercase with proper spacing for consistency. The changes update the ArtifactMap keys from PascalCase (e.g., "CarbonFiber") to uppercase with spaces (e.g., "CARBON FIBER"), and add two new artifact entries (P.E.G.G. and SILICON). Transformation logic is also added in two locations to convert legacy artifact names to the new format.
- Updated 7 artifact keys in ArtifactMap from PascalCase to uppercase with spaces
- Added 2 new artifact entries (P.E.G.G. and SILICON)
- Added transformation logic in boost.go and artifacts.go to convert legacy names to uppercase format
Reviewed changes
Copilot reviewed 3 out of 3 changed files in this pull request and generated 3 comments.
| File | Description |
|---|---|
| src/ei/ei_artifacts.go | Updated ArtifactMap keys from PascalCase to uppercase with spaces for 7 artifacts, and added 2 new artifact entries (P.E.G.G. and SILICON) |
| src/boost/boost.go | Added transformation logic to convert artifact names to uppercase and handle spacing for CARBONFIBER and FLAMERETARDANT in getUserArtifacts function |
| src/boost/artifacts.go | Added transformation logic to convert artifact names to uppercase and handle spacing for CARBONFIBER and FLAMERETARDANT in getArtifactsComponents function |
| art = strings.ReplaceAll(art, "FLAMERETARDANT", "FLAME RETARDANT") | ||
|
|
There was a problem hiding this comment.
The code transforms "FLAMERETARDANT" to "FLAME RETARDANT", but there is no corresponding entry for "FLAME RETARDANT" in the ArtifactMap in ei_artifacts.go. This will cause artifact lookups to fail for this artifact type. Either add "FLAME RETARDANT" to the ArtifactMap or remove this transformation if it's not needed.
| art = strings.ReplaceAll(art, "FLAMERETARDANT", "FLAME RETARDANT") |
| coll = strings.ReplaceAll(coll, "FlameRetardant", "Flame Retardant") | ||
| coll = strings.ToUpper(coll) | ||
| coll = strings.ReplaceAll(coll, "CARBONFIBER", "CARBON FIBER") | ||
| coll = strings.ReplaceAll(coll, "FLAMERETARDANT", "FLAME RETARDANT") |
There was a problem hiding this comment.
The code transforms "FLAMERETARDANT" to "FLAME RETARDANT", but there is no corresponding entry for "FLAME RETARDANT" in the ArtifactMap in ei_artifacts.go. This will cause artifact lookups to fail for this artifact type. Either add "FLAME RETARDANT" to the ArtifactMap or remove this transformation if it's not needed.
| coll = strings.ReplaceAll(coll, "FLAMERETARDANT", "FLAME RETARDANT") | |
| // coll = strings.ReplaceAll(coll, "FLAMERETARDANT", "FLAME RETARDANT") |
| art = strings.ReplaceAll(art, "CARBONFIBER", "CARBON FIBER") | ||
| art = strings.ReplaceAll(art, "FLAMERETARDANT", "FLAME RETARDANT") | ||
|
|
||
| if a != "" { |
There was a problem hiding this comment.
The transformation logic has a critical bug: the variable art is being reassigned but the condition on line 722 still checks the original variable a. This means the transformed uppercase value with proper spacing will never be used in the lookup. The condition should check art != "" instead of a != "".
| if a != "" { | |
| if art != "" { |
No description provided.