Fix codespell config to skip multiple files (#837)

* trying to get codespell to trigger before merge to main

* iterating

* https://github.com/codespell-project/actions-codespell

* iterating

* iterating

* iterating

* iterating

* iterating

* more

* more

* more
This commit is contained in:
John Kerl 2022-01-03 23:16:43 -05:00 committed by GitHub
parent eac9275a41
commit 0c75713b94
No known key found for this signature in database
GPG key ID: 4AEE18F83AFDEB23
32 changed files with 71 additions and 64 deletions

View file

@ -6,3 +6,5 @@ nd
nin
numer
Wit
te
wee

View file

@ -27,11 +27,11 @@ jobs:
fetch-depth: 0
# Run linter against code base
# https://github.com/codespell-project/codespell
- name: Codespell
uses: codespell-project/actions-codespell@master
with:
check_filenames: true
ignore_words_file: .codespellignore
skip:
- "**/*.csv"
- "**/*.txt"
# ignore_words_list: denom,inout,iput,nd,nin,numer,te,wee
skip: "*.csv,*.dkvp,*.txt,*.js,*.html,*.map,./tags,./test/cases"

View file

@ -382,7 +382,7 @@ You can read more about this in the [arithmetic reference](reference-main-arithm
## Absent data
In addition to types including string, number (int/float), maps, and arrays,
Miller varibles can also be **absent**. This is when a variable never had a
Miller variables can also be **absent**. This is when a variable never had a
value assigned to it. Miller's treatment of absent data is intended to make it
easy for you to handle [non-homogeneous data](record-heterogeneity.md). We'll
see more in the [null-data reference](reference-main-null-data.md) but the

View file

@ -188,7 +188,7 @@ You can read more about this in the [arithmetic reference](reference-main-arithm
## Absent data
In addition to types including string, number (int/float), maps, and arrays,
Miller varibles can also be **absent**. This is when a variable never had a
Miller variables can also be **absent**. This is when a variable never had a
value assigned to it. Miller's treatment of absent data is intended to make it
easy for you to handle [non-homogeneous data](record-heterogeneity.md). We'll
see more in the [null-data reference](reference-main-null-data.md) but the

View file

@ -38,7 +38,7 @@ respectively.
The [`select`](reference-dsl-builtin-functions.md#select) function takes a map
or array as its first argument and a function as second argument. It includes
each input element in the ouptut if the function returns true.
each input element in the output if the function returns true.
For arrays, that function should take one argument, for array element; for
maps, it should take two, for map-element key and value. In either case it
@ -776,7 +776,7 @@ Sorted, then cubed, then summed:
### Remember return
From other languages it's easy to accidentially write
From other languages it's easy to accidentally write
<pre class="pre-highlight-in-pair">
<b>mlr -n put 'end { print select([1,2,3,4,5], func (e) { e >= 3 })}'</b>

View file

@ -22,7 +22,7 @@ respectively.
The [`select`](reference-dsl-builtin-functions.md#select) function takes a map
or array as its first argument and a function as second argument. It includes
each input element in the ouptut if the function returns true.
each input element in the output if the function returns true.
For arrays, that function should take one argument, for array element; for
maps, it should take two, for map-element key and value. In either case it
@ -426,7 +426,7 @@ GENMD-EOF
### Remember return
From other languages it's easy to accidentially write
From other languages it's easy to accidentally write
GENMD-RUN-COMMAND-TOLERATING-ERROR
mlr -n put 'end { print select([1,2,3,4,5], func (e) { e >= 3 })}'

View file

@ -19,7 +19,7 @@ Quick links:
Dates/times are not a separate data type; Miller uses ints for
[seconds since the epoch](https://en.wikipedia.org/wiki/Unix_time) and strings for formatted
date/times. In this page we take a look at what some of the various options are
for processing datetimes andd timezones in your data.
for processing datetimes and timezones in your data.
See also the [section on time-related
functions](reference-dsl-builtin-functions.md#time-functions) for
@ -43,7 +43,7 @@ they're independent of timezone or daylight-savings time.
One minus is that, being just numbers, they're not particularly human-readable
-- hence the to-string and from-string functions described below. Another
caveat (not really a minus) is that _epoch milliseconds_, rather than epoch
seconds, are common in some contexts, particulary JavaScript. If you ever
seconds, are common in some contexts, particularly JavaScript. If you ever
(anywhere) see a timestamp for the year 49,000-something -- probably someone is
treating epoch-milliseconds as epoch-seconds.

View file

@ -3,7 +3,7 @@
Dates/times are not a separate data type; Miller uses ints for
[seconds since the epoch](https://en.wikipedia.org/wiki/Unix_time) and strings for formatted
date/times. In this page we take a look at what some of the various options are
for processing datetimes andd timezones in your data.
for processing datetimes and timezones in your data.
See also the [section on time-related
functions](reference-dsl-builtin-functions.md#time-functions) for
@ -27,7 +27,7 @@ they're independent of timezone or daylight-savings time.
One minus is that, being just numbers, they're not particularly human-readable
-- hence the to-string and from-string functions described below. Another
caveat (not really a minus) is that _epoch milliseconds_, rather than epoch
seconds, are common in some contexts, particulary JavaScript. If you ever
seconds, are common in some contexts, particularly JavaScript. If you ever
(anywhere) see a timestamp for the year 49,000-something -- probably someone is
treating epoch-milliseconds as epoch-seconds.

View file

@ -46,7 +46,7 @@ Look at the file to find names of fields:
</pre>
<pre class="pre-non-highlight-in-pair">
KEY;DE;EN;ES;FI;FR;IT;NL;PL;RO;TR
masterdata_colourcode_1;Weiß;White;Blanco;Valkoinen;Blanc;Bianco;Wit;Biały;Alb;Beyaz
masterdata_colourcode_1;Weiß;White;Blanco;Valkoinen;Blanc;Bianco;Witter;Biały;Alb;Beyaz
masterdata_colourcode_2;Schwarz;Black;Negro;Musta;Noir;Nero;Zwart;Czarny;Negru;Siyah
</pre>
@ -65,7 +65,7 @@ Use XTAB output format to get a sharper picture of where records/fields are bein
<b>mlr --icsv --oxtab cat data/colours.csv </b>
</pre>
<pre class="pre-non-highlight-in-pair">
KEY;DE;EN;ES;FI;FR;IT;NL;PL;RO;TR masterdata_colourcode_1;Weiß;White;Blanco;Valkoinen;Blanc;Bianco;Wit;Biały;Alb;Beyaz
KEY;DE;EN;ES;FI;FR;IT;NL;PL;RO;TR masterdata_colourcode_1;Weiß;White;Blanco;Valkoinen;Blanc;Bianco;Witter;Biały;Alb;Beyaz
KEY;DE;EN;ES;FI;FR;IT;NL;PL;RO;TR masterdata_colourcode_2;Schwarz;Black;Negro;Musta;Noir;Nero;Zwart;Czarny;Negru;Siyah
</pre>
@ -83,7 +83,7 @@ ES Blanco
FI Valkoinen
FR Blanc
IT Bianco
NL Wit
NL Witter
PL Biały
RO Alb
TR Beyaz

View file

@ -26,7 +26,7 @@ Look at the file to find names of fields:
GENMD-CARDIFY-HIGHLIGHT-ONE
cat data/colours.csv
KEY;DE;EN;ES;FI;FR;IT;NL;PL;RO;TR
masterdata_colourcode_1;Weiß;White;Blanco;Valkoinen;Blanc;Bianco;Wit;Biały;Alb;Beyaz
masterdata_colourcode_1;Weiß;White;Blanco;Valkoinen;Blanc;Bianco;Witter;Biały;Alb;Beyaz
masterdata_colourcode_2;Schwarz;Black;Negro;Musta;Noir;Nero;Zwart;Czarny;Negru;Siyah
GENMD-EOF
@ -41,7 +41,7 @@ Use XTAB output format to get a sharper picture of where records/fields are bein
GENMD-CARDIFY-HIGHLIGHT-ONE
mlr --icsv --oxtab cat data/colours.csv
KEY;DE;EN;ES;FI;FR;IT;NL;PL;RO;TR masterdata_colourcode_1;Weiß;White;Blanco;Valkoinen;Blanc;Bianco;Wit;Biały;Alb;Beyaz
KEY;DE;EN;ES;FI;FR;IT;NL;PL;RO;TR masterdata_colourcode_1;Weiß;White;Blanco;Valkoinen;Blanc;Bianco;Witter;Biały;Alb;Beyaz
KEY;DE;EN;ES;FI;FR;IT;NL;PL;RO;TR masterdata_colourcode_2;Schwarz;Black;Negro;Musta;Noir;Nero;Zwart;Czarny;Negru;Siyah
GENMD-EOF
@ -57,7 +57,7 @@ ES Blanco
FI Valkoinen
FR Blanc
IT Bianco
NL Wit
NL Witter
PL Biały
RO Alb
TR Beyaz

View file

@ -1,5 +1,5 @@
// ================================================================
// TOOO
// TODO
// ================================================================
package regtest

View file

@ -98,7 +98,7 @@ FILENAME="foo.dat",FILENUM=1,NR=1,FNR=1
This is a small modification around the [CST](../../dsl/cst/) and the [`put` verb](../../transformers/put_or_filter.go).. Most of the keystroking here is for online help and command-line parsing.
One subtlety is that non-assignment expressions like `NR < 10` are filter statements within `put` -- they can be used to control whether or not a given record is included in the outut stream. Here, in the REPL, these expressions are simply printed to the terminal. And for `:skip until ...` or `:process until ...`, they're used as the exit condition to break out of reading input records.
One subtlety is that non-assignment expressions like `NR < 10` are filter statements within `put` -- they can be used to control whether or not a given record is included in the output stream. Here, in the REPL, these expressions are simply printed to the terminal. And for `:skip until ...` or `:process until ...`, they're used as the exit condition to break out of reading input records.
# File structure

View file

@ -81,7 +81,7 @@ func (repl *Repl) handleDSLStringAux(
repl.runtimeState.Inrec = outrec
// The filter expression for the main Miller DSL is any non-assignment
// statment like 'true' or '$x > 0.5' etc. For the REPL, we re-use this for
// statement like 'true' or '$x > 0.5' etc. For the REPL, we re-use this for
// interactive expressions to be printed to the terminal. For the main DSL,
// the default is mlrval.FromTrue(); for the REPL, the default is
// mlrval.VOID.

View file

@ -1,7 +1,7 @@
// ================================================================
// Top-level handler for a REPL session, including setup/construction, and
// ingesting command-lines. Command-line strings are triaged and send off to
// the appropriate handlers: DSL parse/execute if the comand is a DSL statement
// the appropriate handlers: DSL parse/execute if the command is a DSL statement
// (like '$z = $x + $y'); REPL-command-line parse/execute otherwise (like
// ':open foo.dat' or ':help').
//
@ -66,7 +66,7 @@ func NewRepl(
runtimeState := runtime.NewEmptyState(options)
runtimeState.Update(inrec, context)
// The filter expression for the main Miller DSL is any non-assignment
// statment like 'true' or '$x > 0.5' etc. For the REPL, we re-use this for
// statement like 'true' or '$x > 0.5' etc. For the REPL, we re-use this for
// interactive expressions to be printed to the terminal. For the main DSL,
// the default is mlrval.FromTrue(); for the REPL, the default is
// mlrval.VOID.

View file

@ -165,7 +165,7 @@ func handleLoad(repl *Repl, args []string) bool {
// ----------------------------------------------------------------
func usageOpen(repl *Repl) {
fmt.Printf(
":open {one or more data-file names in the format specifed by %s %s}.\n",
":open {one or more data-file names in the format specified by %s %s}.\n",
repl.exeName, repl.replName,
)
fmt.Print(
@ -515,7 +515,7 @@ func handleSkipOrProcessUntil(repl *Repl, dslString string, processingNotSkippin
repl,
recordAndContext,
processingNotSkipping,
true, // testingByFilterExpression -- since we're continuing until the filter expresssion is true
true, // testingByFilterExpression -- since we're continuing until the filter expression is true
)
if shouldBreak {
break
@ -597,7 +597,7 @@ func skipOrProcessRecord(
// ----------------------------------------------------------------
func usageWrite(repl *Repl) {
fmt.Println(":write with no arguments.")
fmt.Println("Sends the current record (maybe modifed by statements you enter)")
fmt.Println("Sends the current record (maybe modified by statements you enter)")
fmt.Printf("to standard output, with format as specified by %s %s.\n",
repl.exeName, repl.replName)
}

View file

@ -26,8 +26,8 @@ func termcvtUsage(verbName string, o *os.File, exitCode int) {
}
func termcvtMain(args []string) int {
inTerm := "\n"
outTerm := "\n"
inputTerminator := "\n"
outputTerminator := "\n"
doInPlace := false
// 'mlr' and 'termcvt' are already argv[0] and argv[1].
@ -49,30 +49,30 @@ func termcvtMain(args []string) int {
} else if opt == "-I" {
doInPlace = true
} else if opt == "--cr2crlf" {
inTerm = "\r"
outTerm = "\r\n"
inputTerminator = "\r"
outputTerminator = "\r\n"
} else if opt == "--lf2crlf" {
inTerm = "\n"
outTerm = "\r\n"
inputTerminator = "\n"
outputTerminator = "\r\n"
} else if opt == "--crlf2cr" {
inTerm = "\r\n"
outTerm = "\r"
inputTerminator = "\r\n"
outputTerminator = "\r"
} else if opt == "--lf2cr" {
inTerm = "\n"
outTerm = "\r"
inputTerminator = "\n"
outputTerminator = "\r"
} else if opt == "--crlf2lf" {
inTerm = "\r\n"
outTerm = "\n"
inputTerminator = "\r\n"
outputTerminator = "\n"
} else if opt == "--cr2lf" {
inTerm = "\r"
outTerm = "\n"
inputTerminator = "\r"
outputTerminator = "\n"
} else {
termcvtUsage(verb, os.Stderr, 1)
}
}
if len(args) == 0 {
termcvtFile(os.Stdin, os.Stdout, inTerm, outTerm)
termcvtFile(os.Stdin, os.Stdout, inputTerminator, outputTerminator)
} else if doInPlace {
for _, filename := range args {
@ -94,7 +94,7 @@ func termcvtMain(args []string) int {
os.Exit(1)
}
termcvtFile(istream, ostream, inTerm, outTerm)
termcvtFile(istream, ostream, inputTerminator, outputTerminator)
istream.Close()
// TODO: check return status
@ -118,7 +118,7 @@ func termcvtMain(args []string) int {
os.Exit(1)
}
termcvtFile(istream, os.Stdout, inTerm, outTerm)
termcvtFile(istream, os.Stdout, inputTerminator, outputTerminator)
istream.Close()
}
@ -126,12 +126,12 @@ func termcvtMain(args []string) int {
return 0
}
func termcvtFile(istream *os.File, ostream *os.File, inTerm string, outTerm string) {
func termcvtFile(istream *os.File, ostream *os.File, inputTerminator string, outputTerminator string) {
lineReader := bufio.NewReader(istream)
inTermFinal := []byte(inTerm[len(inTerm)-1:])[0] // bufio.Reader.ReadString takes char not string delimiter :(
inputTerminatorBytes := []byte(inputTerminator[len(inputTerminator)-1:])[0] // bufio.Reader.ReadString takes char not string delimiter :(
for {
line, err := lineReader.ReadString(inTermFinal)
line, err := lineReader.ReadString(inputTerminatorBytes)
if err == io.EOF {
break
}
@ -143,7 +143,7 @@ func termcvtFile(istream *os.File, ostream *os.File, inTerm string, outTerm stri
}
// This is how to do a chomp:
line = strings.TrimRight(line, inTerm)
ostream.Write([]byte(line + outTerm))
line = strings.TrimRight(line, inputTerminator)
ostream.Write([]byte(line + outputTerminator))
}
}

View file

@ -202,7 +202,7 @@ func BIF_minus_binary(input1, input2 *mlrval.Mlrval) *mlrval.Mlrval {
// 2**63-1 (or is less than -2**63) using integer arithmetic (it may have
// already overflowed) *or* using double-precision (granularity). Instead we
// check if the absolute value of the product exceeds the largest representable
// double less than 2**63. (An alterative would be to do all integer multiplies
// double less than 2**63. (An alternative would be to do all integer multiplies
// using handcrafted multi-word 128-bit arithmetic).
func times_n_ii(input1, input2 *mlrval.Mlrval) *mlrval.Mlrval {

View file

@ -659,7 +659,7 @@ func BIF_append(input1, input2 *mlrval.Mlrval) *mlrval.Mlrval {
}
// ----------------------------------------------------------------
// First argumemnt is prefix.
// First argument is prefix.
// Second argument is delimiter.
// Third argument is map or array.
// flatten("a", ".", {"b": { "c": 4 }}) is {"a.b.c" : 4}.

View file

@ -301,7 +301,7 @@ func parseCommandLinePassTwo(
options,
true, // false for first pass of CLI-parse, true for second pass -- this is the first pass
)
// Unparseable verb-setups should have been found in pass one.
// Unparsable verb-setups should have been found in pass one.
lib.InternalCodingErrorIf(transformer == nil)
// Make sure we consumed the entire verb sequence as parsed by pass one.
lib.InternalCodingErrorIf(argi != argc)

View file

@ -59,7 +59,7 @@ func maybeInterpolateDashS(args []string) []string {
}
// TODO: maybe support comment lines deeper within the script-file.
// Make sure they're /^[\s]+#/ since we dont' want to disrupt a "#" within
// Make sure they're /^[\s]+#/ since we don't want to disrupt a "#" within
// strings which are not actually comment characters.
// Re-join lines to strings, and pass off to a shell-parser to split into

View file

@ -185,7 +185,7 @@ func (reader *RecordReaderJSON) processHandle(
//
// Miller lets users (on an opt-in basis) have comments in their data files,
// for all formats including JSON. Comments are only honored at start of line.
// Users can have them be printed to stdout straightaway, or simply discarded.
// Users can have them be printed to stdout straight away, or simply discarded.
//
// For most file formats Miller is doing line-based I/O and can deal with
// comment lines easily and simply. But for JSON, the Go library needs an

View file

@ -26,7 +26,7 @@ var unbackslashReplacements = map[byte]string{
'?': "?",
}
// UnbackslashStringLiteral replaces "\t" with TAB, etc. for DSL expresions
// UnbackslashStringLiteral replaces "\t" with TAB, etc. for DSL expressions
// like '$foo = "a\tb"'. See also
// https://en.wikipedia.org/wiki/Escape_sequences_in_C
// (predates the port of Miller from C to Go).

View file

@ -7,7 +7,7 @@ package mlrval
// MlrvalFromPending is designed solely for the JSON API, for something
// intended to be mutated after construction once its type is (later) known.
// Whereas ERROR, ABSENT, etc are all singletons, this one
// must be mutable and therefor non-singleton.
// must be mutable and therefore non-singleton.
func MlrvalFromPending() Mlrval {
return Mlrval{

View file

@ -209,7 +209,7 @@ func MlrvalDecodeFromJSON(decoder *json.Decoder) (
if !key.IsString() {
return nil, false, fmt.Errorf(
// TODO: print out what was gotten
"mlr JSON reader: obejct keys must be string-valued.",
"mlr JSON reader: object keys must be string-valued.",
)
}

View file

@ -147,7 +147,7 @@ var TYPE_NAMES = [MT_DIM]string{
"int",
"float",
"bool",
"empty", // For backward compatiblity with the C impl: this is user-visible
"empty", // For backward compatibility with the C impl: this is user-visible
"string",
"array",
"map",

View file

@ -49,7 +49,7 @@ type MultiOutputHandlerManager struct {
// For stdout or stderr
singleHandler *FileOutputHandler
// TOOD: make an enum
// TODO: make an enum
append bool // True for ">>", false for ">" and "|"
pipe bool // True for "|", false for ">" and ">>"
recordWriterOptions *cli.TWriterOptions

View file

@ -338,7 +338,7 @@ Root
;
// ----------------------------------------------------------------
// A StatementBlock is a sequence of statemnts: either the stuff in between
// A StatementBlock is a sequence of statements: either the stuff in between
// (but not including) the curly braces in things like 'if (NR > 2) { $x = 1;
// $y = 2 }', or, top-level Miller DSL statements like '$x = 1; $y = 2'.

View file

@ -1,3 +1,3 @@
// Package runtime contains state for the concrete-syntax-tree executor which
// runs user-specifed statements in the Miller domain-specific langauge.
// runs user-specifed statements in the Miller domain-specific language.
package runtime

View file

@ -138,7 +138,7 @@ func (tr *TransformerBootstrap) Transform(
//
// However, in Go, there is concurrent processing. It would be
// possible for us to emit a pointer to a particular record without
// copying, then when emitting that saem record a second time, copy it.
// copying, then when emitting that same record a second time, copy it.
// But due to concurrency, the pointed-to record could have already
// been mutated downstream. We wouldn't be copying our input as we
// received it -- we'd be copying something potentially modified.

View file

@ -129,7 +129,7 @@ func (tr *TransformerShuffle) Transform(
images[u] = images[i]
images[i] = temp
// Decrease the size of the pool by 1. (Yes, unusedStart and k always have the same value.
// Using two variables wastes neglible memory and makes the code easier to understand.)
// Using two variables wastes negligible memory and makes the code easier to understand.)
unusedStart++
numUnused--
}

View file

@ -326,7 +326,7 @@ func (keeper *JoinBucketKeeper) FindJoinBucket(
}
// ----------------------------------------------------------------
// This finds the first peek record which posseses all the necessary join-field
// This finds the first peek record which possesses all the necessary join-field
// keys. Any other records found along the way, lacking the necessary
// join-field keys, are moved to the left-unpaired list.

View file

@ -2,6 +2,11 @@
PUNCHDOWN LIST
* compat emph
* document cloudthings, e.g.
o go.yml
o codespell.yml
- codespell --check-filenames --skip *.csv,*.dkvp,*.txt,*.js,*.html,*.map,./tags,./test/cases --ignore-words-list denom,inTerm,inout,iput,nd,nin,numer,Wit,te,wee
o readthedocs triggers
* doc
o new-in-miller-6: missing: