Merge branch 'better-spellchecking' into 'v3'
Add spellchecking for camelCase, PascalCase, and kebab-case See merge request openflexure/openflexure-microscope-server!502
This commit is contained in:
commit
f5c907e62d
9 changed files with 40 additions and 8 deletions
29
.codespellrc2
Normal file
29
.codespellrc2
Normal file
|
|
@ -0,0 +1,29 @@
|
|||
[codespell]
|
||||
# A separate RC file for detecting camelCase, PascalCase, and kebab-case errors
|
||||
# A little more prone to false positives than our standard regex, also fails to detect
|
||||
# hyphenated words in the dictonary.
|
||||
|
||||
# Same as the main RC-file except it also excludes CHANGELOG as this is well covered
|
||||
# by the normal RC file, and we get false positives from git hashes.
|
||||
skip = node_modules,
|
||||
*-lock.json,
|
||||
*.git,
|
||||
*.pyc,
|
||||
__pycache__,
|
||||
./build,
|
||||
./dist,
|
||||
./apidocs,
|
||||
./openflexure,
|
||||
./htmlcov,
|
||||
./src/openflexure_microscope_server/static,
|
||||
.venv,
|
||||
*.egg-info,
|
||||
report.xml,
|
||||
CHANGELOG.md
|
||||
|
||||
# Ignores split by |
|
||||
# Ignore hexadecimal numbers preceded by #
|
||||
# Ignore FoV
|
||||
ignore-regex = #[0-9A-Fa-f]{3,8}\b|\bFoV\b
|
||||
|
||||
regex = [A-Z]?[a-z\']+
|
||||
|
|
@ -76,7 +76,10 @@ spelling:
|
|||
# in .rules_common overwrites any rules defined in .python
|
||||
- .rules_common
|
||||
script:
|
||||
# Run with our standard regex, best for normal text and snake-case
|
||||
- codespell .
|
||||
# Run again with a second regex that finds issues in camelCase, PascalCase and kebab-case
|
||||
- codespell --config .codespellrc2 .
|
||||
|
||||
# Python static analysis and formatting with ruff
|
||||
# Only runs when a .py file is edited
|
||||
|
|
|
|||
|
|
@ -40,7 +40,7 @@ class BackgroundDetectAlgorithm(lt.Thing):
|
|||
"""Initialise and create the lock."""
|
||||
if self.display_name == "Base Detector":
|
||||
raise NotImplementedError(
|
||||
"Do not try to use the BackgroungDetectAlgorithm directly. "
|
||||
"Do not try to use the BackgroundDetectAlgorithm directly. "
|
||||
" Use a subclass"
|
||||
)
|
||||
super().__init__(thing_server_interface)
|
||||
|
|
|
|||
|
|
@ -24,19 +24,19 @@ from openflexure_microscope_server.ui import PropertyControl
|
|||
def test_partial_base_classes():
|
||||
"""Create a partial class and check it raises the correct errors."""
|
||||
|
||||
class MinimalSetings(BaseModel):
|
||||
class MinimalSettings(BaseModel):
|
||||
"""Some minimal settings for a workflow that doesn't work."""
|
||||
|
||||
foo: str = "bar"
|
||||
|
||||
class BadWorkflow(ScanWorkflow[MinimalSetings]):
|
||||
class BadWorkflow(ScanWorkflow[MinimalSettings]):
|
||||
"""Can initialise. Other properties and methods error."""
|
||||
|
||||
display_name: str = lt.property(default="Bad Workflow", readonly=True)
|
||||
|
||||
bad_workflow = create_thing_without_server(BadWorkflow)
|
||||
|
||||
settings = MinimalSetings()
|
||||
settings = MinimalSettings()
|
||||
with pytest.raises(NotImplementedError):
|
||||
bad_workflow.check_before_start(settings)
|
||||
|
||||
|
|
|
|||
|
|
@ -49,7 +49,7 @@ def test_monkey_patched_handle_exit(side_effect, mocker):
|
|||
# The error was raised so we know our custom function was run, check that
|
||||
# handle_exit wasn't.
|
||||
# Note: that the non-mocked shutdown function is entirely wrapped in a
|
||||
# try/except BaseExcpetion, so that handle_exit will always run.
|
||||
# try/except BaseException, so that handle_exit will always run.
|
||||
assert original_mock_handle_exit.call_count == 0
|
||||
|
||||
|
||||
|
|
|
|||
|
|
@ -340,7 +340,7 @@ export default {
|
|||
newValue = Math.min(newValue, this.maximum);
|
||||
}
|
||||
|
||||
// If mulipleOf is validated on server then enforce it.
|
||||
// If multipleOf is validated on server then enforce it.
|
||||
if (multipleOf) {
|
||||
newValue = Math.round(newValue / multipleOf) * multipleOf;
|
||||
}
|
||||
|
|
|
|||
|
|
@ -6,8 +6,8 @@
|
|||
</template>
|
||||
|
||||
<script>
|
||||
import appSettings from "./displaySetttingsComponents/appSettings.vue";
|
||||
import streamSettings from "./displaySetttingsComponents/streamSettings.vue";
|
||||
import appSettings from "./displaySettingsComponents/appSettings.vue";
|
||||
import streamSettings from "./displaySettingsComponents/streamSettings.vue";
|
||||
|
||||
// Export main app
|
||||
export default {
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue