rojopolis / spellcheck-github-actions

Spell check action
MIT License
138 stars 38 forks source link

Version 0.3.0 appears to have an issue when no files matching the source targets exist in the repo the action is being applied too? #6

Closed sbates130272 closed 3 years ago

sbates130272 commented 4 years ago

See this for full output.

Run rojopolis/spellcheck-github-actions@0.3.0
/usr/bin/docker run --name e87b52981d34139d40432493cfa05669cb2827_071f17 --label e87b52 --workdir /github/workspace --rm -e HOME -e GITHUB_REF -e GITHUB_SHA -e GITHUB_REPOSITORY -e GITHUB_RUN_ID -e GITHUB_RUN_NUMBER -e GITHUB_ACTOR -e GITHUB_WORKFLOW -e GITHUB_HEAD_REF -e GITHUB_BASE_REF -e GITHUB_EVENT_NAME -e GITHUB_WORKSPACE -e GITHUB_ACTION -e GITHUB_EVENT_PATH -e RUNNER_OS -e RUNNER_TOOL_CACHE -e RUNNER_TEMP -e RUNNER_WORKSPACE -e ACTIONS_RUNTIME_URL -e ACTIONS_RUNTIME_TOKEN -e GITHUB_ACTIONS=true -v "/var/run/docker.sock":"/var/run/docker.sock" -v "/home/runner/work/_temp/_github_home":"/github/home" -v "/home/runner/work/_temp/_github_workflow":"/github/workflow" -v "/home/runner/work/p2pmem-pci/p2pmem-pci":"/github/workspace" e87b52:981d34139d40432493cfa05669cb2827
Traceback (most recent call last):
  File "/usr/local/bin/pyspelling", line 8, in <module>
    sys.exit(main())
  File "/usr/local/lib/python3.7/site-packages/pyspelling/__main__.py", line 34, in main
    debug=args.debug
  File "/usr/local/lib/python3.7/site-packages/pyspelling/__main__.py", line 59, in run
    debug=debug
  File "/usr/local/lib/python3.7/site-packages/pyspelling/__init__.py", line 662, in spellcheck
    for result in spellchecker.run_task(task, source_patterns=sources):
  File "/usr/local/lib/python3.7/site-packages/pyspelling/__init__.py", line 306, in run_task
    for sources in self._walk_src(source_patterns, glob_flags, self.pipeline_steps, expect_match):
  File "/usr/local/lib/python3.7/site-packages/pyspelling/__init__.py", line 207, in _walk_src
    '\n'.join('- {}'.format(target) for target in targets)
RuntimeError: None of the source targets from the configuration match any files:

See this output.

sbates130272 commented 4 years ago

Oh so this is because the default spellcheck.yaml used in this repo does not set expect_match to false. This seems like an odd default to have given, as a GitHub action, you have no idea what is in the parent repo?

jonasbn commented 4 years ago

Hi @sbates130272

I ran into this too, the updated documentation now has a diagnostics section describing this. I have added a more limited default configuration, aimed at Markdown since most repositories might contain a README.md or similar. I hope this limits the error triggering scenarios.

I will keep this issue open, while I am evaluating your findings in regard to expect_match, but I am not getting my hopes up for a more generic solution.

jonasbn commented 3 years ago

I added some more details to the mentioned section of the documentation.