scalelink 1.0.0__tar.gz

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (35) hide show
  1. scalelink-1.0.0/.github/CODEOWNERS +1 -0
  2. scalelink-1.0.0/.github/dependabot.yml +39 -0
  3. scalelink-1.0.0/.github/pull_request_template.md +92 -0
  4. scalelink-1.0.0/.github/workflows/deploy_to_pypi.yaml +52 -0
  5. scalelink-1.0.0/.github/workflows/deploy_to_test_pypi.yaml +52 -0
  6. scalelink-1.0.0/.github/workflows/increment_version.yaml +44 -0
  7. scalelink-1.0.0/.github/workflows/pull_request.yaml +80 -0
  8. scalelink-1.0.0/.gitignore +278 -0
  9. scalelink-1.0.0/.pre-commit-config.yaml +56 -0
  10. scalelink-1.0.0/CHANGELOG.md +131 -0
  11. scalelink-1.0.0/LICENSE +21 -0
  12. scalelink-1.0.0/PKG-INFO +95 -0
  13. scalelink-1.0.0/README.md +67 -0
  14. scalelink-1.0.0/conftest.py +93 -0
  15. scalelink-1.0.0/docs/branch_and_deploy_guide.md +317 -0
  16. scalelink-1.0.0/docs/contribution_guide.md +135 -0
  17. scalelink-1.0.0/docs/user_guide.md +144 -0
  18. scalelink-1.0.0/pyproject.toml +132 -0
  19. scalelink-1.0.0/pytest.ini +8 -0
  20. scalelink-1.0.0/scalelink/__init__.py +1 -0
  21. scalelink-1.0.0/scalelink/configs_template.ini +34 -0
  22. scalelink-1.0.0/scalelink/indicator_matrix/indicator_matrix.py +499 -0
  23. scalelink-1.0.0/scalelink/main.py +126 -0
  24. scalelink-1.0.0/scalelink/match_scores/match_scores.py +208 -0
  25. scalelink-1.0.0/scalelink/matrix_a_star/matrix_a_star.py +540 -0
  26. scalelink-1.0.0/scalelink/utils/utils.py +508 -0
  27. scalelink-1.0.0/tests/__init__.py +0 -0
  28. scalelink-1.0.0/tests/indicator_matrix/conftest.py +100 -0
  29. scalelink-1.0.0/tests/indicator_matrix/test_indicator_matrix.py +391 -0
  30. scalelink-1.0.0/tests/match_scores/conftest.py +93 -0
  31. scalelink-1.0.0/tests/match_scores/test_match_scores.py +133 -0
  32. scalelink-1.0.0/tests/matrix_a_star/conftest.py +85 -0
  33. scalelink-1.0.0/tests/matrix_a_star/test_matrix_a_star.py +445 -0
  34. scalelink-1.0.0/tests/utils/test_utils.py +390 -0
  35. scalelink-1.0.0/tests/utils/test_utils_create_spark_session.py +88 -0
@@ -0,0 +1 @@
1
+ * @ONSdigital/scalelink-maintainers
@@ -0,0 +1,39 @@
1
+ ---
2
+ version: 2
3
+ updates:
4
+ - package-ecosystem: "pip"
5
+ directory: "/"
6
+ schedule:
7
+ interval: "weekly"
8
+ groups:
9
+ pip-major:
10
+ update-types:
11
+ - "major"
12
+ pip-minor-patch:
13
+ update-types:
14
+ - "minor"
15
+ - "patch"
16
+ target-branch: "develop"
17
+ labels:
18
+ - "dependabot"
19
+ cooldown:
20
+ default-days: 14
21
+
22
+ - package-ecosystem: "github-actions"
23
+ directory: "/"
24
+ schedule:
25
+ interval: "weekly"
26
+ groups:
27
+ actions-major:
28
+ update-types:
29
+ - "major"
30
+ actions-minor-patch:
31
+ update-types:
32
+ - "minor"
33
+ - "patch"
34
+ target-branch: "develop"
35
+ labels:
36
+ - "dependabot"
37
+ - "github actions"
38
+ cooldown:
39
+ default-days: 14
@@ -0,0 +1,92 @@
1
+ # Request
2
+
3
+ This section must be completed by the person making the pull request.
4
+
5
+ ## Description
6
+
7
+ Please **replace this text** with a summary of the changes, using the following prompts:
8
+
9
+ - What has been changed?
10
+ - Why was it changed?
11
+ - How has the change been tested?
12
+ - Does the change close or contribute to closing any issues? Use [GitHub keywords][keywords] and
13
+ [cite][issue-citation] relevant issues.
14
+
15
+ ## Type of change
16
+
17
+ Please check all items that are applicable:
18
+
19
+ - [ ] New feature - change that adds new documentation, functionality, etc.
20
+ - [ ] Refactor - change that alters existing files, but not to fix an error.
21
+ - [ ] Bugfix - change that alters existing files to fix an error.
22
+ - [ ] Breaking change - backwards incompatible change, changes expected behaviour, etc.
23
+ - [ ] Non-user-facing change e.g. structural change, CI/CD change, etc.
24
+
25
+ ## Checklist:
26
+
27
+ Please check all items that have been completed. If any are not completed, provide an explanation in the description.
28
+
29
+ - [ ] **Assignee:** I have marked myself as the assignee of this pull request.
30
+ - [ ] **Code:** I have performed a self-review of my own code.
31
+ - [ ] **Tests: I have:**
32
+ - [ ] Added tests that prove my fix is effective or that my feature works.
33
+ - [ ] Checked that new and existing unit tests pass locally with my changes.
34
+ - [ ] **Documentation:** I have:
35
+ - [ ] Made corresponding changes to the documentation (comments, docstring, etc.).
36
+ - [ ] Commented my code appropriately, focusing on explaining my design decisions (explain why, not how).
37
+ - [ ] **Style:** I have followed the [contribution guide][contribution-guide].
38
+ - [ ] **Admin:** I have:
39
+ - [ ] Updated the change log.
40
+ - [ ] Labelled this pull request appropriately.
41
+
42
+ # Review
43
+
44
+ This section must be completed by the person or persons reviewing the pull request.
45
+
46
+ ## Checklist
47
+
48
+ Please check all items that have been completed:
49
+
50
+ - [ ] **Reviewer**: I have marked myself as the reviewer on this pull request.
51
+ - [ ] **Code**: I confirm that code changes:
52
+ - Work as expected.
53
+ - Are not overly complex.
54
+ - Are appropriately documented.
55
+ - Handle edge cases and exceptions.
56
+ - [ ] **Tests**: I confirm that unit tests:
57
+ - Are present where appropriate.
58
+ - Cover essential functions for a reasonable range of inputs and conditions.
59
+ - Pass locally (both new and existing tests).
60
+ - [ ] **Documentation**: I confirm that documentation files:
61
+ - Have been added/updated, as applicable.
62
+ - Make sense.
63
+ - Are not overly complex.
64
+ - [ ] **Style**: I confirm that all changes conform to the [contribution guide][contribution-guide].
65
+
66
+ Where items in this checklist are not met, suggestions for improvement must be made using review comments.
67
+
68
+ ## Review comments
69
+
70
+ Suggestions should be tailored to the code that you are reviewing. Provide context. Be critical and clear, but not mean.
71
+ Ask questions and set actions.
72
+
73
+ Suggestions may include:
74
+
75
+ - **Documentation improvements**:
76
+ - Improve clarity.
77
+ - Minimise complexity.
78
+ - Ensure all necessary information is covered accurately.
79
+ - **Code improvements**:
80
+ - Ensure correct functioning.
81
+ - Minimise complexity.
82
+ - Ensure all code is documented sufficiently.
83
+ - Ensure edge cases and exceptions are handled.
84
+ - **Test improvements**:
85
+ - Ensure sufficient coverage of both functions and inputs/conditions.
86
+ - Ensure all tests pass.
87
+ - **Style improvements**:
88
+ - Ensure the [contribution guide][contribution-guide] is followed.
89
+
90
+ [contribution-guide]: /docs/contribution_guide.md
91
+ [issue-citation]: https://docs.github.com/en/get-started/writing-on-github/working-with-advanced-formatting/autolinked-references-and-urls#issues-and-pull-requests
92
+ [keywords]: https://docs.github.com/en/get-started/writing-on-github/working-with-advanced-formatting/using-keywords-in-issues-and-pull-requests
@@ -0,0 +1,52 @@
1
+ name: Deploy version to PyPI
2
+
3
+ on:
4
+ workflow_dispatch:
5
+ inputs:
6
+ tags:
7
+ description: "Version to deploy, e.g. 1.0.0"
8
+ required: true
9
+ type: string
10
+
11
+ jobs:
12
+ release-build:
13
+ name: Build and verify release distributions
14
+ runs-on: ubuntu-latest
15
+ permissions:
16
+ # allows the provenance attestation to work
17
+ attestations: write
18
+ id-token: write
19
+
20
+ steps:
21
+ - name: Check out repository
22
+ id: build-repo-checkout
23
+ uses: actions/checkout@3d3c42e5aac5ba805825da76410c181273ba90b1
24
+
25
+ - name: Build and lint dist
26
+ id: build-dist
27
+ uses: hynek/build-and-inspect-python-package@2abe76da66d0a6a4a227101f9348ee855797cfa5
28
+ with:
29
+ attest-build-provenance-github: 'true'
30
+
31
+ release-publish:
32
+ name: Upload release to PyPI
33
+ runs-on: ubuntu-latest
34
+ needs: release-build
35
+ permissions:
36
+ # mandatory for PyPI Trusted Publishing
37
+ id-token: write
38
+ environment:
39
+ name: pypi
40
+ steps:
41
+ - name: Retrieve release distributions
42
+ id: publish-retrieve-dist
43
+ uses: actions/download-artifact@3e5f45b2cfb9172054b4087a40e8e0b5a5461e7c
44
+ with:
45
+ name: Packages
46
+ path: dist/
47
+
48
+ - name: Publish release distributions on PyPI
49
+ id: publish-to-pypi
50
+ uses: pypa/gh-action-pypi-publish@dc37677b2e1c63e2034f94d8a5b11f265b73ba33
51
+ with:
52
+ skip-existing: true
@@ -0,0 +1,52 @@
1
+ name: Deploy version to Test PyPI
2
+
3
+ on:
4
+ workflow_dispatch:
5
+ inputs:
6
+ tags:
7
+ description: "Version to deploy, e.g. 1.0.0-dev"
8
+ required: true
9
+ type: string
10
+
11
+ jobs:
12
+ release-build:
13
+ name: Build and verify release distributions
14
+ runs-on: ubuntu-latest
15
+ permissions:
16
+ # allows the provenance attestation to work
17
+ attestations: write
18
+ id-token: write
19
+ steps:
20
+ - name: Check out repository
21
+ id: build-repo-checkout
22
+ uses: actions/checkout@3d3c42e5aac5ba805825da76410c181273ba90b1
23
+
24
+ - name: Build and lint dist
25
+ id: build-dist
26
+ uses: hynek/build-and-inspect-python-package@2abe76da66d0a6a4a227101f9348ee855797cfa5
27
+ with:
28
+ attest-build-provenance-github: 'true'
29
+
30
+ release-publish:
31
+ name: Upload release to Test PyPI
32
+ runs-on: ubuntu-latest
33
+ needs: release-build
34
+ permissions:
35
+ # mandatory for PyPI Trusted Publishing
36
+ id-token: write
37
+ environment:
38
+ name: test-pypi
39
+ steps:
40
+ - name: Retrieve release distributions
41
+ id: publish-retrieve-dist
42
+ uses: actions/download-artifact@3e5f45b2cfb9172054b4087a40e8e0b5a5461e7c
43
+ with:
44
+ name: Packages
45
+ path: dist/
46
+
47
+ - name: Publish release distributions on Test PyPI
48
+ id: publish-to-pypi
49
+ uses: pypa/gh-action-pypi-publish@dc37677b2e1c63e2034f94d8a5b11f265b73ba33
50
+ with:
51
+ repository-url: https://test.pypi.org/legacy/
52
+ skip-existing: true
@@ -0,0 +1,44 @@
1
+ name: Increment version
2
+
3
+ on:
4
+ push:
5
+ branches:
6
+ - main
7
+
8
+ jobs:
9
+ version-increment:
10
+ permissions:
11
+ contents: write
12
+ actions: write
13
+ name: Increment repo version, push tag and create release
14
+ runs-on: ubuntu-latest
15
+ steps:
16
+ - name: Check out repository
17
+ id: version-repo-checkout
18
+ uses: actions/checkout@3d3c42e5aac5ba805825da76410c181273ba90b1
19
+
20
+ - name: Check version
21
+ id: version-check
22
+ uses: maybe-hello-world/pyproject-check-version@cb964e82b3c8a0b1cedb117da63e1761c46600b8
23
+ with:
24
+ pyproject-path: "./pyproject.toml"
25
+
26
+ - name: Set version as env variable
27
+ id: version-set
28
+ run: |
29
+ echo "PACKAGE_VERSION=${{ steps.version-check.outputs.local_version }}" >> $GITHUB_ENV
30
+
31
+ - name: Bump version and push tag
32
+ id: version-tag
33
+ uses: mathieudutour/github-tag-action@af99e60ce8132224b8e6ebab5023449fe256ed46
34
+ with:
35
+ github_token: ${{ secrets.GITHUB_TOKEN }}
36
+ custom_tag: ${{ env.PACKAGE_VERSION }}
37
+
38
+ - name: Create a GitHub release
39
+ id: version-release
40
+ uses: ncipollo/release-action@339a81892b84b4eeb0f6e744e4574d79d0d9b8dd
41
+ with:
42
+ tag: ${{ steps.version-tag.outputs.new_tag }}
43
+ name: Release ${{ steps.version-tag.outputs.new_tag }}
44
+ body: ${{ steps.version-tag.outputs.changelog }}
@@ -0,0 +1,80 @@
1
+ name: Pull request workflow
2
+ on:
3
+ pull_request:
4
+ types: [opened, synchronize, reopened, ready_for_review, labeled, unlabeled]
5
+ permissions:
6
+ contents: read
7
+
8
+ jobs:
9
+ check-branch:
10
+ # Source: https://stackoverflow.com/questions/71120146/
11
+ name: Enforce only develop can merge into main
12
+ runs-on: ubuntu-latest
13
+ steps:
14
+ - name: Check branch
15
+ id: check-branch
16
+ if: ${{ github.base_ref == 'main' && (github.head_ref != 'develop') }}
17
+ run: |
18
+ echo "ERROR: You can only merge to main from develop."
19
+ exit 1
20
+
21
+ changelog:
22
+ name: Check for changelog update
23
+ runs-on: ubuntu-latest
24
+ needs: check-branch
25
+ steps:
26
+ - name: Check changelog
27
+ id: changelog
28
+ uses: dangoslen/changelog-enforcer@8b5e9dc3121363bb7c0115f8533404d92af382de
29
+
30
+ pre-commit:
31
+ name: Run pre-commit hooks
32
+ runs-on: ubuntu-latest
33
+ needs: changelog
34
+ steps:
35
+ - name: Check out repository
36
+ id: pre-commit-repo-checkout
37
+ uses: actions/checkout@3d3c42e5aac5ba805825da76410c181273ba90b1
38
+
39
+ - name: Set up Python
40
+ id: pre-commit-python-set-up
41
+ uses: actions/setup-python@5fda3b95a4ea91299a34e894583c3862153e4b97
42
+
43
+ - name: Run pre-commit hooks
44
+ id: pre-commit-run
45
+ uses: pre-commit/action@2c7b3805fd2a0fd8c1884dcaebf91fc102a13ecd
46
+
47
+ test:
48
+ name: Run unit tests
49
+ runs-on: ubuntu-latest
50
+ needs: pre-commit
51
+ permissions:
52
+ contents: read
53
+ strategy:
54
+ matrix:
55
+ python-version: ["3.10", "3.11"]
56
+ steps:
57
+ - name: Check out repository
58
+ id: test-repo-checkout
59
+ uses: actions/checkout@3d3c42e5aac5ba805825da76410c181273ba90b1
60
+
61
+ - name: Set up Python ${{ matrix.python-version }}
62
+ id: test-python-set-up
63
+ uses: actions/setup-python@5fda3b95a4ea91299a34e894583c3862153e4b97
64
+ with:
65
+ python-version: ${{ matrix.python-version }}
66
+
67
+ - name: Install system dependencies
68
+ # This prevents failure of raz_client to install due to dependency on krb5-config
69
+ run: sudo apt-get update && sudo apt-get install -y libkrb5-dev
70
+
71
+ - name: Install dependencies
72
+ id: test-dependency-install
73
+ run: |
74
+ python -m pip install --upgrade pip
75
+ pip3 install .
76
+ pip3 install --group test
77
+
78
+ - name: Run unit tests
79
+ id: test-run
80
+ run: pytest
@@ -0,0 +1,278 @@
1
+ # Byte-compiled / optimised / DLL files
2
+ __pycache__/
3
+ *.py[codz]
4
+ *$py.class
5
+
6
+ # C extensions
7
+ *.so
8
+
9
+ # Distribution / packaging
10
+ .Python
11
+ build/
12
+ develop-eggs/
13
+ dist/
14
+ downloads/
15
+ eggs/
16
+ .eggs/
17
+ lib/
18
+ lib64/
19
+ parts/
20
+ sdist/
21
+ var/
22
+ wheels/
23
+ share/python-wheels/
24
+ *.egg-info/
25
+ .installed.cfg
26
+ *.egg
27
+ MANIFEST
28
+
29
+ # PyInstaller
30
+ # Usually these files are written by a python script from a template
31
+ # before PyInstaller builds the exe, so as to inject date/other infos into it.
32
+ *.manifest
33
+ *.spec
34
+
35
+ # Installer logs
36
+ pip-log.txt
37
+ pip-delete-this-directory.txt
38
+
39
+ # Unit test / coverage reports
40
+ htmlcov/
41
+ .tox/
42
+ .nox/
43
+ .coverage
44
+ .coverage.*
45
+ .cache
46
+ nosetests.xml
47
+ coverage.xml
48
+ *.cover
49
+ *.py.cover
50
+ *.lcov
51
+ .hypothesis/
52
+ .pytest_cache/
53
+ cover/
54
+
55
+ # Translations
56
+ *.mo
57
+ *.pot
58
+
59
+ # Django stuff:
60
+ *.log
61
+ local_settings.py
62
+ db.sqlite3
63
+ db.sqlite3-journal
64
+
65
+ # Flask stuff:
66
+ instance/
67
+ .webassets-cache
68
+
69
+ # Scrapy stuff:
70
+ .scrapy
71
+
72
+ # Sphinx documentation
73
+ docs/_build/
74
+
75
+ # PyBuilder
76
+ .pybuilder/
77
+ target/
78
+
79
+ # Jupyter Notebook
80
+ .ipynb_checkpoints
81
+
82
+ # IPython
83
+ profile_default/
84
+ ipython_config.py
85
+
86
+ # pyenv
87
+ # For a library or package, you might want to ignore these files since the code is
88
+ # intended to run in multiple environments; otherwise, check them in:
89
+ # .python-version
90
+
91
+ # pipenv
92
+ # According to pypa/pipenv#598, it is recommended to include Pipfile.lock in version control.
93
+ # However, in case of collaboration, if having platform-specific dependencies or dependencies
94
+ # having no cross-platform support, pipenv may install dependencies that don't work, or not
95
+ # install all needed dependencies.
96
+ # Pipfile.lock
97
+
98
+ # UV
99
+ # Similar to Pipfile.lock, it is generally recommended to include uv.lock in version control.
100
+ # This is especially recommended for binary packages to ensure reproducibility, and is more
101
+ # commonly ignored for libraries.
102
+ # uv.lock
103
+
104
+ # poetry
105
+ # Similar to Pipfile.lock, it is generally recommended to include poetry.lock in version control.
106
+ # This is especially recommended for binary packages to ensure reproducibility, and is more
107
+ # commonly ignored for libraries.
108
+ # https://python-poetry.org/docs/basic-usage/#commit-your-poetrylock-file-to-version-control
109
+ # poetry.lock
110
+ # poetry.toml
111
+
112
+ # pdm
113
+ # Similar to Pipfile.lock, it is generally recommended to include pdm.lock in version control.
114
+ # pdm recommends including project-wide configuration in pdm.toml, but excluding .pdm-python.
115
+ # https://pdm-project.org/en/latest/usage/project/#working-with-version-control
116
+ # pdm.lock
117
+ # pdm.toml
118
+ .pdm-python
119
+ .pdm-build/
120
+
121
+ # pixi
122
+ # Similar to Pipfile.lock, it is generally recommended to include pixi.lock in version control.
123
+ # pixi.lock
124
+ # Pixi creates a virtual environment in the .pixi directory, just like venv module creates one
125
+ # in the .venv directory. It is recommended not to include this directory in version control.
126
+ .pixi/*
127
+ !.pixi/config.toml
128
+
129
+ # PEP 582; used by e.g. github.com/David-OConnor/pyflow and github.com/pdm-project/pdm
130
+ __pypackages__/
131
+
132
+ # Celery stuff
133
+ celerybeat-schedule*
134
+ celerybeat.pid
135
+
136
+ # Redis
137
+ *.rdb
138
+ *.aof
139
+ *.pid
140
+
141
+ # RabbitMQ
142
+ mnesia/
143
+ rabbitmq/
144
+ rabbitmq-data/
145
+
146
+ # ActiveMQ
147
+ activemq-data/
148
+
149
+ # SageMath parsed files
150
+ *.sage.py
151
+
152
+ # Environments
153
+ .env
154
+ .envrc
155
+ .venv
156
+ env/
157
+ venv/
158
+ ENV/
159
+ env.bak/
160
+ venv.bak/
161
+
162
+ # Spyder project settings
163
+ .spyderproject
164
+ .spyproject
165
+
166
+ # Rope project settings
167
+ .ropeproject
168
+
169
+ # mkdocs documentation
170
+ /site
171
+
172
+ # mypy
173
+ .mypy_cache/
174
+ .dmypy.json
175
+ dmypy.json
176
+
177
+ # Pyre type checker
178
+ .pyre/
179
+
180
+ # pytype static type analyser
181
+ .pytype/
182
+
183
+ # Cython debug symbols
184
+ cython_debug/
185
+
186
+ # PyCharm
187
+ # JetBrains specific template is maintained in a separate JetBrains.gitignore that can
188
+ # be found at https://github.com/github/gitignore/blob/main/Global/JetBrains.gitignore
189
+ # and can be added to the global gitignore or merged into this file. For a more nuclear
190
+ # option (not recommended) you can uncomment the following to ignore the entire idea folder.
191
+ # .idea/
192
+
193
+ # Abstra
194
+ # Abstra is an AI-powered process automation framework.
195
+ # Ignore directories containing user credentials, local state, and settings.
196
+ # Learn more at https://abstra.io/docs
197
+ .abstra/
198
+
199
+ # Visual Studio Code
200
+ # Visual Studio Code specific template is maintained in a separate VisualStudioCode.gitignore
201
+ # that can be found at https://github.com/github/gitignore/blob/main/Global/VisualStudioCode.gitignore
202
+ # and can be added to the global gitignore or merged into this file. However, if you prefer,
203
+ # you could uncomment the following to ignore the entire vscode folder
204
+ # .vscode/
205
+ # Temporary file for partial code execution
206
+ tempCodeRunnerFile.py
207
+
208
+ # Ruff stuff:
209
+ .ruff_cache/
210
+
211
+ # PyPI configuration file
212
+ .pypirc
213
+
214
+ # Marimo
215
+ marimo/_static/
216
+ marimo/_lsp/
217
+ __marimo__/
218
+
219
+ # Streamlit
220
+ .streamlit/secrets.toml
221
+
222
+ # Compressed filetypes
223
+ *.7z
224
+ *.pickle
225
+ *.pkl
226
+ *.pyc
227
+ *.tar.*
228
+ *.taz
229
+ *.taZ
230
+ *.tb2
231
+ *.tbz
232
+ *.tbz2
233
+ *.tgz
234
+ *.tlz
235
+ *.txz
236
+ *.tZ
237
+ *.tz2
238
+ *.tzst
239
+
240
+ # Data filetypes
241
+ *.arvo
242
+ *.bson
243
+ *.csv
244
+ *.dat
245
+ *.fbs
246
+ *.feather
247
+ *.h5
248
+ *.hd
249
+ *.hdf5
250
+ *.ndjson
251
+ *.orc
252
+ *.parquet
253
+ *.proto
254
+ *.sav
255
+ *.tsv
256
+ *.xls
257
+ *.xlsx
258
+ *.xml
259
+
260
+ # Files containing env and secret variables
261
+ *.cert
262
+ *.crt
263
+ *.csr
264
+ *.env
265
+ *.envrc
266
+ *.httr-oauth
267
+ *.key
268
+ *.p12
269
+ *.pem
270
+ *.pgp
271
+ *.ssh
272
+ *.venv
273
+ env/
274
+ ENV/
275
+ env.bak/
276
+ .ssh/
277
+ venv/
278
+ venv.bak/
@@ -0,0 +1,56 @@
1
+ repos:
2
+ - repo: https://github.com/pre-commit/pre-commit-hooks
3
+ rev: v6.0.0
4
+ hooks:
5
+ - id: check-added-large-files
6
+ - id: check-merge-conflict
7
+ args: ["--assume-in-merge"]
8
+ - id: check-toml
9
+ - id: check-yaml
10
+ - id: debug-statements
11
+ - id: detect-aws-credentials
12
+ args:
13
+ - --allow-missing-credentials
14
+ - id: detect-private-key
15
+ - id: end-of-file-fixer
16
+ - id: name-tests-test
17
+ args: ["--pytest-test-first"]
18
+ - id: no-commit-to-branch # Protects main by default
19
+ - id: trailing-whitespace
20
+
21
+ - repo: https://github.com/kynan/nbstripout
22
+ rev: 0.9.1
23
+ hooks:
24
+ - id: nbstripout
25
+
26
+ - repo: https://github.com/astral-sh/ruff-pre-commit
27
+ rev: v0.16.1
28
+ hooks:
29
+ - id: ruff-check # Linter
30
+ args: [--fix]
31
+ - id: ruff-format # Formatter
32
+
33
+ - repo: https://github.com/crate-ci/typos
34
+ rev: v1.48.0
35
+ hooks:
36
+ - id: typos
37
+ name: Commit message typos
38
+ args: [] # Turns off automatic fixing
39
+ stages: [commit-msg]
40
+ - id: typos
41
+ name: Script typos
42
+ args: [] # Turns off automatic fixing
43
+ stages: [pre-commit]
44
+
45
+ # - repo: https://github.com/gitleaks/gitleaks
46
+ # rev: v8.30.1
47
+ # hooks:
48
+ # - id: gitleaks
49
+
50
+ - repo: local
51
+ hooks:
52
+ - id: restricted-filenames
53
+ name: Restricted filenames
54
+ entry: These file extensions are restricted. Data should be removed from the commit
55
+ language: fail
56
+ files: .*\.(arvo|bson|csv|dat|fbs|feather|h5|hd|hdf5|ndjson|orc|parquet|proto|sav|tsv|xls|xlsx|xml)