Skip to content

Commit

Permalink
Merge pull request #138 from AlexsLemonade/sjspielman/84-spellcheck-w…
Browse files Browse the repository at this point in the history
…orkflow

Add spellcheck workflow
  • Loading branch information
sjspielman committed Mar 12, 2024
2 parents 33c525c + 19a75cf commit e805a19
Show file tree
Hide file tree
Showing 8 changed files with 194 additions and 50 deletions.
37 changes: 37 additions & 0 deletions .github/components/dictionary.txt
Original file line number Diff line number Diff line change
@@ -0,0 +1,37 @@
ableist
ALSF
bioinformatics
Carpentries
conda
config
DM
doxxing
formatters
GitHub
GitKraken
JSON
LGBTQ
LinkedIn
linter
linter's
linters
LSfR
macOS
Miniconda
nonconsensual
OpenScPCA
openscpca
pre
precommit
README
renv
reproducibility
ScPCA
socio
Stumptown
trainings
transphobic
triaged
WisCon
WSL

11 changes: 11 additions & 0 deletions .github/cron-issue-templates/spellcheck-issue-template.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,11 @@
This issue tracks the results from running the scheduled spellcheck workflow.
This issue is filed whether there are errors or not.
Please see the issue comment for specific errors.

If there are no errors, this issue can be closed.

## Issue checklist

- [ ] Assign an OpenScPCA admin
- [ ] Spell check errors have been fixed via a PR
- [ ] Spell check workflow has been manually run to confirm spelling errors are fixed
89 changes: 89 additions & 0 deletions .github/workflows/spellcheck.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,89 @@
name: Check Spelling
on:
pull_request: # TEMPORARY
branches:
- main
workflow_dispatch:
schedule:
- cron: "0 0 * * 1" # every Monday at midnight

# From https://medium.com/@VeselyCodes/bi-weekly-github-actions-7bea6be7bd96
env:
# The date of the first run of the action.
FIRST_RUN_DATE: 2024-03-25

concurrency:
# only one run per branch at a time
group: ${{ github.workflow }}-${{ github.ref }}
cancel-in-progress: true

jobs:
weekindex:
if: ${{ github.event_name == 'schedule' }}
runs-on: ubuntu-latest
outputs:
weekindex: ${{ steps.calculate.outputs.weekindex }}
steps:
- name: Calculate weekdiff
id: calculate
run: |
current_date=$(date +%Y-%m-%d)
start=$(date -d ${{ env.FIRST_RUN_DATE }} +%s)
end=$(date -d $current_date +%s)
weekdiff=$(((end-start) / 60 / 60 / 24 / 7))
weekindex=$((weekdiff % 4)) ##################### We want to run every 4 weeks!
echo "weekindex=$weekindex" >> "$GITHUB_OUTPUT"
spellcheck:
if: ${{ needs.weekindex.outputs.weekindex == 0 || github.event_name != 'schedule' }}
runs-on: ubuntu-latest
name: Spell check files
permissions:
contents: read
issues: write

steps:
- name: Checkout
uses: actions/checkout@v4

- name: Spell check action
uses: alexslemonade/spellcheck@v0
id: spell
with:
dictionary: .github/components/dictionary.txt

- name: Upload spell check errors
uses: actions/upload-artifact@v4
id: artifact-upload-step
with:
name: spell_check_errors
path: spell_check_errors.tsv

# # Uncomment this job at OpenScPCA Launch
# - name: Post issue with spellcheck results
# id: spellissue
# uses: peter-evans/create-issue-from-file@v5
# with:
# title: Monthly spellcheck results
# content-filepath: .github/cron-issue-templates/spellcheck-issue-template.md
# labels: |
# OpenScPCA admin
# spelling
#
# # Uncomment this job at OpenScPCA Launch
# - name: Comment artifact on issue
# uses: peter-evans/create-or-update-comment@v4
# with:
# issue-number: ${{ steps.spellissue.outputs.issue-number }}
# body: |
# The spellchecker found **${{ steps.spell.outputs.error_count }} errors**.
#
# [Click to download the spelling errors TSV.](${{ steps.artifact-upload-step.outputs.artifact-url }})


- name: Fail if there are spelling errors
if: steps.spell.outputs.error_count > 0
run: |
echo "There were ${{ steps.spell.outputs.error_count }} errors"
column -t spell_check_errors.tsv
exit 1
3 changes: 2 additions & 1 deletion README.md
Original file line number Diff line number Diff line change
@@ -1 +1,2 @@
# OpenScPCA-analysis
# OpenScPCA-analysis

94 changes: 50 additions & 44 deletions code-of-conduct.md

Large diffs are not rendered by default.

6 changes: 3 additions & 3 deletions docs/contributing.md
Original file line number Diff line number Diff line change
Expand Up @@ -25,11 +25,11 @@ To serve the documentation during local development, run `mkdocs serve` from the

Documentation is written as a series of markdown files nested by topic in directories.

- All directories at the top-level inside `docs` will represent navbar sections.
- All directories at the top-level inside `docs` will represent `navbar` sections.
- Each top-level directory should contain an `index.md` file with an overall description of what that section contains.
- The `index.md` should have an L1 header with the same title as the navbar section.
- The `index.md` should have an L1 header with the same title as the `navbar` section.
- Markdown files in each directory represent sections shown along the left sidebar.
- Nested directories within each navbar section should be used to add an additional bold (gray) header on the left sidebar.
- Nested directories within each `navbar` section should be used to add an additional bold (gray) header on the left sidebar.
- Markdown files within each nested directory will fall under this additional bold (gray) header.
- Any visual aids used in the docs should be placed in `docs/img`.

Expand Down
2 changes: 1 addition & 1 deletion docs/general-style-guide.md
Original file line number Diff line number Diff line change
Expand Up @@ -53,7 +53,7 @@ Use it for describing:

## Using buttons

Use [Github buttons](https://gist.github.com/apaskulin/1ad686e42c7165cb9c22f9fe1e389558#buttons) to draw attention to important links.
Use [GitHub buttons](https://gist.github.com/apaskulin/1ad686e42c7165cb9c22f9fe1e389558#buttons) to draw attention to important links.
Use buttons sparingly.

Use the buttons for links critical for users to continue on to the next stage like:
Expand Down
2 changes: 1 addition & 1 deletion docs/technical-setup/install-a-github-client.md
Original file line number Diff line number Diff line change
Expand Up @@ -41,7 +41,7 @@ After installing Git, you will also need take these steps:
- [Set up an SSH key](https://docs.github.com/en/authentication/connecting-to-github-with-ssh) to interact with GitHub
- [Set up your Git config file](https://git-scm.com/book/en/v2/Getting-Started-First-Time-Git-Setup)

### Install Git on MacOS
### Install Git on macOS

We recommend installing Git via Apple's developer command line tools.
For this, launch a Terminal window, enter the command shown below, and follow the instructions.
Expand Down

0 comments on commit e805a19

Please sign in to comment.