.TH "doc_api_review_core_keySetName_md" 3elektra "Mon Jan 9 2023" "Version 0.9.11" "Elektra" \" -*- nroff -*-
.ad l
.nh
.SH NAME
doc_api_review_core_keySetName_md \- keySetName 

.IP "\(bu" 2
start = 2021-02-14 03:30
.IP "\(bu" 2
end = 2021-02-14 03:50
.IP "\(bu" 2
reviewer = Stefan Hanreich stefanhani@gmail.com
.PP
.SH "Signature"
.PP
\fCssize_t \fBkeySetName(Key *key, const char *newname)\fP\fP
.SH "Checklist"
.PP
.SS "Doxygen"
(bullet points are in order of appearance)
.PP
.IP "\(bu" 2
[x] First line explains briefly what the function does
.IP "\(bu" 2
[ ] Simple example or snippet how to use the function 
.br
.IP "  \(bu" 4
[ ] add
.PP

.IP "\(bu" 2
[ ] Longer description of function containing common use cases
.IP "\(bu" 2
[ ] Description of functions reads nicely
.IP "\(bu" 2
[ ] \fC@pre\fP 
.br
.IP "  \(bu" 4
[ ] 
.PP
\fBPrecondition\fP
.RS 4
newName must be a valid name 
.br
.RE
.PP

.IP "  \(bu" 4
[ ] 
.PP
\fBPrecondition\fP
.RS 4
must not be a read-only key 
.br
.RE
.PP

.IP "  \(bu" 4
[ ] 
.PP
\fBPrecondition\fP
.RS 4
must not have been inserted before
.RE
.PP

.PP

.IP "\(bu" 2
[ ] \fC@post\fP 
.br
.IP "  \(bu" 4
[ ] 
.PP
\fBPostcondition\fP
.RS 4
Key has (possibly modified) newName as name
.RE
.PP

.PP

.IP "\(bu" 2
[ ] \fC@invariant\fP 
.br
.IP "  \(bu" 4
[ ] add
.PP

.IP "\(bu" 2
[x] \fC@param\fP for every parameter
.IP "\(bu" 2
[ ] \fC@return\fP / \fC@retval\fP 
.br
.IP "  \(bu" 4
[ ] add \fC@retval\fP -1 if key is read-only
.PP

.IP "\(bu" 2
[ ] \fC@since\fP 
.br
.IP "  \(bu" 4
[ ] add
.PP

.IP "\(bu" 2
[x] \fC@ingroup\fP
.IP "\(bu" 2
[ ] \fC@see\fP 
.br
.IP "  \(bu" 4
[ ] add \fCkeySetNameSpace()\fP
.PP

.PP
.SS "Naming"
.IP "\(bu" 2
[x] Abbreviations used in function names must be defined in the \fBGlossary\fP
.IP "\(bu" 2
[x] Function names should neither be too long, nor too short
.IP "\(bu" 2
[x] Function name should be clear and unambiguous
.IP "\(bu" 2
[x] Abbreviations used in parameter names must be defined in the \fBGlossary\fP
.IP "\(bu" 2
[x] Parameter names should neither be too long, nor too short
.IP "\(bu" 2
[x] Parameter names should be clear and unambiguous
.PP
.SS "Compatibility"
(only in PRs)
.PP
.IP "\(bu" 2
\fBSymbol versioning\fP is correct for breaking changes
.IP "\(bu" 2
ABI/API changes are forward-compatible (breaking backwards-compatibility to add additional symbols is fine)
.PP
.SS "Parameter & Return Types"
.IP "\(bu" 2
[x] Function parameters should use enum types instead of boolean types wherever sensible
.IP "\(bu" 2
[x] Wherever possible, function parameters should be \fCconst\fP
.IP "\(bu" 2
[ ] Wherever possible, return types should be \fCconst\fP 
.br
.IP "  \(bu" 4
[ ] might be possible to make it \fCconst\fP
.PP

.IP "\(bu" 2
[x] Functions should have the least amount of parameters feasible
.PP
.SS "Structural Clarity"
.IP "\(bu" 2
[x] Functions should do exactly one thing
.IP "\(bu" 2
[x] Function name has the appropriate prefix
.IP "\(bu" 2
[ ] Order of signatures in kdb\&.h\&.in is the same as Doxygen 
.br
.IP "  \(bu" 4
[ ] swapped with functions for unescaped
.PP

.IP "\(bu" 2
[x] No functions with similar purpose exist
.PP
.SS "Memory Management"
.IP "\(bu" 2
[x] Memory Management should be handled by the function wherever possible
.PP
.SS "Extensibility"
.IP "\(bu" 2
[x] Function is easily extensible, e\&.g\&., with flags
.IP "\(bu" 2
[ ] Documentation does not impose limits, that would hinder further extensions 
.br
.IP "  \(bu" 4
[ ] behavior on invalid names
.PP

.PP
.SS "Tests"
.IP "\(bu" 2
[ ] Function code is fully covered by tests 
.br
.IP "  \(bu" 4
[x] test_bit 'CANNOT' fail, so might not be necessary to cover this 
.br
 for now should be made more resistant to future changes
.PP

.IP "\(bu" 2
[ ] All possible error states are covered by tests 
.br
.IP "  \(bu" 4
[x] test read-only keys
.PP

.IP "\(bu" 2
All possible enum values are covered by tests
.IP "\(bu" 2
[ ] No inconsistencies between tests and documentation 
.br
.IP "  \(bu" 4
[x] https://github.com/ElektraInitiative/libelektra/blob/master/tests/abi/testabi_key.c#L357 
.br
 checks for -1 if null pointer is provided 
.br
 documentation says 0 will be returned 
.br

.IP "  \(bu" 4
[x] Documentation says name will be \fC''\fP after an invalid name 
.br
 Tests show that name stays unchanged 
.br
 https://github.com/ElektraInitiative/libelektra/blob/master/tests/abi/testabi_key.c#L601 
.br

.IP "  \(bu" 4
[x] Documentations should include stripping trailing \fC/\fP
.PP

.PP
.SH "Summary"
.PP
.SH "Other Issues discovered (unrelated to function)"
.PP

