diff --git a/.pylintrc b/.pylintrc index 76fa5bd..318fbf8 100644 --- a/.pylintrc +++ b/.pylintrc @@ -1,2 +1,7 @@ [MAIN] -ignored-modules=plover.machine.base,plover.registry,plover.engine,plover.formatting,plover.oslayer.config +ignored-modules = + plover.engine + plover.formatting + plover.machine.base + plover.oslayer.config + plover.registry diff --git a/README.md b/README.md index 15f50da..a05bcfb 100644 --- a/README.md +++ b/README.md @@ -185,6 +185,10 @@ If you are a [`just`][] user, you may find the [`justfile`][] useful during development in running multiple test commands. You can run the following command from the project root directory: +```console +just --working-directory . --justfile test/justfile +``` + ### Deploying Changes After making any code changes, deploy the plugin into Plover with the following diff --git a/plover_platform_specific_translation/config/__init__.py b/plover_platform_specific_translation/config/__init__.py index 7d09d0a..9a77c36 100644 --- a/plover_platform_specific_translation/config/__init__.py +++ b/plover_platform_specific_translation/config/__init__.py @@ -8,8 +8,10 @@ load, save ) +from .file import CONFIG_BASENAME __all__ = [ + "CONFIG_BASENAME", "load", "save" ] diff --git a/plover_platform_specific_translation/config/file.py b/plover_platform_specific_translation/config/file.py index d1a24c7..a874bc5 100644 --- a/plover_platform_specific_translation/config/file.py +++ b/plover_platform_specific_translation/config/file.py @@ -9,6 +9,8 @@ ) +CONFIG_BASENAME: str = "platform_specific_translation.json" + def load(filepath: Path) -> dict[str, Any]: """ Reads in data from a JSON file diff --git a/plover_platform_specific_translation/extension.py b/plover_platform_specific_translation/extension.py index 635e53d..e6b2dd7 100644 --- a/plover_platform_specific_translation/extension.py +++ b/plover_platform_specific_translation/extension.py @@ -23,7 +23,7 @@ ) -_CONFIG_FILEPATH: Path = Path(CONFIG_DIR) / "platform_specific_translation.json" +_CONFIG_FILE: Path = Path(CONFIG_DIR) / config.CONFIG_BASENAME class PlatformSpecificTranslation: """ @@ -43,7 +43,7 @@ def start(self) -> None: Sets up the meta plugin, steno engine hooks, and information to cache """ self._platform = platform.parse() - self._platform_translations = config.load(_CONFIG_FILEPATH) + self._platform_translations = config.load(_CONFIG_FILE) registry.register_plugin( "meta", "PLATFORM", @@ -88,7 +88,7 @@ def _platform_specific_translation( self._platform_translations[argument] = ( (platform_translation_type, platform_translation) ) - config.save(_CONFIG_FILEPATH, self._platform_translations) + config.save(_CONFIG_FILE, self._platform_translations) action: _Action = ctx.new_action() @@ -112,4 +112,4 @@ def _machine_state_changed( allows for changes made to translations to be re-read in. """ if machine_state == STATE_RUNNING: - self._platform_translations = config.load(_CONFIG_FILEPATH) + self._platform_translations = config.load(_CONFIG_FILE) diff --git a/pytest.ini b/pytest.ini index 75caa18..eec879a 100644 --- a/pytest.ini +++ b/pytest.ini @@ -1,6 +1,6 @@ +[pytest] # NOTE: Although the asyncio module is not used directly in this plugin, it # seems that some other dependencies do use it. So, this config is added to # silence the deprecation warnings regarding # `asyncio_default_fixture_loop_scope` -[pytest] asyncio_default_fixture_loop_scope = function diff --git a/setup.cfg b/setup.cfg index 6c56b16..682b2af 100644 --- a/setup.cfg +++ b/setup.cfg @@ -18,7 +18,7 @@ long_description = file: README.md long_description_content_type = text/markdown name = plover_platform_specific_translation url = https://github.com/paulfioravanti/plover-platform-specific-translation -version = 0.2.4 +version = 0.2.5 [options] install_requires = @@ -37,7 +37,7 @@ plover.extension = plover_platform_specific_translation = plover_platform_specific_translation.extension:PlatformSpecificTranslation [options.extras_require] -test= +test = coverage mypy pylint