Switch from 'sanity' to more inclusive lanuage (#9376)

* Switch from 'sanity' to more inclusive lanuage

"Removing ableist language in code is important; it helps to create and
maintain an environment that welcomes all developers of all backgrounds,
while emphasizing that we as developers select the most articulate,
precise, descriptive language we can rather than relying on metaphors.

The phrase sanity check is ableist, and unnecessarily references mental
health in our code bases. It denotes that people with mental illnesses
are inferior, wrong, or incorrect, and the phrase sanity continues to be
used by employers and other individuals to discriminate against these
people."

From https://gist.github.com/seanmhanson/fe370c2d8bd2b3228680e38899baf5cc

Signed-off-by: Bryan Boreham <bjboreham@gmail.com>
This commit is contained in:
Bryan Boreham 2022-11-28 17:09:18 +00:00 committed by GitHub
parent 247201005c
commit 6bdecf377c
No known key found for this signature in database
GPG key ID: 4AEE18F83AFDEB23
7 changed files with 8 additions and 8 deletions

View file

@ -302,7 +302,7 @@ func funcHoltWinters(vals []parser.Value, args parser.Expressions, enh *EvalNode
// The trend factor argument.
tf := vals[2].(Vector)[0].V
// Sanity check the input.
// Check that the input parameters are valid.
if sf <= 0 || sf >= 1 {
panic(fmt.Errorf("invalid smoothing factor. Expected: 0 < sf < 1, got: %f", sf))
}

View file

@ -432,7 +432,7 @@ func (p *parser) expectType(node Node, want ValueType, context string) {
}
}
// checkAST checks the sanity of the provided AST. This includes type checking.
// checkAST checks the validity of the provided AST. This includes type checking.
func (p *parser) checkAST(node Node) (typ ValueType) {
// For expressions the type is determined by their Type function.
// Lists do not have a type but are not invalid either.

View file

@ -491,8 +491,8 @@ func atModifierTestCases(exprStr string, evalTime time.Time) ([]atModifierTestCa
})
if containsNonStepInvariant {
// Since there is a step invariant function, we cannot automatically
// generate step invariant test cases for it sanely.
// Expression contains a function whose result can vary with evaluation
// time, even though its arguments are step invariant: skip it.
return nil, nil
}

View file

@ -77,7 +77,7 @@ type Options struct {
NoLockfile bool
}
// DefaultOptions used for the WAL storage. They are sane for setups using
// DefaultOptions used for the WAL storage. They are reasonable for setups using
// millisecond-precision timestamps.
func DefaultOptions() *Options {
return &Options{

View file

@ -66,7 +66,7 @@ const (
// ErrNotReady is returned if the underlying storage is not ready yet.
var ErrNotReady = errors.New("TSDB not ready")
// DefaultOptions used for the DB. They are sane for setups using
// DefaultOptions used for the DB. They are reasonable for setups using
// millisecond precision timestamps.
func DefaultOptions() *Options {
return &Options{

View file

@ -440,7 +440,7 @@ func (s *memSeries) appendableHistogram(t int64, h *histogram.Histogram) error {
}
// AppendExemplar for headAppender assumes the series ref already exists, and so it doesn't
// use getOrCreate or make any of the lset sanity checks that Append does.
// use getOrCreate or make any of the lset validity checks that Append does.
func (a *headAppender) AppendExemplar(ref storage.SeriesRef, lset labels.Labels, e exemplar.Exemplar) (storage.SeriesRef, error) {
// Check if exemplar storage is enabled.
if !a.head.opts.EnableExemplarStorage || a.head.opts.MaxExemplars.Load() <= 0 {

View file

@ -190,7 +190,7 @@ describe('Utils', () => {
it('renders never for pre-beginning-of-time strings', () => {
expect(formatRelative('0001-01-01T00:00:00Z', now())).toEqual('Never');
});
it('renders a humanized duration for sane durations', () => {
it('renders a humanized duration for durations', () => {
expect(formatRelative('2019-11-04T09:15:29.578701-07:00', parseTime('2019-11-04T09:15:35.8701-07:00'))).toEqual(
'6.292s ago'
);