Skip to content

Commit

Permalink
Move scripts, remove unused git files, and add a pre-commit hook (#52)
Browse files Browse the repository at this point in the history
* Remove requirements.txt - never been used
* Move get_version.py to scripts folder
* Move assert.sh into scripts folder
* Remove dependabot config
* Add scripts folder readme
* Remove .gitattributes
* Remove .gitignore
* Add pre-commit hooks for workflows and actions
  • Loading branch information
sondrelg authored Sep 4, 2021
1 parent 986ce95 commit fdde2e9
Show file tree
Hide file tree
Showing 10 changed files with 16 additions and 17 deletions.
2 changes: 0 additions & 2 deletions .gitattributes

This file was deleted.

6 changes: 0 additions & 6 deletions .github/dependabot.yml

This file was deleted.

File renamed without changes.
File renamed without changes.
4 changes: 2 additions & 2 deletions .github/workflows/tag_release.yml
Original file line number Diff line number Diff line change
Expand Up @@ -12,8 +12,8 @@ jobs:
- uses: actions/checkout@v2
- name: Update tag
run: |
major_tag="$(python get_version.py "${GITHUB_REF}" major)"
minor_tag="$(python get_version.py "${GITHUB_REF}" minor)"
major_tag="$(python .github/scripts/get_version.py "${GITHUB_REF}" major)"
minor_tag="$(python .github/scripts/get_version.py "${GITHUB_REF}" minor)"
git tag $major_tag
git tag $minor_tag
git push origin HEAD:refs/heads/master --tags --force
Expand Down
10 changes: 5 additions & 5 deletions .github/workflows/test.yml
Original file line number Diff line number Diff line change
Expand Up @@ -14,7 +14,7 @@ env:

# Normal variables (used in steps/*)
LATEST_PYTHON: "3.9"
LATEST_POETRY: "$(cat requirements.txt | sed 's/poetry==//g')"
LATEST_POETRY: "1.1.8"

jobs:
# The set-env job translates our json variables to a format we
Expand Down Expand Up @@ -94,7 +94,7 @@ jobs:
run: |
output=$(poetry config virtualenvs.create)
echo $output
source "./assert.sh"
source "./.github/scripts/assert.sh"
assert_in "false" "$output"
# Makes sure creating a venv in-project works
Expand All @@ -120,7 +120,7 @@ jobs:
python-version: ${{ env.LATEST_PYTHON }}
- run: |
output="$(poetry install)"
source "./assert.sh"
source "./.github/scripts/assert.sh"
echo "$output"
assert_in "/install-poetry/install-poetry/.venv" "$output"
source $VENV
Expand All @@ -139,7 +139,7 @@ jobs:
# If you're submitting a PR and this fails because Poetry release a new version
# feel free to update it
- run: |
source "./assert.sh"
source "./.github/scripts/assert.sh"
assert_in "1.1.8" "$(poetry --version)"
# Make sure scripts are not deleted.
Expand Down Expand Up @@ -184,5 +184,5 @@ jobs:
run: |
output=$(poetry config installer.parallel)
echo $output
source "./assert.sh"
source "./.github/scripts/assert.sh"
assert_in "false" "$output"
1 change: 0 additions & 1 deletion .gitignore

This file was deleted.

5 changes: 5 additions & 0 deletions .pre-commit-config.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -9,3 +9,8 @@ repos:
- id: trailing-whitespace
- id: mixed-line-ending
- id: trailing-whitespace
- repo: https://github.com/sirosen/check-jsonschema
rev: '0.4.1'
hooks:
- id: check-github-actions
- id: check-github-workflows
1 change: 0 additions & 1 deletion requirements.txt

This file was deleted.

4 changes: 4 additions & 0 deletions scripts/README.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,4 @@
The scripts in the scripts folder should not ever change.

Previous versions of the action would curl scripts from the repos main branch,
meaning that if we remove them, old pinned versions of the action will break.

0 comments on commit fdde2e9

Please sign in to comment.