From c314bf4707444070251eb3f28f389532c792db9c Mon Sep 17 00:00:00 2001 From: Pavel Zwerschke Date: Mon, 29 Jan 2024 22:38:41 +0100 Subject: [PATCH] migrate to copier template (#36) --- .copier-answers.yml | 7 ++++++ .github/dependabot.yml | 2 +- .github/workflows/autoupdate.yml | 10 ++++----- .github/workflows/ci.yml | 5 +++-- .github/workflows/keep-alive.yml | 9 ++++---- .github/workflows/tag.yml | 1 - .pre-commit-hooks.yaml | 2 +- LICENSE.txt => LICENSE | 2 +- README.md | 37 ++++++-------------------------- 9 files changed, 28 insertions(+), 47 deletions(-) create mode 100644 .copier-answers.yml rename LICENSE.txt => LICENSE (98%) diff --git a/.copier-answers.yml b/.copier-answers.yml new file mode 100644 index 0000000..ece2de7 --- /dev/null +++ b/.copier-answers.yml @@ -0,0 +1,7 @@ +# This file is managed by Copier; DO NOT EDIT OR REMOVE. +_commit: v0.1.1 +_src_path: git@github.com:quantco/copier-template-pre-commit-mirrors +description: Source code spell checker, binary install +entry: typos +tool: typos +url: https://github.com/crate-ci/typos diff --git a/.github/dependabot.yml b/.github/dependabot.yml index a2a06ab..5a74cb9 100644 --- a/.github/dependabot.yml +++ b/.github/dependabot.yml @@ -3,7 +3,7 @@ updates: - package-ecosystem: github-actions directory: / schedule: - interval: weekly + interval: monthly reviewers: - quantco/ci groups: diff --git a/.github/workflows/autoupdate.yml b/.github/workflows/autoupdate.yml index 29131dc..106ea32 100644 --- a/.github/workflows/autoupdate.yml +++ b/.github/workflows/autoupdate.yml @@ -1,4 +1,5 @@ name: Autoupdate + on: workflow_dispatch: schedule: @@ -16,11 +17,10 @@ jobs: steps: - name: Checkout branch uses: actions/checkout@v4 - with: - ref: ${{ github.head_ref }} - name: Set up Conda env - uses: mamba-org/provision-with-micromamba@3c96c0c27676490c63c18bc81f5c51895ac3e0e6 + uses: mamba-org/setup-micromamba@e820223f89c8720d6c740ca154a7adf32fcd278a with: + environment-file: environment.yml environment-name: check-env - name: Find latest version id: versions @@ -31,8 +31,8 @@ jobs: new_version=$(micromamba list -n check-env "$pkgname" --json | jq -r '.[0].version') if [[ "$new_version" != "$old_version" ]]; then sed -i "s/$old_version/$new_version/g" environment.yml - echo "pkgname=$pkgname" >> "$GITHUB_OUTPUT" - echo "new-version=$new_version" >> "$GITHUB_OUTPUT" + echo "pkgname=$pkgname" >> $GITHUB_OUTPUT + echo "new-version=$new_version" >> $GITHUB_OUTPUT fi - uses: peter-evans/create-pull-request@153407881ec5c347639a548ade7d8ad1d6740e38 if: steps.versions.outputs.pkgname diff --git a/.github/workflows/ci.yml b/.github/workflows/ci.yml index bb82897..27b57b5 100644 --- a/.github/workflows/ci.yml +++ b/.github/workflows/ci.yml @@ -3,7 +3,7 @@ name: CI on: push: branches: - - master + - main pull_request: jobs: @@ -16,6 +16,7 @@ jobs: with: ref: ${{ github.head_ref }} - name: Set up Conda env - uses: mamba-org/provision-with-micromamba@3c96c0c27676490c63c18bc81f5c51895ac3e0e6 + uses: mamba-org/setup-micromamba@e820223f89c8720d6c740ca154a7adf32fcd278a with: + environment-file: environment.yml environment-name: test-env diff --git a/.github/workflows/keep-alive.yml b/.github/workflows/keep-alive.yml index b6d789e..ecc2990 100644 --- a/.github/workflows/keep-alive.yml +++ b/.github/workflows/keep-alive.yml @@ -1,8 +1,7 @@ name: Keep on: - # pull_request: schedule: - - cron: "0 6 * * SUN" # Once weekly on Sunday @ 0600 UTC + - cron: 0 6 * * SUN jobs: keep-alive: @@ -12,7 +11,7 @@ jobs: - uses: actions/checkout@v4 - uses: gautamkrishnar/keepalive-workflow@60b13c92aeda855e493b83aaf482c25da7e0043b with: - commit_message: "Ah ah ah, stayin' alive" + commit_message: Ah ah ah, stayin' alive committer_username: ForrestQuant - committer_email: "forrestquant@users.noreply.github.com" - time_elapsed: 50 # days + committer_email: forrestquant@users.noreply.github.com + time_elapsed: 50 # days diff --git a/.github/workflows/tag.yml b/.github/workflows/tag.yml index 8b9340f..038438c 100644 --- a/.github/workflows/tag.yml +++ b/.github/workflows/tag.yml @@ -4,7 +4,6 @@ on: push: branches: - main - - master jobs: tag: diff --git a/.pre-commit-hooks.yaml b/.pre-commit-hooks.yaml index eec6a24..de6df82 100644 --- a/.pre-commit-hooks.yaml +++ b/.pre-commit-hooks.yaml @@ -1,8 +1,8 @@ - id: typos-conda name: typos-conda description: Source code spell checker, binary install - language: conda entry: typos + language: conda args: [--force-exclude] types: [text] stages: [commit, merge-commit, push, manual] diff --git a/LICENSE.txt b/LICENSE similarity index 98% rename from LICENSE.txt rename to LICENSE index 18bd882..1f66540 100644 --- a/LICENSE.txt +++ b/LICENSE @@ -1,4 +1,4 @@ -Copyright 2019 QuantCo, Inc. +Copyright 2024 QuantCo, Inc. Redistribution and use in source and binary forms, with or without modification, are permitted provided that the following conditions are met: diff --git a/README.md b/README.md index 785591d..66c02f7 100644 --- a/README.md +++ b/README.md @@ -1,43 +1,18 @@ -typos(-conda) mirror -==================== +# typos mirror Mirror of typos for pre-commit with conda as a language. -For pre-commit: see https://github.com/pre-commit/pre-commit -For typos: see https://github.com/crate-ci/typos +For pre-commit: see [here](https://github.com/pre-commit/pre-commit) -### Using typos with pre-commit and conda: +For ansible-lint: see [here](https://github.com/crate-ci/typos) + +## Using typos with pre-commit and conda: Add this to your `.pre-commit-config.yaml` ```yaml - - repo: https://github.com/Quantco/pre-commit-mirrors-typos + - repo: https://github.com/quantco/pre-commit-mirrors-typos rev: '' # Use the sha / tag you want to point at hooks: - id: typos-conda ``` - -### Some Useful Exceptions -For the exact documentation on how to ignore certain typos, see: https://github.com/crate-ci/typos#false-positives . This config -can be included in the `pyproject.toml` of a repository as shown below. - -In our projects, some shorter German works are too similar to English words and are picked up. Here is a list of commonly encountered typos: - -```toml -[tool.typos] -[tool.typos.default.extend-words] -als = "als" -alle = "alle" -autor = "autor" -beginn = "beginn" -ende = "ende" -iif = "iif" -ist = "ist" -feld = "field" -sie = "sie" -tage = "tage" -titel = "titel" -``` - -### Flagging Unrecognized Typos -If you notice that there is a typo in your project that is not being caught by `typos`, simply open an issue in this repository.