Skip to content

Commit 6f653fa

Browse files
authored
Merge branch 'simple-login:master' into master
2 parents fbf6c27 + a04152a commit 6f653fa

File tree

256 files changed

+8681
-6998
lines changed

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

256 files changed

+8681
-6998
lines changed

.github/ISSUE_TEMPLATE/bug_report.md

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -7,12 +7,12 @@ assignees: ''
77

88
---
99

10-
Please note that this is only for bug report.
10+
Please note that this is only for bug report.
1111

1212
For help on your account, please reach out to us at hi[at]simplelogin.io. Please make sure to check out [our FAQ](https://simplelogin.io/faq/) that contains frequently asked questions.
1313

1414

15-
For feature request, you can use our [forum](https://github.com/simple-login/app/discussions/categories/feature-request).
15+
For feature request, you can use our [forum](https://github.com/simple-login/app/discussions/categories/feature-request).
1616

1717
For self-hosted question/issue, please ask in [self-hosted forum](https://github.com/simple-login/app/discussions/categories/self-hosting-question)
1818

.github/changelog_configuration.json

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -18,6 +18,6 @@
1818
],
1919
"ignore_labels": ["ignore"],
2020
"tag_resolver": {
21-
"method": "sort"
21+
"method": "semver"
2222
}
2323
}

.github/workflows/main.yml

Lines changed: 10 additions & 11 deletions
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
name: Run tests & Publish to Docker Registry
22

3-
on:
3+
on:
44
push:
55

66
jobs:
@@ -9,7 +9,7 @@ jobs:
99
strategy:
1010
max-parallel: 4
1111
matrix:
12-
python-version: [3.7, "3.10"]
12+
python-version: ["3.9", "3.10"]
1313

1414
# service containers to run with `postgres-job`
1515
services:
@@ -75,8 +75,7 @@ jobs:
7575

7676
- name: Check formatting & linting
7777
run: |
78-
poetry run black --check .
79-
poetry run flake8
78+
poetry run pre-commit run --all-files
8079
8180
- name: Run db migration
8281
run: |
@@ -140,12 +139,12 @@ jobs:
140139
SENTRY_ORG: ${{ secrets.SENTRY_ORG }}
141140
SENTRY_PROJECT: ${{ secrets.SENTRY_PROJECT }}
142141

143-
- name: Send Telegram message
144-
uses: appleboy/telegram-action@master
145-
with:
146-
to: ${{ secrets.TELEGRAM_TO }}
147-
token: ${{ secrets.TELEGRAM_TOKEN }}
148-
args: Docker image pushed on ${{ github.ref }}
142+
#- name: Send Telegram message
143+
# uses: appleboy/telegram-action@master
144+
# with:
145+
# to: ${{ secrets.TELEGRAM_TO }}
146+
# token: ${{ secrets.TELEGRAM_TOKEN }}
147+
# args: Docker image pushed on ${{ github.ref }}
149148

150149
# If we have generated a tag, generate the changelog, send a notification to slack and create the GitHub release
151150
- name: Build Changelog
@@ -213,4 +212,4 @@ jobs:
213212
release_name: ${{ github.ref }}
214213
body: ${{ steps.build_changelog.outputs.changelog }}
215214
env:
216-
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
215+
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}

.pre-commit-config.yaml

Lines changed: 24 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -1,10 +1,27 @@
1+
exclude: "(migrations|static/node_modules|static/assets|static/vendor)"
2+
default_language_version:
3+
python: python3
14
repos:
2-
- repo: https://github.com/psf/black
3-
rev: 22.1.0
5+
- repo: https://github.com/pre-commit/pre-commit-hooks
6+
rev: v4.2.0
47
hooks:
5-
- id: black
6-
language_version: python3.7
7-
- repo: https://github.com/pycqa/flake8
8-
rev: 4.0.1
8+
- id: check-yaml
9+
- id: trailing-whitespace
10+
- repo: https://github.com/psf/black
11+
rev: 22.3.0
912
hooks:
10-
- id: flake8
13+
- id: black
14+
- repo: https://gitlab.com/pycqa/flake8
15+
rev: 3.9.2
16+
hooks:
17+
- id: flake8
18+
- repo: https://github.com/Riverside-Healthcare/djLint
19+
rev: v1.3.0
20+
hooks:
21+
- id: djlint-jinja
22+
files: '.*\.html'
23+
entry: djlint --reformat
24+
- repo: https://github.com/PyCQA/pylint
25+
rev: v2.14.4
26+
hooks:
27+
- id: pylint

.pylintrc

Lines changed: 227 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,227 @@
1+
[MASTER]
2+
extension-pkg-allow-list=re2
3+
4+
fail-under=7.0
5+
ignore=CVS
6+
ignore-paths=migrations
7+
ignore-patterns=^\.#
8+
jobs=0
9+
10+
[MESSAGES CONTROL]
11+
disable=missing-function-docstring,
12+
missing-module-docstring,
13+
duplicate-code,
14+
#import-error,
15+
missing-class-docstring,
16+
useless-object-inheritance,
17+
use-dict-literal,
18+
logging-format-interpolation,
19+
consider-using-f-string,
20+
unnecessary-comprehension,
21+
inconsistent-return-statements,
22+
wrong-import-order,
23+
line-too-long,
24+
invalid-name,
25+
global-statement,
26+
no-else-return,
27+
unspecified-encoding,
28+
logging-fstring-interpolation,
29+
too-few-public-methods,
30+
bare-except,
31+
fixme,
32+
unnecessary-pass,
33+
f-string-without-interpolation,
34+
super-init-not-called,
35+
unused-argument,
36+
ungrouped-imports,
37+
too-many-locals,
38+
consider-using-with,
39+
too-many-statements,
40+
consider-using-set-comprehension,
41+
unidiomatic-typecheck,
42+
useless-else-on-loop,
43+
too-many-return-statements,
44+
broad-except,
45+
protected-access,
46+
consider-using-enumerate,
47+
too-many-nested-blocks,
48+
too-many-branches,
49+
simplifiable-if-expression,
50+
possibly-unused-variable,
51+
pointless-string-statement,
52+
wrong-import-position,
53+
redefined-outer-name,
54+
raise-missing-from,
55+
logging-too-few-args,
56+
redefined-builtin,
57+
too-many-arguments,
58+
import-outside-toplevel,
59+
redefined-argument-from-local,
60+
logging-too-many-args,
61+
too-many-instance-attributes,
62+
unreachable,
63+
no-name-in-module,
64+
no-member,
65+
consider-using-ternary,
66+
too-many-lines,
67+
arguments-differ,
68+
too-many-public-methods,
69+
unused-variable,
70+
consider-using-dict-items,
71+
consider-using-in,
72+
reimported,
73+
too-many-boolean-expressions,
74+
cyclic-import,
75+
not-callable, # (paddle_utils.py) verifier.verify cannot be called (although it can)
76+
abstract-method, # (models.py)
77+
78+
[BASIC]
79+
80+
# Naming style matching correct argument names.
81+
argument-naming-style=snake_case
82+
83+
# Regular expression matching correct argument names. Overrides argument-
84+
# naming-style. If left empty, argument names will be checked with the set
85+
# naming style.
86+
#argument-rgx=
87+
88+
# Naming style matching correct attribute names.
89+
attr-naming-style=snake_case
90+
91+
# Regular expression matching correct attribute names. Overrides attr-naming-
92+
# style. If left empty, attribute names will be checked with the set naming
93+
# style.
94+
#attr-rgx=
95+
96+
# Bad variable names which should always be refused, separated by a comma.
97+
bad-names=foo,
98+
bar,
99+
baz,
100+
toto,
101+
tutu,
102+
tata
103+
104+
# Bad variable names regexes, separated by a comma. If names match any regex,
105+
# they will always be refused
106+
bad-names-rgxs=
107+
108+
# Naming style matching correct class attribute names.
109+
class-attribute-naming-style=any
110+
111+
# Regular expression matching correct class attribute names. Overrides class-
112+
# attribute-naming-style. If left empty, class attribute names will be checked
113+
# with the set naming style.
114+
#class-attribute-rgx=
115+
116+
# Naming style matching correct class constant names.
117+
class-const-naming-style=UPPER_CASE
118+
119+
# Regular expression matching correct class constant names. Overrides class-
120+
# const-naming-style. If left empty, class constant names will be checked with
121+
# the set naming style.
122+
#class-const-rgx=
123+
124+
# Naming style matching correct class names.
125+
class-naming-style=PascalCase
126+
127+
# Regular expression matching correct class names. Overrides class-naming-
128+
# style. If left empty, class names will be checked with the set naming style.
129+
#class-rgx=
130+
131+
# Naming style matching correct constant names.
132+
const-naming-style=UPPER_CASE
133+
134+
# Regular expression matching correct constant names. Overrides const-naming-
135+
# style. If left empty, constant names will be checked with the set naming
136+
# style.
137+
#const-rgx=
138+
139+
# Minimum line length for functions/classes that require docstrings, shorter
140+
# ones are exempt.
141+
docstring-min-length=-1
142+
143+
# Naming style matching correct function names.
144+
function-naming-style=snake_case
145+
146+
# Regular expression matching correct function names. Overrides function-
147+
# naming-style. If left empty, function names will be checked with the set
148+
# naming style.
149+
#function-rgx=
150+
151+
# Good variable names which should always be accepted, separated by a comma.
152+
good-names=i,
153+
j,
154+
k,
155+
ex,
156+
Run,
157+
_
158+
159+
# Good variable names regexes, separated by a comma. If names match any regex,
160+
# they will always be accepted
161+
good-names-rgxs=
162+
163+
# Include a hint for the correct naming format with invalid-name.
164+
include-naming-hint=no
165+
166+
# Naming style matching correct inline iteration names.
167+
inlinevar-naming-style=any
168+
169+
# Regular expression matching correct inline iteration names. Overrides
170+
# inlinevar-naming-style. If left empty, inline iteration names will be checked
171+
# with the set naming style.
172+
#inlinevar-rgx=
173+
174+
# Naming style matching correct method names.
175+
method-naming-style=snake_case
176+
177+
# Regular expression matching correct method names. Overrides method-naming-
178+
# style. If left empty, method names will be checked with the set naming style.
179+
#method-rgx=
180+
181+
# Naming style matching correct module names.
182+
module-naming-style=snake_case
183+
184+
# Regular expression matching correct module names. Overrides module-naming-
185+
# style. If left empty, module names will be checked with the set naming style.
186+
#module-rgx=
187+
188+
# Colon-delimited sets of names that determine each other's naming style when
189+
# the name regexes allow several styles.
190+
name-group=
191+
192+
# Regular expression which should only match function or class names that do
193+
# not require a docstring.
194+
no-docstring-rgx=^_
195+
196+
# List of decorators that produce properties, such as abc.abstractproperty. Add
197+
# to this list to register other decorators that produce valid properties.
198+
# These decorators are taken in consideration only for invalid-name.
199+
property-classes=abc.abstractproperty
200+
201+
# Regular expression matching correct type variable names. If left empty, type
202+
# variable names will be checked with the set naming style.
203+
#typevar-rgx=
204+
205+
# Naming style matching correct variable names.
206+
variable-naming-style=snake_case
207+
208+
# Regular expression matching correct variable names. Overrides variable-
209+
# naming-style. If left empty, variable names will be checked with the set
210+
# naming style.
211+
#variable-rgx=
212+
213+
214+
[STRING]
215+
216+
# This flag controls whether inconsistent-quotes generates a warning when the
217+
# character used as a quote delimiter is used inconsistently within a module.
218+
check-quote-consistency=no
219+
220+
# This flag controls whether the implicit-str-concat should generate a warning
221+
# on implicit string concatenation in sequences defined over several lines.
222+
check-str-concat-over-line-jumps=no
223+
224+
225+
[FORMAT]
226+
max-line-length=88
227+
single-line-if-stmt=yes

CHANGELOG

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -117,7 +117,7 @@ Add SUPPORT_NAME param to set a support email name.
117117

118118
## [1.0.1] - 2020-01-28
119119

120-
Simplify config file.
120+
Simplify config file.
121121

122122
## [1.0.0] - 2020-01-22
123123

CONTRIBUTING.md

Lines changed: 19 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -1,9 +1,9 @@
11
Thanks for taking the time to contribute! 🎉👍
22

3-
Before working on a new feature, please get in touch with us at dev[at]simplelogin.io to avoid duplication.
4-
We can also discuss the best way to implement it.
3+
Before working on a new feature, please get in touch with us at dev[at]simplelogin.io to avoid duplication.
4+
We can also discuss the best way to implement it.
55

6-
The project uses Flask, Python3.7+ and requires Postgres 12+ as dependency.
6+
The project uses Flask, Python3.7+ and requires Postgres 12+ as dependency.
77

88
## General Architecture
99

@@ -43,13 +43,23 @@ You also need to install `gpg` tool, on Mac it can be done with:
4343
brew install gnupg
4444
```
4545

46-
If you see the `pyre2` package in the error message, you might need to install its dependencies with `brew`.
46+
If you see the `pyre2` package in the error message, you might need to install its dependencies with `brew`.
4747
More info on https://github.com/andreasvc/pyre2
4848

4949
```bash
5050
brew install -s re2 pybind11
5151
```
5252

53+
## Linting and static analysis
54+
55+
We use pre-commit to run all our linting and static analysis checks. Please run
56+
57+
```bash
58+
poetry run pre-commit install
59+
```
60+
61+
To install it in your development environment.
62+
5363
## Run tests
5464

5565
```bash
@@ -145,7 +155,11 @@ The code is also checked with `flake8`, make sure to run `flake8` before creatin
145155
poetry run flake8
146156
```
147157

148-
Nice to have: as we haven't found a good enough HTML code formatter, please reformat any HTML code with PyCharm.
158+
For HTML templates, we use `djlint`. Before creating a pull request, please run
159+
160+
```bash
161+
poetry run djlint --check templates
162+
```
149163

150164
## Test sending email
151165

0 commit comments

Comments
 (0)