Skip to content
This repository was archived by the owner on Oct 23, 2023. It is now read-only.

Commit 9469a70

Browse files
authored
Merge pull request #237 from CSCfi/refactor/spelling
switch from misspell to pyspelling and introduce black formatting
2 parents 70ee909 + c833099 commit 9469a70

18 files changed

+555
-305
lines changed

.github/workflows/docs.yml

Lines changed: 3 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -12,10 +12,9 @@ jobs:
1212
runs-on: ${{ matrix.os }}
1313

1414
steps:
15-
- name: Spell check install
16-
run: curl -L https://git.io/misspell | bash
17-
- name: Spell check docs
18-
run: bin/misspell -error docs/*
15+
- uses: actions/checkout@master
16+
- uses: rojopolis/spellcheck-github-actions@0.20.0
17+
name: Spellcheck
1918

2019
code_docs:
2120
strategy:

.github/workflows/style.yml

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -26,9 +26,11 @@ jobs:
2626
run: tox -e flake8
2727
- name: Do bandit static check with tox
2828
run: tox -e bandit
29+
- name: Black formatting check
30+
run: tox -e black
2931
- name: Install libcurl-devel
3032
run: |
3133
sudo apt-get update
3234
sudo apt-get install libcurl4-openssl-dev
33-
- name: Do typing check with tox
35+
- name: Type hints check
3436
run: tox -e mypy

.spellcheck.yml

Lines changed: 27 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,27 @@
1+
matrix:
2+
- name: Markdown
3+
aspell:
4+
lang: en
5+
dictionary:
6+
wordlists:
7+
- .wordlist.txt
8+
encoding: utf-8
9+
pipeline:
10+
- pyspelling.filters.markdown:
11+
- pyspelling.filters.context:
12+
context_visible_first: true
13+
escapes: '\\[\\`~]'
14+
delimiters:
15+
# Ignore text between inline back ticks as this is code or hightlight words
16+
- open: '(?P<open>`+)'
17+
close: '(?P=open)'
18+
# Ignore surrounded in <> as in RST it is link
19+
- open: '<([A-Za-z0-9-_:.]+)|(https?://[^\\s/$.?#].[^\\s]+|[A-Za-z0-9-_:.]+)'
20+
close: '>'
21+
# Ignore code in RST starting with $
22+
- open: '\$.+'
23+
close: ''
24+
sources:
25+
- 'docs/*.rst'
26+
- '**/*.md'
27+
default_encoding: utf-8

.wordlist.txt

Lines changed: 144 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,144 @@
1+
AAI
2+
accessType
3+
aiohttp
4+
alleleCount
5+
alleleRequest
6+
alternateBases
7+
alternativeUrl
8+
api
9+
APIBehavior
10+
APITest
11+
apiVersion
12+
assemblyId
13+
automodule
14+
autosummary
15+
beacondb
16+
beaconId
17+
beaconpy
18+
BND
19+
BONA
20+
btree
21+
callCount
22+
cd
23+
chr
24+
CHR
25+
claimName
26+
conf
27+
config
28+
contactUrl
29+
containerPort
30+
createdAt
31+
createDateTime
32+
csc
33+
CSC
34+
cscfi
35+
CSCfi
36+
datafile
37+
datafiles
38+
dataloader
39+
dataset
40+
DATASET
41+
datasetAlleleResponses
42+
datasetHandover
43+
datasetId
44+
datasetIds
45+
datasets
46+
dedent
47+
documentationUrl
48+
ebi
49+
ega
50+
EGA
51+
endMax
52+
endMin
53+
env
54+
ENV
55+
Espoo
56+
examplebrowser
57+
exampleid
58+
externalUrl
59+
fi
60+
FIDE
61+
finland
62+
ga
63+
genomic
64+
gh
65+
GH
66+
GHBeacon
67+
github
68+
GRCh
69+
Gunicorn
70+
GunicornUVLoopWebWorker
71+
handoverType
72+
hg
73+
hostPath
74+
html
75+
http
76+
HttpLocust
77+
https
78+
ICT
79+
ietf
80+
imagePullPolicy
81+
includeDatasetResponses
82+
ini
83+
init
84+
io
85+
javascript
86+
jpg
87+
json
88+
JSON
89+
JWK
90+
jwt
91+
JWT
92+
Keilaranta
93+
literalinclude
94+
localhost
95+
logoUrl
96+
matchLabels
97+
mateID
98+
mateName
99+
mateStart
100+
mountPath
101+
namespace
102+
NodePort
103+
OAuth
104+
orgInfo
105+
persistentVolumeClaim
106+
pgtune
107+
postgres
108+
POSTGRES
109+
py
110+
readthedocs
111+
referenceBases
112+
referenceID
113+
referenceName
114+
restartPolicy
115+
rfc
116+
RGB
117+
sampleAlleleRequests
118+
sampleCount
119+
schemas
120+
secretKeyRef
121+
SNP
122+
sql
123+
startMax
124+
startMin
125+
targetPort
126+
TaskSet
127+
TCP
128+
toctree
129+
txt
130+
ua
131+
uk
132+
updatedAt
133+
updateDateTime
134+
uri
135+
url
136+
utils
137+
valueFrom
138+
variantCount
139+
varianttype
140+
variantType
141+
vcf
142+
volumeMounts
143+
welcomeUrl
144+
www

beacon_api/__init__.py

Lines changed: 3 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -24,7 +24,7 @@
2424
__url__ = CONFIG_INFO.url
2525
__alturl__ = CONFIG_INFO.alturl
2626
__createtime__ = CONFIG_INFO.createtime
27-
__updatetime__ = datetime.datetime.now().strftime('%Y-%m-%dT%H:%M:%SZ') # Every restart of the application means an update to it
27+
__updatetime__ = datetime.datetime.now().strftime("%Y-%m-%dT%H:%M:%SZ") # Every restart of the application means an update to it
2828

2929
__org_id__ = CONFIG_INFO.org_id
3030
__org_name__ = CONFIG_INFO.org_name
@@ -33,12 +33,10 @@
3333
__org_welcomeUrl__ = CONFIG_INFO.org_welcomeUrl
3434
__org_contactUrl__ = CONFIG_INFO.org_contactUrl
3535
__org_logoUrl__ = CONFIG_INFO.org_logoUrl
36-
__org_info__ = {'orgInfo': CONFIG_INFO.org_info}
36+
__org_info__ = {"orgInfo": CONFIG_INFO.org_info}
3737

3838
__sample_queries__ = SAMPLE_QUERIES
3939

4040
# GA4GH Discovery
41-
__service_type__ = {'group': f'{CONFIG_INFO.service_group}',
42-
'artifact': f'{CONFIG_INFO.service_artifact}',
43-
'version': f'{__apiVersion__}'}
41+
__service_type__ = {"group": f"{CONFIG_INFO.service_group}", "artifact": f"{CONFIG_INFO.service_artifact}", "version": f"{__apiVersion__}"}
4442
__service_env__ = CONFIG_INFO.environment

beacon_api/conf/config.py

Lines changed: 20 additions & 18 deletions
Original file line numberDiff line numberDiff line change
@@ -18,28 +18,30 @@
1818
import asyncpg
1919
from typing import Awaitable
2020

21-
DB_SCHEMA = os.environ.get('DATABASE_SCHEMA', None)
21+
DB_SCHEMA = os.environ.get("DATABASE_SCHEMA", None)
2222

2323

2424
async def init_db_pool() -> Awaitable:
2525
"""Create a connection pool.
2626
2727
As we will have frequent requests to the database it is recommended to create a connection pool.
2828
"""
29-
return await asyncpg.create_pool(host=os.environ.get('DATABASE_URL', 'localhost'),
30-
port=os.environ.get('DATABASE_PORT', '5432'),
31-
user=os.environ.get('DATABASE_USER', 'beacon'),
32-
password=os.environ.get('DATABASE_PASSWORD', 'beacon'),
33-
database=os.environ.get('DATABASE_NAME', 'beacondb'),
34-
# Multiple schemas can be used, and they need to be comma separated
35-
server_settings={'search_path': DB_SCHEMA if DB_SCHEMA else 'public'},
36-
# initializing with 0 connections allows the web server to
37-
# start and also continue to live
38-
min_size=0,
39-
# for now limiting the number of connections in the pool
40-
max_size=20,
41-
max_queries=50000,
42-
timeout=120,
43-
command_timeout=180,
44-
max_cached_statement_lifetime=0,
45-
max_inactive_connection_lifetime=180)
29+
return await asyncpg.create_pool(
30+
host=os.environ.get("DATABASE_URL", "localhost"),
31+
port=os.environ.get("DATABASE_PORT", "5432"),
32+
user=os.environ.get("DATABASE_USER", "beacon"),
33+
password=os.environ.get("DATABASE_PASSWORD", "beacon"),
34+
database=os.environ.get("DATABASE_NAME", "beacondb"),
35+
# Multiple schemas can be used, and they need to be comma separated
36+
server_settings={"search_path": DB_SCHEMA if DB_SCHEMA else "public"},
37+
# initializing with 0 connections allows the web server to
38+
# start and also continue to live
39+
min_size=0,
40+
# for now limiting the number of connections in the pool
41+
max_size=20,
42+
max_queries=50000,
43+
timeout=120,
44+
command_timeout=180,
45+
max_cached_statement_lifetime=0,
46+
max_inactive_connection_lifetime=180,
47+
)

data/example_metadata.json

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,5 @@
11
{
2-
"name": "1000 genomoe",
2+
"name": "1000 genome",
33
"datasetId": "urn:hg:1000genome",
44
"description": "Data from the 1000 Genomes Project. The 1000 Genomes Project ran between 2008 and 2015, creating the largest public catalogue of human variation and genotype data. As the project ended, the Data Coordination Centre at EMBL-EBI has received continued funding from the Wellcome Trust to maintain and expand the resource.",
55
"assemblyId": "GRCh38",

deploy/test/example_metadata_controlled.json

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,5 @@
11
{
2-
"name": "1000 genomoe",
2+
"name": "1000 genome",
33
"datasetId": "urn:hg:1000genome:controlled",
44
"description": "Data from the 1000 Genomes Project. The 1000 Genomes Project ran between 2008 and 2015, creating the largest public catalogue of human variation and genotype data. As the project ended, the Data Coordination Centre at EMBL-EBI has received continued funding from the Wellcome Trust to maintain and expand the resource.",
55
"assemblyId": "GRCh38",

deploy/test/example_metadata_controlled1.json

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,5 @@
11
{
2-
"name": "1000 genomoe",
2+
"name": "1000 genome",
33
"datasetId": "urn:hg:1000genome:controlled1",
44
"description": "Data from the 1000 Genomes Project. The 1000 Genomes Project ran between 2008 and 2015, creating the largest public catalogue of human variation and genotype data. As the project ended, the Data Coordination Centre at EMBL-EBI has received continued funding from the Wellcome Trust to maintain and expand the resource.",
55
"assemblyId": "GRCh38",

deploy/test/example_metadata_registered.json

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,5 @@
11
{
2-
"name": "1000 genomoe",
2+
"name": "1000 genome",
33
"datasetId": "urn:hg:1000genome:registered",
44
"description": "Data from the 1000 Genomes Project. The 1000 Genomes Project ran between 2008 and 2015, creating the largest public catalogue of human variation and genotype data. As the project ended, the Data Coordination Centre at EMBL-EBI has received continued funding from the Wellcome Trust to maintain and expand the resource.",
55
"assemblyId": "GRCh38",

0 commit comments

Comments
 (0)