https://infracost.io logo
#contributors
Title
# contributors
c

crooked-daybreak-55253

06/30/2021, 12:38 PM
I was thinking about how to make adding resource nicer. @white-airport-8778 suggested a checklist of things to look for that commonly come up in review. I started brainstorming a list and would love some help! What things trip you up or make adding resources not so nice?
This is what I have so far: • case sensitive string comparisons: 
d.Get("kind") ==
 should be 
strings.ToLower(d.Get("kind").String()) ==
• case sensitive regex in price filters: 
ValueRegex: strPtr(fmt.Sprintf("/%s/", deviceType))
 should be 
ValueRegex: strPtr(fmt.Sprintf("/%s/i", deviceType))
• missing anchors in price filter regex: 
fmt.Sprintf("/%s/", x)
 when it should be 
fmt.Sprintf("/^%s$/", x)
• incorrect output capitalization: └─ Data Ingested should be └─ Data ingested • misnamed unit: 
GB-month
 should be 
GB
l

little-author-61621

06/30/2021, 12:42 PM
• having to check
u != nil
before calling
u.Get(...)
w

white-airport-8778

06/30/2021, 12:50 PM
• infracost-usage-example.yml being updated, including a comment to say what the param is for. • check the array length returned by
d.References
to avoid panics (already in contributing guide)
👍 1
5 Views