rule: a captured value (resource_id) may occur only once over all files #152
Labels
No labels
coordination/cross-repo
coordination/needed
effort
large
effort
medium
effort
small
meta/duplicate
meta/planning
meta/wontfix
priority
high
priority
low
priority
medium
session
blocker
session
handover
session
next
status
blocked
status
done
status
in-progress
status
review
status
to-go
type
admin
type/architecture
type
bug
type
config
type
deployment
type
docs
type/documentation
type
enhancement
type
feature
type
handover
type
infrastructure
type
installation
type
maintenance
type
migration
type
research
type
security
type/task
type/tech-debt
No milestone
No project
No assignees
1 participant
Notifications
Due date
No due date set.
Dependencies
No dependencies set.
Reference
DAW/fragjan#152
Loading…
Add table
Add a link
Reference in a new issue
No description provided.
Delete branch "%!s()"
Deleting a branch is permanent. Although the deleted branch may continue to exist for a short time before it actually gets removed, it CANNOT be undone in most cases. Continue?
Problem
A
resource_idmarks the place where a message arises: one constructionor send site, one
resource_id(rule to be written intodaw_i18n/v1,see the companion issue in DAW/daw-contracts). Nothing checks this. A
copy-pasted site that keeps the old
resource_idgoes unnoticed.A count over the sources (without
test/andlib/) found it already:eight of them in different files
Proposal
A rule for
fragjan code .: a value that is captured by a pattern mayoccur only once over all checked files.
resource_idin Lua sources (a UUID string literal givenas
resource_id = "...", or passed as the id argument of a helper)file:line), not only the second oneexcludeof the[check]section applies as for every rulerule can be used for other values later (e.g. error
codeper module)Questions for the implementation
new check module (
fragjan-check-...)?rules)?
Acceptance criteria
one file are each reported with all sites;
excludeis respectedfragjan code .in daw-module-manager and berhtjan-core reportsthe known duplicates
fragjan code .andmake test(Lua 5.1 and 5.4) passRelated
DAW/daw-contracts (companion issue: one
resource_idper site),DAW/daw-module-manager, DAW/daw-modul-berhtjan-core (duplicates to fix),
DAW/daw-modul-berhtjan-cli#10 (i18n completeness checker)
Done
daw.fragjan.check.valueunique(repo daw-modul-fragjan-check-valueunique, v0.1.0): a captured value may occur only once over all given files, every occurrence is reported with file:linetarget_type: files(DAW/fragjan, commita658214): all collected files go to the primitive in one call, suppress comments apply per reported matchunique-resource-idin packdaw-lua-code(DAW/fragjan-templates, commit 8c45c29)make testgreen on Lua 5.1 and 5.4Follow-ups (not part of this issue)
module.confof valueunique: raiseminfor fragjan to the release that contains the runner moderesource_idper error site