From 70d6523cd44606d4a056363f69a25eeb641eb431 Mon Sep 17 00:00:00 2001 From: Yaroslav Halchenko Date: Thu, 19 Sep 2024 16:38:43 -0400 Subject: [PATCH 1/5] Add github action to codespell develop on push and PRs --- .github/workflows/codespell.yml | 25 +++++++++++++++++++++++++ 1 file changed, 25 insertions(+) create mode 100644 .github/workflows/codespell.yml diff --git a/.github/workflows/codespell.yml b/.github/workflows/codespell.yml new file mode 100644 index 00000000..7bab9fd6 --- /dev/null +++ b/.github/workflows/codespell.yml @@ -0,0 +1,25 @@ +# Codespell configuration is within .codespellrc +--- +name: Codespell + +on: + push: + branches: [develop] + pull_request: + branches: [develop] + +permissions: + contents: read + +jobs: + codespell: + name: Check for spelling errors + runs-on: ubuntu-latest + + steps: + - name: Checkout + uses: actions/checkout@v4 + - name: Annotate locations with typos + uses: codespell-project/codespell-problem-matcher@v1 + - name: Codespell + uses: codespell-project/actions-codespell@v2 From cce05a4dc7e25eae414d62fdfc1e9dc532697988 Mon Sep 17 00:00:00 2001 From: Yaroslav Halchenko Date: Thu, 19 Sep 2024 16:38:43 -0400 Subject: [PATCH 2/5] Add rudimentary codespell config --- .codespellrc | 6 ++++++ 1 file changed, 6 insertions(+) create mode 100644 .codespellrc diff --git a/.codespellrc b/.codespellrc new file mode 100644 index 00000000..1cd4cac1 --- /dev/null +++ b/.codespellrc @@ -0,0 +1,6 @@ +[codespell] +# Ref: https://github.com/codespell-project/codespell#using-a-config-file +skip = .git*,.codespellrc +check-hidden = true +# ignore-regex = +# ignore-words-list = From 812220e8f7a73aeacd9f61d2eae471401efc2117 Mon Sep 17 00:00:00 2001 From: Yaroslav Halchenko Date: Thu, 19 Sep 2024 16:41:29 -0400 Subject: [PATCH 3/5] adjust config for codespell, ignore highlighter.js entirely for now --- .codespellrc | 6 ++++-- 1 file changed, 4 insertions(+), 2 deletions(-) diff --git a/.codespellrc b/.codespellrc index 1cd4cac1..99601d87 100644 --- a/.codespellrc +++ b/.codespellrc @@ -1,6 +1,8 @@ [codespell] # Ref: https://github.com/codespell-project/codespell#using-a-config-file -skip = .git*,.codespellrc +# highlighter.js includes collections of some keywords many of which are partial words or include typos +skip = .git*,.codespellrc,highlighter.js check-hidden = true -# ignore-regex = +# All caps and some names, super long lines +ignore-regex = \b(Hart|[A-Z]+)\b|.{300,}.* # ignore-words-list = From a06ebd09499b75203a40f48bf1b6f78ea19b7d8e Mon Sep 17 00:00:00 2001 From: Yaroslav Halchenko Date: Thu, 19 Sep 2024 16:41:34 -0400 Subject: [PATCH 4/5] [DATALAD RUNCMD] run codespell throughout fixing typos automagically === Do not change lines below === { "chain": [], "cmd": "codespell -w", "exit": 0, "extra_inputs": [], "inputs": [], "outputs": [], "pwd": "." } ^^^ Do not change lines above ^^^ --- src/remark/components/timer/timer.js | 4 ++-- test/remark/components/timer_test.js | 2 +- test/remark/models/slide_test.js | 2 +- test/remark/parser_test.js | 4 ++-- 4 files changed, 6 insertions(+), 6 deletions(-) diff --git a/src/remark/components/timer/timer.js b/src/remark/components/timer/timer.js index 5bf554c9..e5940cf1 100644 --- a/src/remark/components/timer/timer.js +++ b/src/remark/components/timer/timer.js @@ -6,7 +6,7 @@ module.exports = TimerViewModel; function TimerViewModel(events, element, options) { var self = this; - self.options = extend({}, { enabled: true, resetable: true, startOnChange: true, formatter: defaultFormatter }, options || {}); + self.options = extend({}, { enabled: true, resettable: true, startOnChange: true, formatter: defaultFormatter }, options || {}); self.element = element; self.reset(); @@ -29,7 +29,7 @@ function TimerViewModel(events, element, options) { }); events.on('resetTimer', function () { - if (self.options.resetable) { + if (self.options.resettable) { self.reset(); } }); diff --git a/test/remark/components/timer_test.js b/test/remark/components/timer_test.js index 89b8e0c4..1001b640 100644 --- a/test/remark/components/timer_test.js +++ b/test/remark/components/timer_test.js @@ -73,7 +73,7 @@ describe('Timer', function () { }); it('should respond to a resetTimer event unless \'resetable\' option is set to \'false\'', function () { - timer = new Timer(events, element, { resetable: false }); + timer = new Timer(events, element, { resettable: false }); events.emit('startTimer'); events.emit('resetTimer'); diff --git a/test/remark/models/slide_test.js b/test/remark/models/slide_test.js index 1b1b0312..851024ab 100644 --- a/test/remark/models/slide_test.js +++ b/test/remark/models/slide_test.js @@ -87,7 +87,7 @@ describe('Slide', function () { }) , slide = new Slide(1, 1, { content: [''], - properites: {name: 'b'} + properties: {name: 'b'} }, template); slide.content.should.eql(['{{name}}', '']); diff --git a/test/remark/parser_test.js b/test/remark/parser_test.js index aff65ab7..c08e2ff2 100644 --- a/test/remark/parser_test.js +++ b/test/remark/parser_test.js @@ -244,14 +244,14 @@ describe('Parser', function () { var slides = parser.parse(' 1\n ---\n 2\n ---\n 3'); slides[0].content.should.eql(['1']); - slides[1].content.should.eql([' 2\n']); // Note: lexer includes trailing newines in code blocks + slides[1].content.should.eql([' 2\n']); // Note: lexer includes trailing newlines in code blocks slides[2].content.should.eql(['3']); }); it('should preserve leading whitespace that goes beyond the minimum whitespace on the first line', function () { var slides = parser.parse(' 1\n ---\n 2\n ---\n 3'); - slides[0].content.should.eql([' 1\n']); // Note: lexer includes trailing newines in code blocks + slides[0].content.should.eql([' 1\n']); // Note: lexer includes trailing newlines in code blocks slides[1].content.should.eql(['2']); slides[2].content.should.eql(['3']); }); From 19c951d16a30e9c8eafc52c4a416e0588a83e9a0 Mon Sep 17 00:00:00 2001 From: Yaroslav Halchenko Date: Thu, 19 Sep 2024 16:42:14 -0400 Subject: [PATCH 5/5] A few manual fixups to some typos in highligher.js --- src/remark/highlighter.js | 14 +++++++------- 1 file changed, 7 insertions(+), 7 deletions(-) diff --git a/src/remark/highlighter.js b/src/remark/highlighter.js index da735962..95755fdd 100644 --- a/src/remark/highlighter.js +++ b/src/remark/highlighter.js @@ -32,7 +32,7 @@ https://highlightjs.org/ } }(function(hljs) { - // Convenience variables for build-in objects + // Convenience variables for built-in objects var ArrayProto = [], objectKeys = Object.keys; @@ -3300,7 +3300,7 @@ function(hljs) { //I don't really know if this is totally relevant }, { - className: 'title', //symbol would be most accurate however is higlighted just like built_in and that makes up a lot of AutoHotkey code + className: 'title', //symbol would be most accurate however is highlighted just like built_in and that makes up a lot of AutoHotkey code //meaning that it would fail to highlight anything variants: [ {begin: '^[^\\n";]+::(?!=)'}, @@ -9085,7 +9085,7 @@ function(hljs) { var CONSTRUCTOR = { className: 'type', - begin: '\\b[A-Z][\\w\']*', // TODO: other constructors (build-in, infix). + begin: '\\b[A-Z][\\w\']*', // TODO: other constructors (built-in, infix). relevance: 0 }; @@ -18262,7 +18262,7 @@ function(hljs){ var PS_HELPTAGS = { className: "doctag", variants: [ - /* no paramater help tags */ + /* no parameter help tags */ { begin: /\.(synopsis|description|example|inputs|outputs|notes|link|component|role|functionality)/ }, @@ -18315,7 +18315,7 @@ function(hljs){ ] }; - // Using statment, plus type, plus assembly name. + // Using statement, plus type, plus assembly name. var PS_USING = { begin: /using\s/, end: /$/, returnBegin: true, @@ -23341,7 +23341,7 @@ function(hljs) { PARAMS ] }, - { // prevent references like module.id from being higlighted as module definitions + { // prevent references like module.id from being highlighted as module definitions begin: /module\./, keywords: { built_in: 'module' }, relevance: 0 @@ -24178,7 +24178,7 @@ function(hljs) { /* The lookahead pattern (?=...) ensures that 'begin' only matches ')', end: '>',