Skip to content

Commit e45214c

Browse files
[FEATURE] Adds pre-commit hooks, Makefile recipe and Github action - AIL-162
1 parent 0e43bf5 commit e45214c

File tree

4 files changed

+42
-2
lines changed

4 files changed

+42
-2
lines changed

.github/workflows/ci.yml

Lines changed: 17 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -6,6 +6,23 @@ on:
66
pull_request:
77

88
jobs:
9+
pre_commit:
10+
runs-on: ubuntu-latest
11+
steps:
12+
- name: Checkout code
13+
uses: actions/checkout@v4
14+
15+
- name: Set up Python
16+
uses: actions/setup-python@v4
17+
with:
18+
python-version: '3.9'
19+
20+
- name: Install Pre-commit Dependencies
21+
run: pip install pre-commit
22+
23+
- name: Run Pre-commit Hooks
24+
run: pre-commit run --all-files
25+
926
tests:
1027
runs-on: ubuntu-latest
1128
strategy:

.pre-commit-config.yaml

Lines changed: 19 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,19 @@
1+
repos:
2+
- repo: https://github.com/pre-commit/pre-commit-hooks
3+
rev: v5.0.0
4+
hooks:
5+
- id: end-of-file-fixer
6+
- id: trailing-whitespace
7+
- id: check-yaml
8+
- id: check-json
9+
- id: pretty-format-json
10+
args: [ --autofix ]
11+
exclude: frontend/package.*.json
12+
- id: check-merge-conflict
13+
- id: check-symlinks
14+
- id: detect-private-key
15+
16+
- repo: https://github.com/crate-ci/typos
17+
rev: v1.26.8
18+
hooks:
19+
- id: typos

ChangeLog.md

Lines changed: 5 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -9,6 +9,9 @@ and this project adheres to [Semantic Versioning](http://semver.org/spec/v2.0.0.
99
### Fixed
1010
- Deprecation warning for `datetime.utcnow()`
1111

12+
### Added
13+
- Added pre-commit hooks and Github CI action for code formatting and linting.
14+
1215
## [v0.3.10] - 2024-10-16
1316
### Security
1417
- Bump certifi minimum version to 2024.07.04
@@ -74,9 +77,9 @@ and this project adheres to [Semantic Versioning](http://semver.org/spec/v2.0.0.
7477

7578
## [v0.3.1] - 2019-08-07
7679
### Fixed
77-
- Fixed an issue where the `DataApi` class's `results_iter` method would return no data
80+
- Fixed an issue where the `DataApi` class's `results_iter` method would return no data
7881
when receiving responses from Data API endpoints that set the "`data`" field of the
79-
response to an object (like the [itembank/questions endpoint](https://reference.learnosity.com/data-api/endpoints/itembank_endpoints#getQuestions)
82+
response to an object (like the [itembank/questions endpoint](https://reference.learnosity.com/data-api/endpoints/itembank_endpoints#getQuestions)
8083
when `item_references` is included in the request).
8184

8285
## [v0.3.0] - 2019-06-17

setup.py

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -13,6 +13,7 @@
1313
]
1414

1515
DEV_REQUIRES = [
16+
'pre-commit',
1617
'setuptools',
1718
'twine',
1819
'wheel',

0 commit comments

Comments
 (0)