Closed zfauser closed 1 year ago
hi @Zfauser do you have a public repository which demonstrating this?
My experience with submodules is limited and not full fond memories.
Hey, unfortunately I do not and it's not possible for me to make one of the existing repos public, sorry. What we are essentially doing though is writing code documentation which involves many things that are not recognized in the dictionary (I.e. 'const') and instead of everyone individually discovering each of these I figured having one document we all collaborated on would make sense. Do you know if this would be possible or maybe just a different way of doing it?
Hi @Zfauser
I have been thinking about this problem and think I have foundation a solution. It does require some code changes. More information will follow...
Hi @Zfauser
Okay, here goes:
Using the config_path
parameter for the GitHub action you can specify where you want your configuration to be placed.
name: Spellcheck Action
on: push
jobs:
build:
name: Spellcheck
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@master
- uses: rojopolis/spellcheck-github-actions@0.29.0
name: Spellcheck
with:
config_path: config/spellcheck.yml # put path to configuration file here
So you can place it in a directory, which you handle as a git submodule.
The above is the file controlling your workflow/action located in: .github/workflows/
REF: documentation
Inside the configuration of the, you can set the path of the custom dictionary / wordlist. This is the file pointed to in the above configuration.
matrix:
- name: Markdown
aspell:
lang: en
dictionary:
wordlists:
- config/wordlist.txt
encoding: utf-8
pipeline:
- pyspelling.filters.markdown:
- pyspelling.filters.html:
comments: false
ignores:
- code
- pre
sources:
- '**/*.md'
default_encoding: utf-8
REF: documentation
So you can place the wordlist in a directory, which you handle as a git submodule.
Please let me know if this is unclear or does not work. I do not work with git submodules, so I do not have a working example, all of the above is just deducted from the documentation and is untested in git submodule context.
I will make some updates to the documentation to emphasize the flexibility taken advantage of to meet your request.
I am might have run into an issue with the above approach, I will need to do some more testing...
Sorry about that, I am tired. I forgot to tell my local test to point to the moved configuration. I have a shell wrapper on the Docker image, which I call like so:
$ INPUT_CONFIG_PATH=".github/spellcheck.yml" spellchecker.sh
Forgot to set the environment variable, which is how the action configuration on GitHub communicates with the entry point in the Docker image.
How would you use a git submodule as a wordlist, when I try to use it currently It always just returns that the wordlist could not be found.