-
Notifications
You must be signed in to change notification settings - Fork 14
136 lines (129 loc) · 7.94 KB
/
codequality.yml
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
# This workflow will install Python dependencies, run tests and lint with a single version of Python
# For more information see: https://help.github.com/actions/language-and-framework-guides/using-python-with-github-actions
name: code_quality
on:
push:
pull_request:
branches: [ main ]
jobs:
build:
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v4
- name: Set up Python 3.11
uses: actions/setup-python@v3
with:
python-version: "3.11"
- name: Install dependencies
run: |
python -m pip install --upgrade pip
pip install prospector[with_everything]
pip install prospector[with-everything]
pip install prospector[with_bandit]
pip install prospector[with_mypy]
pip install prospector[with_pyroma]
pip install prospector[with_vulture]
if [ -f requirements.txt ]; then pip install -r requirements.txt; fi
pip install -e .
- name: Lint with prospector
working-directory: ./
run: |
prospector setup.py
prospector system_setups/
prospector tests/
prospector hisim/
prospector docs/
# # pylint hisim/simulator.py --rcfile=hisim_pylint_config.rc
# # flake8 hisim/simulator.py --max-line-length 150
# # pycodestyle hisim/simulator.py --max-line-length 150
## This workflow will install Python dependencies, run tests and lint with a single version of Python
## For more information see: https://help.github.com/actions/language-and-framework-guides/using-python-with-github-actions
#
#name: eradicate_flake8
#
#on:
# push:
# branches: [ main ]
# pull_request:
# branches: [ main ]
#
#jobs:
# build:
# runs-on: ubuntu-latest
#
# steps:
# - uses: actions/checkout@v3
# - name: Set up Python 3.10
# uses: actions/setup-python@v3
# with:
# python-version: "3.10"
# - name: Install dependencies
# run: |
# python -m pip install --upgrade pip
# pip install flake8-eradicate
# if [ -f requirements.txt ]; then pip install -r requirements.txt; fi
# pip install -e .
# - name: Lint with flake8
# working-directory: ./
# run: |
# flake8 . --count --select=E9,F63,F7,F82,E800 --show-source --statistics
# - name: Lint with flake8
# working-directory: ./
# run: |
# flake8 system_setups/basic_household.py --count --select=E9,F63,F7,F82,E800 --show-source --statistics
# flake8 system_setups/basic_household_only_heating.py --count --select=E9,F63,F7,F82,E800 --show-source --statistics
# flake8 system_setups/default_connections.py --count --select=E9,F63,F7,F82,E800 --show-source --statistics
# flake8 system_setups/dynamic_components.py --count --select=E9,F63,F7,F82,E800 --show-source --statistics
# flake8 system_setups/simple_examples.py --count --select=E9,F63,F7,F82,E800 --show-source --statistics
# flake8 hisim/component.py --count --select=E9,F63,F7,F82,E800 --show-source --statistics
# flake8 hisim/component_wrapper.py --count --select=E9,F63,F7,F82,E800 --show-source --statistics
# flake8 hisim/dynamic_component.py --count --select=E9,F63,F7,F82,E800 --show-source --statistics
# flake8 hisim/hisim_main.py --count --select=E9,F63,F7,F82,E800 --show-source --statistics
# flake8 hisim/hisim_with_profiler.py --count --select=E9,F63,F7,F82,E800 --show-source --statistics
# flake8 hisim/json_executor.py --count --select=E9,F63,F7,F82,E800 --show-source --statistics
# flake8 hisim/json_generator.py --count --select=E9,F63,F7,F82,E800 --show-source --statistics
# flake8 hisim/loadtypes.py --count --select=E9,F63,F7,F82,E800 --show-source --statistics
# flake8 hisim/log.py --count --select=E9,F63,F7,F82,E800 --show-source --statistics
# flake8 hisim/postprocessingoptions.py --count --select=E9,F63,F7,F82,E800 --show-source --statistics
# flake8 hisim/project_code_overview_generator.py --count --select=E9,F63,F7,F82,E800 --show-source --statistics
# flake8 hisim/simulationparameters.py --count --select=E9,F63,F7,F82,E800 --show-source --statistics
# flake8 hisim/simulator.py --count --select=E9,F63,F7,F82,E800 --show-source --statistics
# flake8 hisim/sim_repository.py --count --select=E9,F63,F7,F82,E800 --show-source --statistics
# flake8 hisim/utils.py --count --select=E9,F63,F7,F82,E800 --show-source --statistics
# flake8 hisim/components/building.py --count --select=E9,F63,F7,F82,E800 --show-source --statistics
# flake8 hisim/components/controller_l1_building_heating.py --count --select=E9,F63,F7,F82,E800 --show-source --statistics
# flake8 hisim/components/controller_l1_generic_runtime.py --count --select=E9,F63,F7,F82,E800 --show-source --statistics
# flake8 hisim/components/controller_l1_heatpump.py --count --select=E9,F63,F7,F82,E800 --show-source --statistics
# flake8 hisim/components/controller_l2_generic_heat_simple.py --count --select=E9,F63,F7,F82,E800 --show-source --statistics
# flake8 hisim/components/example_component.py --count --select=E9,F63,F7,F82,E800 --show-source --statistics
# flake8 hisim/components/example_storage.py --count --select=E9,F63,F7,F82,E800 --show-source --statistics
# flake8 hisim/components/example_template.py --count --select=E9,F63,F7,F82,E800 --show-source --statistics
# flake8 hisim/components/example_transformer.py --count --select=E9,F63,F7,F82,E800 --show-source --statistics
# flake8 hisim/components/generic_hot_water_storage_modular.py --count --select=E9,F63,F7,F82,E800 --show-source --statistics
# flake8 hisim/modular_household/interface_configs/system_config.py --count --select=E9,F63,F7,F82,E800 --show-source --statistics
# flake8 hisim/postprocessing/chartbase.py --count --select=E9,F63,F7,F82,E800 --show-source --statistics
# flake8 hisim/postprocessing/charts.py --count --select=E9,F63,F7,F82,E800 --show-source --statistics
# flake8 hisim/postprocessing/chart_singleday.py --count --select=E9,F63,F7,F82,E800 --show-source --statistics
# flake8 hisim/postprocessing/postprocessing_datatransfer.py --count --select=E9,F63,F7,F82,E800 --show-source --statistics
# flake8 hisim/postprocessing/postprocessing_main.py --count --select=E9,F63,F7,F82,E800 --show-source --statistics
# flake8 hisim/postprocessing/reportgenerator.py --count --select=E9,F63,F7,F82,E800 --show-source --statistics
# flake8 hisim/postprocessing/system_chart.py --count --select=E9,F63,F7,F82,E800 --show-source --statistics
# flake8 tests/functions_for_testing.py --count --select=E9,F63,F7,F82,E800 --show-source --statistics
# flake8 tests/test_advanced_battery_bslib.py --count --select=E9,F63,F7,F82,E800 --show-source --statistics
# flake8 tests/test_basic_household_with_all_resultfiles.py --count --select=E9,F63,F7,F82,E800 --show-source --statistics
# flake8 tests/test_building.py --count --select=E9,F63,F7,F82,E800 --show-source --statistics
# flake8 tests/test_examples.py --count --select=E9,F63,F7,F82,E800 --show-source --statistics
# flake8 tests/test_example_component.py --count --select=E9,F63,F7,F82,E800 --show-source --statistics
# flake8 tests/test_example_storage.py --count --select=E9,F63,F7,F82,E800 --show-source --statistics
# flake8 tests/test_example_template.py --count --select=E9,F63,F7,F82,E800 --show-source --statistics
# flake8 tests/test_example_transformer.py --count --select=E9,F63,F7,F82,E800 --show-source --statistics
#
#
#
#
## reenable once all source files are fixed and no more commented out code is spread all over
## flake8 . --count --select=E9,F63,F7,F82,E800 --show-source --statistics
# # # stop the build if there are Python syntax errors or undefined names
#
# # # exit-zero treats all errors as warnings. The GitHub editor is 127 chars wide
# # flake8 . --count --exit-zero --max-complexity=10 --max-line-length=127 --statistics