Skip to content

Commit

Permalink
Add prettier to pre-commit and run
Browse files Browse the repository at this point in the history
  • Loading branch information
jacksonj04 committed Oct 13, 2023
1 parent fa8e332 commit 9d019fc
Show file tree
Hide file tree
Showing 6 changed files with 85 additions and 82 deletions.
63 changes: 31 additions & 32 deletions .github/workflows/codeql.yml
Original file line number Diff line number Diff line change
Expand Up @@ -13,12 +13,12 @@ name: "CodeQL"

on:
push:
branches: [ "main" ]
branches: ["main"]
pull_request:
# The branches below must be a subset of the branches above
branches: [ "main" ]
branches: ["main"]
schedule:
- cron: '17 10 * * 6'
- cron: "17 10 * * 6"

jobs:
analyze:
Expand All @@ -32,43 +32,42 @@ jobs:
strategy:
fail-fast: false
matrix:
language: [ 'python' ]
language: ["python"]
# CodeQL supports [ 'cpp', 'csharp', 'go', 'java', 'javascript', 'python', 'ruby' ]
# Learn more about CodeQL language support at https://aka.ms/codeql-docs/language-support

steps:
- name: Checkout repository
uses: actions/checkout@v4
- name: Checkout repository
uses: actions/checkout@v4

# Initializes the CodeQL tools for scanning.
- name: Initialize CodeQL
uses: github/codeql-action/init@v2
with:
languages: ${{ matrix.language }}
# 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.
# Initializes the CodeQL tools for scanning.
- name: Initialize CodeQL
uses: github/codeql-action/init@v2
with:
languages: ${{ matrix.language }}
# 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
# 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#, Go, or Java).
# If this step fails, then you should remove it and run the build manually (see below)
- name: Autobuild
uses: github/codeql-action/autobuild@v2

# Autobuild attempts to build any compiled languages (C/C++, C#, Go, or Java).
# If this step fails, then you should remove it and run the build manually (see below)
- name: Autobuild
uses: github/codeql-action/autobuild@v2
# ℹ️ 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

# ℹ️ 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.
# modify them (or add more) to build your code if your project, please refer to the EXAMPLE below for guidance.

# 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: |
# echo "Run, Build Application using script"
# ./location_of_script_within_repo/buildscript.sh

# - run: |
# echo "Run, Build Application using script"
# ./location_of_script_within_repo/buildscript.sh

- name: Perform CodeQL Analysis
uses: github/codeql-action/analyze@v2
with:
category: "/language:${{matrix.language}}"
- name: Perform CodeQL Analysis
uses: github/codeql-action/analyze@v2
with:
category: "/language:${{matrix.language}}"
6 changes: 6 additions & 0 deletions .pre-commit-config.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -30,3 +30,9 @@ repos:
hooks:
- id: mypy
files: ^ds-caselaw-ingester/

- repo: https://github.com/pre-commit/mirrors-prettier
rev: v2.7.1
hooks:
- id: prettier
types_or: [yaml, json, markdown]
8 changes: 4 additions & 4 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -68,10 +68,10 @@ The logs will show the response from the lambda directly below this line. Any va

To run the tests

* [First time] create a virtualenv (`virtualenv venv -p \`which python\`` )
* Activate it with `. venv/bin/activate`
* `scripts/test`
* When you're done, you might want to `deactivate`
- [First time] create a virtualenv (`virtualenv venv -p \`which python\`` )
- Activate it with `. venv/bin/activate`
- `scripts/test`
- When you're done, you might want to `deactivate`

Note that you might get a spurious errors about django config and environment variables if you're running in the wrong environment.

Expand Down
Original file line number Diff line number Diff line change
@@ -1,44 +1,42 @@
{
"producer": {
"name": "TRE",
"process": "transform",
"type": "judgment"
"producer": {
"name": "TRE",
"process": "transform",
"type": "judgment"
},
"parameters": {
"TRE": {
"reference": "TRE-TDR-2022-DNWR",
"payload": {
"filename": "test.docx",
"xml": "TDR-2022-DNWR.xml",
"metadata": "TRE-TDR-2022-DNWR-metadata.json",
"images": ["image1.png"],
"log": "parser.log"
}
},
"parameters": {
"TRE": {
"reference": "TRE-TDR-2022-DNWR",
"payload": {
"filename": "test.docx",
"xml": "TDR-2022-DNWR.xml",
"metadata": "TRE-TDR-2022-DNWR-metadata.json",
"images": [
"image1.png"
],
"log": "parser.log"
}
},
"PARSER": {
"uri": "https://caselaw.nationalarchives.gov.uk/id/ewca/civ/2022/111",
"court": "EWCA-Civil",
"cite": "[2022] EWCA Civ 111",
"date": "2022-01-01",
"name": "X v Y",
"attachments": [],
"error-messages": []
},
"TDR": {
"Consignment-Type": "judgment",
"Bag-Creator": "TDRExportv0.0.29",
"Consignment-Start-Datetime": "2021-12-16T14:51:49Z",
"Consignment-Series": "",
"Source-Organization": "Ministry of Justice",
"Contact-Name": "Tom King",
"Internal-Sender-Identifier": "TDR-2021-CF6L",
"Consignment-Completed-Datetime": "2021-12-16T14:54:06Z",
"Consignment-Export-Datetime": "2021-12-16T14:54:55Z",
"Contact-Email": "[email protected]",
"Payload-Oxum": "45956.1",
"Bagging-Date": "2021-12-16"
}
"PARSER": {
"uri": "https://caselaw.nationalarchives.gov.uk/id/ewca/civ/2022/111",
"court": "EWCA-Civil",
"cite": "[2022] EWCA Civ 111",
"date": "2022-01-01",
"name": "X v Y",
"attachments": [],
"error-messages": []
},
"TDR": {
"Consignment-Type": "judgment",
"Bag-Creator": "TDRExportv0.0.29",
"Consignment-Start-Datetime": "2021-12-16T14:51:49Z",
"Consignment-Series": "",
"Source-Organization": "Ministry of Justice",
"Contact-Name": "Tom King",
"Internal-Sender-Identifier": "TDR-2021-CF6L",
"Consignment-Completed-Datetime": "2021-12-16T14:54:06Z",
"Consignment-Export-Datetime": "2021-12-16T14:54:55Z",
"Contact-Email": "[email protected]",
"Payload-Oxum": "45956.1",
"Bagging-Date": "2021-12-16"
}
}
}
6 changes: 3 additions & 3 deletions notify_templates/email/new_judgment.md
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
A new judgment has been submitted for review; see ((url))

* TDR Consignment Number: ((consignment))
* Submitter: ((submitter))
* Submitted at: ((submitted_at))
- TDR Consignment Number: ((consignment))
- Submitter: ((submitter))
- Submitted at: ((submitted_at))
6 changes: 3 additions & 3 deletions notify_templates/email/updated_judgment.md
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
A new version of the judgment at ((url)) has been submitted!

* TDR Consignment Number: ((consignment))
* Submitter: ((submitter))
* Submitted at: ((submitted_at))
- TDR Consignment Number: ((consignment))
- Submitter: ((submitter))
- Submitted at: ((submitted_at))

0 comments on commit 9d019fc

Please sign in to comment.