Skip to content

Commit 96bfea0

Browse files
committed
Revert "🔧 Add code validation standard config (#302)"
This reverts commit 8f752a0.
1 parent d18420b commit 96bfea0

File tree

11 files changed

+10
-68
lines changed

11 files changed

+10
-68
lines changed

‎.coverage.conf

Lines changed: 0 additions & 2 deletions
This file was deleted.

‎.flake8

Lines changed: 0 additions & 6 deletions
This file was deleted.

‎.isort.cfg

Lines changed: 0 additions & 4 deletions
This file was deleted.

‎.mypy.ini

Lines changed: 0 additions & 4 deletions
This file was deleted.

‎Dockerfile

Lines changed: 0 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -24,9 +24,6 @@ RUN echo "#!/bin/bash\n/python/entrypoint.sh startapp" >> /bin/startapp && chmod
2424
echo "#!/bin/bash\n/python/entrypoint.sh runtests" >> /bin/runtests && chmod a+x /bin/runtests &&\
2525
pip install -r /python/requirements.txt
2626

27-
# Copy standard configurations for code validation
28-
COPY pytest.ini .flake8 .isort.cfg .mypy.ini .coverage.conf /home/python/
29-
3027
# Change users
3128
USER python
3229

‎README.md

Lines changed: 0 additions & 19 deletions
Original file line numberDiff line numberDiff line change
@@ -44,8 +44,6 @@ such as the `entrypoint.sh`. Then the subfolders organize the app files:
4444
* `/python/static` holds the static files served by the app such as static html files
4545
* `/python/logs` is meant for the log files generated by the app
4646
* `/python/files` is for files uploaded through the app
47-
* `/home/python` contains the [standard configuration files](Standard-configurations-for-code-quality)
48-
for linting, formatting and other testing tools
4947

5048
## :toolbox: Notes for maintenance
5149

@@ -129,9 +127,6 @@ plugin.
129127

130128
This code validation command executes the `/python/test_suite.sh` script which can
131129
be overwritten with custom code validation.
132-
These code quality tools will follow the
133-
[standard configurations](Standard-configurations-for-code-quality) present in `/home/python`
134-
by default.
135130

136131
### `validatecodeonce`
137132

@@ -150,17 +145,3 @@ and code coverage results in the `/python/app/unittesting.xml` and
150145

151146
A [coverage configuration file](https://pytest-cov.readthedocs.io/en/latest/config.html)
152147
can be provided at `python/app/coverage.conf`.
153-
154-
## Standard configurations for code quality
155-
156-
Standard configuration files for all the code quality tools are located in `/home/python`
157-
where the tools will find them.
158-
These configurations can be overwritten:
159-
160-
* `mypy`: Add the configuration file `/python/app/.mypy.ini` and the standard file in
161-
`/home/python` will be ignored.
162-
* `flake8`: Add the configuration file `/python/app/.flake8` it will be *appended* to
163-
the standard file in `/home/python`. Therefore to turn off all the configurations
164-
in the standard file you must explicitely reverse them in the `/python/app/.flake8` file.
165-
* `isort`: Add the configuration `/python/app/.isort.cfg` and the standard file in
166-
`/home/python` will be ignored.

‎pytest.ini

Whitespace-only changes.

‎test_suite.sh

Lines changed: 8 additions & 10 deletions
Original file line numberDiff line numberDiff line change
@@ -27,28 +27,26 @@ reportvalidation() {
2727
if [[ $1 == "reports" ]]
2828
then
2929
MYPY_REPORTS="--junit-xml ${REPORTS_FOLDER}typing.xml"
30-
PYTEST_REPORTS="--junitxml ${REPORTS_FOLDER}unittesting.xml --cov-report xml:${REPORTS_FOLDER}coverage.xml"
31-
fi
32-
33-
COVERAGE_CONF="--cov-config /home/python/.coverage.conf"
34-
if [ -f ./coverage.conf ];
35-
then
36-
COVERAGE_CONF="--cov-config ./coverage.conf"
30+
if [ -f ./coverage.conf ];
31+
then
32+
$covconf="--cov-config ./coverage.conf"
33+
fi
34+
PYTEST_REPORTS="--junitxml ${REPORTS_FOLDER}unittesting.xml $covconf --cov-report xml:${REPORTS_FOLDER}coverage.xml"
3735
fi
3836

3937
echo -ne "$SECTION_PREFIX RUN TESTS:\n\n"
40-
python -m pytest --rootdir=/python/app -vv --durations=3 --cov ./ --cov-report term-missing $COVERAGE_CONF $PYTEST_REPORTS; STATUS1=$?
38+
python -m pytest -vv --durations=3 --cov ./ --cov-report term-missing $PYTEST_REPORTS; STATUS1=$?
4139

4240
echo -ne "$SECTION_PREFIX CHECK DOCKER USER IS PYTHON: "
4341
USEROUT=`checkuser`
4442
reportvalidation "$USEROUT"; STATUS2=$?
4543

4644
echo -ne "$SECTION_PREFIX CHECK TYPING: "
47-
MYPYOUT=`mypy --cache-dir /home/python --no-error-summary . $MYPY_REPORTS`
45+
MYPYOUT=`mypy --no-error-summary . $MYPY_REPORTS`
4846
reportvalidation "$MYPYOUT"; STATUS3=$?
4947

5048
echo -ne "$SECTION_PREFIX CHECK LINTING: "
51-
FLAKE8OUT=`flake8 --append-config /home/python/.flake8 --append-config /python/app/.flake8`
49+
FLAKE8OUT=`flake8`
5250
reportvalidation "$FLAKE8OUT"; STATUS4=$?
5351

5452
echo -ne "$SECTION_PREFIX CHECK FORMATTING: "

‎tests/.flake8

Lines changed: 0 additions & 3 deletions
This file was deleted.

‎tests/webapp/main.py

Lines changed: 0 additions & 12 deletions
Original file line numberDiff line numberDiff line change
@@ -1,8 +1,3 @@
1-
# FLAKE8: This would trigger an F401 error without the local .flake8
2-
from math import tan
3-
4-
# MYPY: This import triggers a missing import error without the standard config
5-
# file
61
from fastapi import FastAPI
72

83
app = FastAPI()
@@ -11,10 +6,3 @@
116
@app.get('/')
127
async def root():
138
return {'message': 'Hello World'}
14-
15-
16-
def dummy_func():
17-
# FLAKE8: The following two lines would trigger an E501 flake8 error
18-
# without the standard config in /home/python
19-
this_is_a_very_long_variable_name_used_to_test_the_flake8_standard_config = 'ok'
20-
return this_is_a_very_long_variable_name_used_to_test_the_flake8_standard_config

0 commit comments

Comments
 (0)