Skip to content

Commit

Permalink
pre-commit check
Browse files Browse the repository at this point in the history
  • Loading branch information
colinbowen committed Oct 2, 2023
1 parent fac9b0a commit 60137bd
Show file tree
Hide file tree
Showing 28 changed files with 178 additions and 50 deletions.
10 changes: 5 additions & 5 deletions .flaskenv
Original file line number Diff line number Diff line change
@@ -1,12 +1,12 @@
CONTACT_EMAIL=[contact email]
CONTACT_PHONE=[contact phone]
DEPARTMENT_NAME=[name of department]
DEPARTMENT_URL=[url of department]
DEPARTMENT_NAME="The National Archives"
DEPARTMENT_URL="https://www.nationalarchives.gov.uk/"
FLASK_APP=govuk-frontend-flask.py
FLASK_DEBUG=True
FLASK_RUN_PORT=5000
REDIS_URL=memory://
SECRET_KEY=
SERVICE_NAME=[name of service]
SERVICE_PHASE=[phase]
SERVICE_URL=[url of service]
SERVICE_NAME="AYR - Access Your Records"
SERVICE_PHASE="BETA"
SERVICE_URL="https://ayr.nationalarchives.gov.uk/"
6 changes: 3 additions & 3 deletions .github/workflows/codeql.yml
Original file line number Diff line number Diff line change
Expand Up @@ -48,11 +48,11 @@ jobs:
# If you wish to specify custom queries, you can do so here or in a config file.
# By default, queries listed here will override any specified in a config file.
# Prefix the list here with "+" to use these queries and those in the config file.

# Details on CodeQL's query packs refer to : https://docs.github.com/en/code-security/code-scanning/automatically-scanning-your-code-for-vulnerabilities-and-errors/configuring-code-scanning#using-queries-in-ql-packs
# queries: security-extended,security-and-quality


# Autobuild attempts to build any compiled languages (C/C++, C#, or Java).
# If this step fails, then you should remove it and run the build manually (see below)
- name: Autobuild
Expand All @@ -61,7 +61,7 @@ jobs:
# ℹ️ Command-line programs to run using the OS shell.
# 📚 See https://docs.github.com/en/actions/using-workflows/workflow-syntax-for-github-actions#jobsjob_idstepsrun

# If the Autobuild fails above, remove it and uncomment the following three lines.
# If the Autobuild fails above, remove it and uncomment the following three lines.
# modify them (or add more) to build your code if your project, please refer to the EXAMPLE below for guidance.

# - run: |
Expand Down
18 changes: 18 additions & 0 deletions .pre-commit-config.yaml
Original file line number Diff line number Diff line change
@@ -0,0 +1,18 @@
# See https://pre-commit.com for more information
# See https://pre-commit.com/hooks.html for more hooks
repos:
- repo: https://github.com/pre-commit/pre-commit-hooks
rev: v3.2.0
hooks:
- id: trailing-whitespace
- id: end-of-file-fixer
- id: check-yaml
- id: check-json
- id: check-added-large-files
- id: check-merge-conflict

- repo: https://github.com/Yelp/detect-secrets
rev: v1.4.0
hooks:
- id: detect-secrets
args: ['--baseline', '.secrets.baseline']
112 changes: 112 additions & 0 deletions .secrets.baseline
Original file line number Diff line number Diff line change
@@ -0,0 +1,112 @@
{
"version": "1.4.0",
"plugins_used": [
{
"name": "ArtifactoryDetector"
},
{
"name": "AWSKeyDetector"
},
{
"name": "AzureStorageKeyDetector"
},
{
"name": "Base64HighEntropyString",
"limit": 4.5
},
{
"name": "BasicAuthDetector"
},
{
"name": "CloudantDetector"
},
{
"name": "DiscordBotTokenDetector"
},
{
"name": "GitHubTokenDetector"
},
{
"name": "HexHighEntropyString",
"limit": 3.0
},
{
"name": "IbmCloudIamDetector"
},
{
"name": "IbmCosHmacDetector"
},
{
"name": "JwtTokenDetector"
},
{
"name": "KeywordDetector",
"keyword_exclude": ""
},
{
"name": "MailchimpDetector"
},
{
"name": "NpmDetector"
},
{
"name": "PrivateKeyDetector"
},
{
"name": "SendGridDetector"
},
{
"name": "SlackDetector"
},
{
"name": "SoftlayerDetector"
},
{
"name": "SquareOAuthDetector"
},
{
"name": "StripeDetector"
},
{
"name": "TwilioKeyDetector"
}
],
"filters_used": [
{
"path": "detect_secrets.filters.allowlist.is_line_allowlisted"
},
{
"path": "detect_secrets.filters.common.is_ignored_due_to_verification_policies",
"min_level": 2
},
{
"path": "detect_secrets.filters.heuristic.is_indirect_reference"
},
{
"path": "detect_secrets.filters.heuristic.is_likely_id_string"
},
{
"path": "detect_secrets.filters.heuristic.is_lock_file"
},
{
"path": "detect_secrets.filters.heuristic.is_not_alphanumeric_string"
},
{
"path": "detect_secrets.filters.heuristic.is_potential_uuid"
},
{
"path": "detect_secrets.filters.heuristic.is_prefixed_with_dollar_sign"
},
{
"path": "detect_secrets.filters.heuristic.is_sequential_string"
},
{
"path": "detect_secrets.filters.heuristic.is_swagger_file"
},
{
"path": "detect_secrets.filters.heuristic.is_templated_secret"
}
],
"results": {},
"generated_at": "2023-01-25T17:56:29Z"
}
1 change: 0 additions & 1 deletion Dockerfile
Original file line number Diff line number Diff line change
Expand Up @@ -7,4 +7,3 @@ RUN apt-get update; apt-get install curl -y
RUN ./build.sh
EXPOSE 8000
CMD [ "python3", "-m" , "flask", "run", "--host=0.0.0.0"]

2 changes: 1 addition & 1 deletion Procfile
Original file line number Diff line number Diff line change
@@ -1 +1 @@
web: ./build.sh; gunicorn govuk-frontend-flask:app --log-file -
web: ./build.sh; gunicorn govuk-frontend-flask:app --log-file -
4 changes: 2 additions & 2 deletions app/main/routes.py
Original file line number Diff line number Diff line change
Expand Up @@ -48,14 +48,14 @@ def callback():
grant_type='authorization_code',
code=code,
redirect_uri="http://localhost:5000/callback")

session["access_token_response"] = access_token_response
session["access_token"] = access_token_response["access_token"]
session["refresh_token"] = access_token_response["refresh_token"]
session["token_type"] = access_token_response["token_type"]
session["token_scope"] = access_token_response["scope"]
session["session_state"] = access_token_response["session_state"]

# send token to api gateway
api_gateway_url = 'https://ljciqom6td.execute-api.eu-west-2.amazonaws.com/Dev'

Expand Down
2 changes: 1 addition & 1 deletion app/static/src/css/custom.css
Original file line number Diff line number Diff line change
@@ -1 +1 @@
/* Your custom CSS goes here... */
/* Your custom CSS goes here... */
2 changes: 1 addition & 1 deletion app/static/src/js/cookie-banner.js
Original file line number Diff line number Diff line change
Expand Up @@ -48,4 +48,4 @@
cookieBanner.hidden = true;
});
}
})();
})();
2 changes: 1 addition & 1 deletion app/static/src/js/custom.js
Original file line number Diff line number Diff line change
@@ -1 +1 @@
// Your custom JS goes here...
// Your custom JS goes here...
2 changes: 1 addition & 1 deletion app/templates/base.html
Original file line number Diff line number Diff line change
Expand Up @@ -166,4 +166,4 @@
<script>window.GOVUKFrontend.initAll()</script>
<!--<![endif]-->
{% assets "js" %}<script type="text/javascript" src="{{ ASSET_URL }}"></script>{% endassets %}
{% endblock %}
{% endblock %}
2 changes: 1 addition & 1 deletion app/templates/demos/component.html
Original file line number Diff line number Diff line change
Expand Up @@ -157,4 +157,4 @@ <h2 id="{{fixture.name | replace(' ', '-')}}" class="govuk-heading-l">{{fixture.
</div>
</div>
{% endfor %}
{% endblock %}
{% endblock %}
2 changes: 1 addition & 1 deletion app/templates/demos/components.html
Original file line number Diff line number Diff line change
Expand Up @@ -32,4 +32,4 @@ <h1 class="govuk-heading-l">Components</h1>
</ul>
</div>
</div>
{% endblock %}
{% endblock %}
8 changes: 4 additions & 4 deletions app/templates/demos/conditional_reveal.html
Original file line number Diff line number Diff line change
Expand Up @@ -62,12 +62,12 @@ <h1 class="govuk-heading-xl">Conditionally revealed inputs</h1>

<!--
Render the radio buttons
The conditional field html is passed in via the params argument which is
The conditional field html is passed in via the params argument which is
deep merged into the params generated by govuk-frontend-wtf.
This is the same structure that is documented on the govuk design system.
https://design-system.service.gov.uk/components/radios/#conditionally-revealing-a-related-question
The field definition in ConditionalRevealForm has three options.
Therefore we have an array of three items here to match.
-->
Expand All @@ -89,7 +89,7 @@ <h1 class="govuk-heading-xl">Conditionally revealed inputs</h1>
}
}
]
}) }}
}) }}

{{ form.submit }}
</form>
Expand Down
2 changes: 1 addition & 1 deletion app/templates/demos/forms.html
Original file line number Diff line number Diff line change
Expand Up @@ -34,4 +34,4 @@ <h1 class="govuk-heading-l">Forms</h1>
</ul>
</div>
</div>
{% endblock %}
{% endblock %}
2 changes: 1 addition & 1 deletion app/templates/main/400.html
Original file line number Diff line number Diff line change
Expand Up @@ -12,4 +12,4 @@ <h1 class="govuk-heading-l">Server Error</h1>
<p class="govuk-body">If you pasted the web address, check you copied the entire address.</p>
</div>
</div>
{% endblock %}
{% endblock %}
2 changes: 1 addition & 1 deletion app/templates/main/404.html
Original file line number Diff line number Diff line change
Expand Up @@ -12,4 +12,4 @@ <h1 class="govuk-heading-l">Page not found</h1>
<p class="govuk-body">If you pasted the web address, check you copied the entire address.</p>
</div>
</div>
{% endblock %}
{% endblock %}
2 changes: 1 addition & 1 deletion app/templates/main/429.html
Original file line number Diff line number Diff line change
Expand Up @@ -12,4 +12,4 @@ <h1 class="govuk-heading-l">Sorry, there is a problem</h1>
<p class="govuk-body">Try again later.</p>
</div>
</div>
{% endblock %}
{% endblock %}
2 changes: 1 addition & 1 deletion app/templates/main/500.html
Original file line number Diff line number Diff line change
Expand Up @@ -12,4 +12,4 @@ <h1 class="govuk-heading-l">Sorry, there is a problem with the service</h1>
<p class="govuk-body">We saved your answers. They will be available for 30 days.</p>
</div>
</div>
{% endblock %}
{% endblock %}
2 changes: 1 addition & 1 deletion app/templates/main/503.html
Original file line number Diff line number Diff line change
Expand Up @@ -11,4 +11,4 @@ <h1 class="govuk-heading-l">Sorry, the service is unavailable</h1>
<p class="govuk-body">You will be able to use the service from 9am on Monday 19&nbsp;November&nbsp;2018.</p>
</div>
</div>
{% endblock %}
{% endblock %}
Loading

0 comments on commit 60137bd

Please sign in to comment.