Skip to content

Static type checking #68

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Draft
wants to merge 146 commits into
base: main
Choose a base branch
from
Draft
Show file tree
Hide file tree
Changes from all commits
Commits
Show all changes
146 commits
Select commit Hold shift + click to select a range
47b1a3e
upgrade requirements
matthew-shaw Apr 28, 2023
2c9a0ed
add mypy static type checker
matthew-shaw Apr 28, 2023
3d22623
add python type annotations
matthew-shaw Apr 28, 2023
a123ca7
string return types
matthew-shaw Apr 28, 2023
7a4a328
upgrade requirements
matthew-shaw Apr 29, 2023
83757e2
parameter type hints
matthew-shaw Apr 30, 2023
1b2d4d2
add type and import checks
matthew-shaw Apr 30, 2023
bce796c
upgrade requirements
matthew-shaw May 4, 2023
b4baa3b
fix cookie form assignment
matthew-shaw May 4, 2023
889d997
Merge branch 'main' into typing
matthew-shaw May 9, 2023
4a8dbd7
upgrade requirements
matthew-shaw May 9, 2023
09dc5db
Merge branch 'main' into typing
matthew-shaw Jul 28, 2023
d771484
upgrade requirements
matthew-shaw Jul 28, 2023
2718831
Merge branch 'main' into typing
matthew-shaw Sep 27, 2023
bd2445b
update mypy
matthew-shaw Sep 27, 2023
67a2d8e
WIP
matthew-shaw Oct 9, 2023
14118b9
Merge branch 'typing' of github.com:LandRegistry/govuk-frontend-flask…
matthew-shaw Oct 9, 2023
4b701af
upgrade requirements
matthew-shaw Oct 9, 2023
cf277a9
Merge branch 'main' into typing
matthew-shaw Feb 14, 2024
db50220
Merge branch 'main' into typing
matthew-shaw May 31, 2024
d96fcf2
upgrade requirement
matthew-shaw May 31, 2024
a563ee4
Merge branch 'main' into typing
matthew-shaw Oct 15, 2024
fdf4fae
ignore missing stubs
matthew-shaw Oct 17, 2024
8c56d4d
add mypy to github action
matthew-shaw Oct 17, 2024
c6cdb85
install type stubs first
matthew-shaw Oct 17, 2024
3481b2f
try again
matthew-shaw Oct 17, 2024
d830b4b
and again
matthew-shaw Oct 17, 2024
44f9878
python 3.13
matthew-shaw Nov 4, 2024
67609fc
formatting
matthew-shaw Dec 4, 2024
f1da3cd
upgrade reqs
matthew-shaw Dec 4, 2024
2258b6c
use alpine image
matthew-shaw Dec 4, 2024
4797f64
update security and cache control headers
matthew-shaw Dec 4, 2024
c30f63b
add dockerignore file
matthew-shaw Dec 4, 2024
b8d3437
use ubuntu 24.04
matthew-shaw Jan 13, 2025
f7f3cf7
upgrade requirements
matthew-shaw Jan 24, 2025
8df5d9f
type ignores
matthew-shaw Jan 24, 2025
e5479a6
govuk-frontend 5.8.0
matthew-shaw Jan 24, 2025
5906ea7
type annotations
matthew-shaw Jan 24, 2025
5686108
more typing improvements
matthew-shaw Jan 24, 2025
b974820
comments and docstrings
matthew-shaw Jan 24, 2025
d80fda6
add tests
matthew-shaw Jan 26, 2025
fb72639
uncomment
matthew-shaw Jan 26, 2025
8433c02
type annotations and docstrings
matthew-shaw Jan 27, 2025
4cfcbf5
Merge branch 'main' into typing
matthew-shaw Jan 27, 2025
ad72bbb
upgrade requirements
matthew-shaw Jan 27, 2025
f3e50d6
Merge branch 'typing' of https://github.com/LandRegistry/govuk-fronte…
matthew-shaw Jan 27, 2025
177fde8
use test config
matthew-shaw Jan 27, 2025
aa6cfa9
replace character
matthew-shaw Jan 27, 2025
c77069c
update test config
matthew-shaw Jan 27, 2025
85776d8
test main routes
matthew-shaw Jan 30, 2025
4bc4f6b
add http error tests
matthew-shaw Jan 31, 2025
876c381
add custom validator tests
matthew-shaw Feb 3, 2025
491c3d9
upgrades
matthew-shaw Feb 3, 2025
2cffd8b
Merge branch 'typing' of https://github.com/LandRegistry/govuk-fronte…
matthew-shaw Feb 3, 2025
5fc2e12
upgrade dependencies
matthew-shaw Feb 16, 2025
3c3b05b
WIP use npm to install govuk-frontend
matthew-shaw Feb 16, 2025
a1a0c5e
url
matthew-shaw Feb 18, 2025
123ba3a
dont format html files
matthew-shaw Feb 19, 2025
4455bc3
upgrade
matthew-shaw Feb 19, 2025
d67fd2c
patch upgrade
matthew-shaw Feb 24, 2025
5e71ab3
webpack asset build
matthew-shaw Feb 24, 2025
7c50604
build assets in web container
matthew-shaw Feb 24, 2025
e7be5c4
remove ls's
matthew-shaw Feb 24, 2025
3529eaf
remove flask assets package
matthew-shaw Feb 24, 2025
f3b1d11
document build process
matthew-shaw Feb 25, 2025
ae1c8e8
update dockerignores
matthew-shaw Feb 25, 2025
a454126
remove duplicate
matthew-shaw Feb 25, 2025
6dea98a
upgrade sass
matthew-shaw Feb 25, 2025
111c4bf
move and rename src files
matthew-shaw Feb 25, 2025
ff972f8
modular js
matthew-shaw Feb 25, 2025
d6c4338
import modules and tweak assets path
matthew-shaw Feb 25, 2025
5c5d035
use webpack built static assets
matthew-shaw Feb 25, 2025
8eb4434
remove extra js init
matthew-shaw Feb 25, 2025
09d3eb3
update js hash in csp
matthew-shaw Feb 25, 2025
41e9949
rename script to install demos
matthew-shaw Feb 25, 2025
8c6a308
upgrades
matthew-shaw Feb 25, 2025
68eb157
formatting
matthew-shaw Feb 25, 2025
c99110e
demo install
matthew-shaw Feb 25, 2025
0d1d419
use govuk example imports
matthew-shaw Feb 25, 2025
524d56a
dont format dist output
matthew-shaw Feb 25, 2025
848616e
minify css, transpile js
matthew-shaw Feb 28, 2025
f434776
use min assets
matthew-shaw Feb 28, 2025
eeee186
reorder to optimise cache
matthew-shaw Feb 28, 2025
b84bb42
minimal css and js imports
matthew-shaw Feb 28, 2025
13273aa
only es6 compatible
matthew-shaw Feb 28, 2025
9da251d
use govuk default
matthew-shaw Feb 28, 2025
a6a65c0
revert
matthew-shaw Feb 28, 2025
28f3e32
remove guidance text
matthew-shaw Mar 5, 2025
3cc22db
remove unused hash
matthew-shaw Mar 5, 2025
445864d
govuk 5.9.0
matthew-shaw Mar 5, 2025
6782ff0
reorder layers
matthew-shaw Mar 5, 2025
cb52bcf
minimal css and js imports
matthew-shaw Mar 5, 2025
d57372e
latest govuk components
matthew-shaw Mar 5, 2025
e90401f
reorder services
matthew-shaw Mar 8, 2025
6863fe9
stale-while-revalidate cache control
matthew-shaw Mar 10, 2025
890730e
upgrade
matthew-shaw Mar 11, 2025
4acca2d
multiple entry points
matthew-shaw Mar 11, 2025
b60b36d
trim whitespace
matthew-shaw Mar 11, 2025
6d90c62
use chown flag in copy
matthew-shaw Mar 12, 2025
6e360d0
specific version control
matthew-shaw Mar 12, 2025
b113a67
upgrades
matthew-shaw Mar 12, 2025
aba1e85
move cmd from compose to dockerfile
matthew-shaw Mar 12, 2025
70a47a8
configure docker compose watch
matthew-shaw Mar 12, 2025
0deefbb
update depends on order
matthew-shaw Mar 13, 2025
11cd2d1
govuk browser support
matthew-shaw Mar 13, 2025
b5c7104
use copy webpack plugin to move other assets
matthew-shaw Mar 13, 2025
2aa7799
dont need to copy in dockerfile now
matthew-shaw Mar 13, 2025
7bed15a
more tweaks
matthew-shaw Mar 14, 2025
dbf94e9
webpack build
matthew-shaw Mar 14, 2025
8795179
add sass ignores
matthew-shaw Mar 15, 2025
6723a8f
remove demo content
matthew-shaw Mar 15, 2025
121cea9
remove demo content
matthew-shaw Mar 15, 2025
f62e5d6
certs only generated in container
matthew-shaw Mar 15, 2025
519c7c2
use clearer names
matthew-shaw Mar 15, 2025
1edce9a
change workdir
matthew-shaw Mar 15, 2025
d6fa373
add ncu
matthew-shaw Mar 17, 2025
2a8bc4e
static asset docs
matthew-shaw Mar 17, 2025
c21696d
typos
matthew-shaw Mar 17, 2025
237e73c
remove venv
matthew-shaw Mar 17, 2025
f3b4d4e
upgrade
matthew-shaw Mar 20, 2025
3c1661b
update
matthew-shaw Mar 20, 2025
a21870b
less confusing path names
matthew-shaw Mar 20, 2025
45b9dbd
use postcss preset and autoprefixer
matthew-shaw Mar 23, 2025
eeb267d
author object
matthew-shaw Mar 23, 2025
0e32100
add cssnano link
matthew-shaw Mar 24, 2025
c6fdb9e
add eslint and babel config
matthew-shaw Mar 25, 2025
8a782be
correct sync target
matthew-shaw Mar 25, 2025
e2d7ea5
use url_for
matthew-shaw Mar 26, 2025
fff7e39
restart on sync due to multiple gunicorn workers
matthew-shaw Mar 26, 2025
0766222
add hash query params to output files
matthew-shaw Mar 26, 2025
d7b6331
rebuild
matthew-shaw Mar 26, 2025
f9df3e7
babel config wasnt being used
matthew-shaw Mar 26, 2025
95fb87d
unused file
matthew-shaw Mar 26, 2025
6f57425
tweak docker ignores
matthew-shaw Mar 31, 2025
49d4c00
seperate web and app ignores
matthew-shaw Mar 31, 2025
2ecf38a
add upgrade scripts
matthew-shaw Mar 31, 2025
852d8e4
add upgrade scripts to docs
matthew-shaw Mar 31, 2025
7c8f73c
ignore venv
matthew-shaw Mar 31, 2025
47436e0
remove heroku deployment files
matthew-shaw Mar 31, 2025
307f08f
remove dev server docs
matthew-shaw Mar 31, 2025
4a71051
add service navigation items
matthew-shaw Apr 7, 2025
bd68b03
upgrades
matthew-shaw Apr 7, 2025
58849d8
heading size
matthew-shaw Apr 7, 2025
cdc3cd9
copy custom manifest
matthew-shaw Apr 9, 2025
5f380cf
upgrade
matthew-shaw Apr 9, 2025
3e41cfe
rebuild
matthew-shaw Apr 12, 2025
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
23 changes: 23 additions & 0 deletions .dockerignore
Original file line number Diff line number Diff line change
@@ -0,0 +1,23 @@
.coverage
.git
.github
.mypy_cache
.nvmrc
.python-version
.vscode
**/__pycache__
**/.gitignore
**/dist
CHANGELOG.md
CODE_OF_CONDUCT.md
compose.yml
CONTRIBUTING.md
env
LICENSE
README.md
requirements_dev.in
requirements_dev.txt
requirements.in
setup.cfg
tests
venv
24 changes: 13 additions & 11 deletions .github/ISSUE_TEMPLATE/bug_report.md
Original file line number Diff line number Diff line change
@@ -1,17 +1,17 @@
---
name: Bug report
about: Create a report to help us improve
title: ''
labels: ''
assignees: ''

title: ""
labels: ""
assignees: ""
---

**Describe the bug**
A clear and concise description of what the bug is.

**To Reproduce**
Steps to reproduce the behavior:

1. Go to '...'
2. Click on '....'
3. Scroll down to '....'
Expand All @@ -24,15 +24,17 @@ A clear and concise description of what you expected to happen.
If applicable, add screenshots to help explain your problem.

**Desktop (please complete the following information):**
- OS: [e.g. iOS]
- Browser [e.g. chrome, safari]
- Version [e.g. 22]

- OS: [e.g. iOS]
- Browser [e.g. chrome, safari]
- Version [e.g. 22]

**Smartphone (please complete the following information):**
- Device: [e.g. iPhone6]
- OS: [e.g. iOS8.1]
- Browser [e.g. stock browser, safari]
- Version [e.g. 22]

- Device: [e.g. iPhone6]
- OS: [e.g. iOS8.1]
- Browser [e.g. stock browser, safari]
- Version [e.g. 22]

**Additional context**
Add any other context about the problem here.
7 changes: 3 additions & 4 deletions .github/ISSUE_TEMPLATE/feature_request.md
Original file line number Diff line number Diff line change
@@ -1,10 +1,9 @@
---
name: Feature request
about: Suggest an idea for this project
title: ''
labels: ''
assignees: ''

title: ""
labels: ""
assignees: ""
---

**Is your feature request related to a problem? Please describe.**
Expand Down
2 changes: 1 addition & 1 deletion .github/workflows/codeql.yml
Original file line number Diff line number Diff line change
Expand Up @@ -28,7 +28,7 @@ jobs:
# - https://gh.io/supported-runners-and-hardware-resources
# - https://gh.io/using-larger-runners
# Consider using larger runners for possible analysis time improvements.
runs-on: ${{ (matrix.language == 'swift' && 'macos-latest') || 'ubuntu-latest' }}
runs-on: ${{ (matrix.language == 'swift' && 'macos-latest') || 'ubuntu-24.04' }}
timeout-minutes: ${{ (matrix.language == 'swift' && 120) || 360 }}
permissions:
actions: read
Expand Down
2 changes: 1 addition & 1 deletion .github/workflows/dependency-review.yml
Original file line number Diff line number Diff line change
Expand Up @@ -25,7 +25,7 @@ permissions:

jobs:
dependency-review:
runs-on: ubuntu-latest
runs-on: ubuntu-24.04
steps:
- name: "Checkout repository"
uses: actions/checkout@v4
Expand Down
8 changes: 5 additions & 3 deletions .github/workflows/python-app.yml
Original file line number Diff line number Diff line change
Expand Up @@ -14,7 +14,7 @@ permissions:

jobs:
build:
runs-on: ubuntu-latest
runs-on: ubuntu-24.04
steps:
- uses: actions/checkout@v4
- name: Set up Python 3.13
Expand All @@ -30,6 +30,8 @@ jobs:
run: pip-audit -r requirements.txt
- name: Check code for potential security vulnerabilities
run: bandit -r . -x /tests
- name: Static type checking
run: mypy . --install-types --non-interactive
- name: Check code formatting
run: |
black . -t py312 -l 120 --check
Expand All @@ -40,5 +42,5 @@ jobs:
flake8 . --count --select=E9,F63,F7,F82 --show-source --statistics
# exit-zero treats all errors as warnings.
flake8 . --count --exit-zero --max-complexity=10 --max-line-length=120 --statistics
# - name: Test with pytest
# run: python -m pytest --cov=app --cov-report=term-missing --cov-branch
- name: Test with pytest
run: python -m pytest --cov=app --cov-report=term-missing --cov-branch
29 changes: 29 additions & 0 deletions .github/workflows/webpack.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,29 @@
name: NodeJS with Webpack

on:
push:
branches: ["main"]
pull_request:
branches: ["main"]

jobs:
build:
runs-on: ubuntu-latest

strategy:
matrix:
node-version: [18.x, 20.x, 22.x]

steps:
- uses: actions/checkout@v4

- name: Use Node.js ${{ matrix.node-version }}
uses: actions/setup-node@v4
with:
node-version: ${{ matrix.node-version }}

- name: Build
run: |
cd web
npm install
npx webpack
Loading
Loading