✏ Make codespell pre-commit check pass

This commit is contained in:
Gina Häußge committed 2022-08-03 11:41:13 +02:00
1 parent 75cb5930ac
commit 62efcee4dd
8 files changed
+20 -20

No files matched your search

+2 -2
View File
@@ -30,7 +30,7 @@
.. code-block:: javascript
OctoPrint.util.testPath("/som/path/to/a/file")
OctoPrint.util.testPath("/some/path/to/a/file")
.done(function(response) {
if (response.result) {
// check passed
@@ -45,7 +45,7 @@
.. code-block:: javascript
OctoPrint.util.testPath("/som/path/to/a/file", {"check_type": "file", "check_access": ["r", "x"]})
OctoPrint.util.testPath("/some/path/to/a/file", {"check_type": "file", "check_access": ["r", "x"]})
.done(function(response) {
if (response.result) {
// check passed
+1 -1
View File
@@ -35,7 +35,7 @@ known_first_party =
octoprint_client
[codespell]
skip = *.po,*.min.js,.git,*/vendor,*/lib,*/bootstrap,*/node_modules,*/translations,*/venv*,*/.*,*/build,*/_build,setup.cfg,AUTHORS.md
skip = *.po,*.min.js,.git,*/vendor/*,*/lib/*,*/bootstrap/*,*/node_modules/*,*/translations/*,*/venv*,*/.*,*/build/*,*/_build/*,setup.cfg,AUTHORS.md
ignore-words = .codespell_ignore_words
quiet-level = 3
count =
@@ -17,7 +17,7 @@ class GcodeviewerPlugin(
"js/viewer/ui.js",
"js/viewer/reader.js",
"js/viewer/renderer.js",
"js/viewer/pako.js",
"js/lib/pako.js",
]
return {
+4 -4
View File
@@ -1487,19 +1487,19 @@ class Server:
return html_header_regex.sub(repl, s)
markdown_header_regex = re.compile(
r"^(?P<hashs>#+)\s+(?P<content>.*)$", flags=re.MULTILINE
r"^(?P<hashes>#+)\s+(?P<content>.*)$", flags=re.MULTILINE
)
def offset_markdown_headers(s, offset):
def repl(match):
number = len(match.group("hashs"))
number = len(match.group("hashes"))
number += offset
if number > 6:
number = 6
elif number < 1:
number = 1
return "{hashs} {content}".format(
hashs="#" * number, content=match.group("content")
return "{hashes} {content}".format(
hashes="#" * number, content=match.group("content")
)
return markdown_header_regex.sub(repl, s)
+2 -2
View File
@@ -444,7 +444,7 @@ $(function () {
};
}
// make sure we have atleast a function
// make sure we have at least a function
if (!_.isFunction(viewModel.construct)) {
log.error("No function to instantiate with", viewModel);
continue;
@@ -533,7 +533,7 @@ $(function () {
}
}
// anything that's now in the postponed list has to be readded to the unprocessedViewModels
// anything that's now in the postponed list has to be re-added to the unprocessedViewModels
unprocessedViewModels = unprocessedViewModels.concat(postponed);
// if we still have the same amount of items in our list of unprocessed view models it means that we
+4 -4
View File
@@ -85,13 +85,13 @@ class SelectedFilesLoader(BaseLoader):
mtime = os.path.getmtime(path)
def uptodate():
def up_to_date():
try:
return os.path.getmtime(path) == mtime
except OSError:
return False
return contents, path, uptodate
return contents, path, up_to_date
def list_templates(self):
return self.files.keys()
@@ -136,11 +136,11 @@ class WarningLoader(BaseLoader):
import logging
try:
contents, filename, uptodate = self.loader.get_source(environment, template)
contents, filename, up_to_date = self.loader.get_source(environment, template)
logging.getLogger(__name__).warning(
self.warning_message.format(template=template, filename=filename)
)
return contents, filename, uptodate
return contents, filename, up_to_date
except TemplateNotFound:
raise
+6 -6
View File
@@ -992,27 +992,27 @@ QUnit.cases(
},
{
title: "Text",
input: "text",
input: "abcd",
sep: undefined,
stripEmpty: false,
filter: undefined,
expected: ["text"]
expected: ["abcd"]
},
{
title: "TextSeparator",
input: "te#xt",
input: "ab#cd",
sep: "#",
stripEmpty: false,
filter: undefined,
expected: ["te", "xt"]
expected: ["ab", "cd"]
},
{
title: "TrimmedText",
input: "te # xt",
input: "ab # cd",
sep: "#",
stripEmpty: false,
filter: undefined,
expected: ["te", "xt"]
expected: ["ab", "cd"]
}
];