From a5592b00ae6e505fe6fbde4dc4a29f54121eea02 Mon Sep 17 00:00:00 2001 From: John Kerl Date: Mon, 3 Jan 2022 23:12:51 -0500 Subject: [PATCH] more --- .github/workflows/codespell.yml | 6 ++--- docs/src/shapes-of-data.md | 6 ++--- docs/src/shapes-of-data.md.in | 6 ++--- internal/pkg/auxents/termcvt.go | 44 ++++++++++++++++----------------- todo.txt | 2 +- 5 files changed, 32 insertions(+), 32 deletions(-) diff --git a/.github/workflows/codespell.yml b/.github/workflows/codespell.yml index 21aaa9f0d..d6c9270fe 100644 --- a/.github/workflows/codespell.yml +++ b/.github/workflows/codespell.yml @@ -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 - ignore_words_list: denom,inTerm,inout,iput,nd,nin,numer,Wit,te,wee - # https://github.com/codespell-project/codespell + ignore_words_file: .codespellignore + # ignore_words_list: denom,inout,iput,nd,nin,numer,te,wee skip: "*.csv,*.dkvp,*.txt,*.js,*.html,*.map,./tags,./test/cases" diff --git a/docs/src/shapes-of-data.md b/docs/src/shapes-of-data.md index ff8edb1f8..ee94c63a5 100644 --- a/docs/src/shapes-of-data.md +++ b/docs/src/shapes-of-data.md @@ -46,7 +46,7 @@ Look at the file to find names of fields:
 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
 
@@ -65,7 +65,7 @@ Use XTAB output format to get a sharper picture of where records/fields are bein 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
 
@@ -83,7 +83,7 @@ ES Blanco FI Valkoinen FR Blanc IT Bianco -NL Wit +NL Witter PL Biały RO Alb TR Beyaz diff --git a/docs/src/shapes-of-data.md.in b/docs/src/shapes-of-data.md.in index a2ad7c7c3..30dac18e2 100644 --- a/docs/src/shapes-of-data.md.in +++ b/docs/src/shapes-of-data.md.in @@ -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 diff --git a/internal/pkg/auxents/termcvt.go b/internal/pkg/auxents/termcvt.go index b1edf734b..4fbdafc98 100644 --- a/internal/pkg/auxents/termcvt.go +++ b/internal/pkg/auxents/termcvt.go @@ -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)) } } diff --git a/todo.txt b/todo.txt index 1fd77e447..985daea57 100644 --- a/todo.txt +++ b/todo.txt @@ -5,7 +5,7 @@ PUNCHDOWN LIST * document cloudthings, e.g. o go.yml o codespell.yml - - codespell --ignore-words .codespellignore --skip "*.csv,*.dkvp,*.txt,./tags,./test/cases" + - 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