Skip to content

Commit

Permalink
Add linters for python, markdown (#177)
Browse files Browse the repository at this point in the history
* Add linters for

- python
- markdown

Reason: Improve code quality

* Feat/linter with external flavors and formatting fixes (#186)

* Read mand flavors from SCS-Spec.MandatoryFlavors.yaml.

This implements #235.

* Be consistent about using f-strings

* Doc strings, f strings, line-length.

* Extra braces, one more f-string.

* flavor-name-check.py passing flake8 except E226, E501

* flake8 also for flave-names-openstack.py.

Also fix error introduced in Prop parser (when we exhaust the list).

* Use flake8 settings of my liking.

* Fix flake8 complaints (not enough blank lines)

* Fix flake8 complaints and *some* pylint suggestions.

* Use f-strings for formatting to please pylint.

Well, it also pleases my own eyes :-)

* Resolve merge errors.

Signed-off-by: Tim Beermann <[email protected]>
Signed-off-by: Kurt Garloff <[email protected]>
Co-authored-by: Kurt Garloff <[email protected]>
  • Loading branch information
Tim Beermann and garloff authored Jan 27, 2023
1 parent 6421647 commit b2bf742
Show file tree
Hide file tree
Showing 7 changed files with 296 additions and 189 deletions.
3 changes: 3 additions & 0 deletions .flake8
Original file line number Diff line number Diff line change
@@ -0,0 +1,3 @@
[flake8]
ignore = E501, E251, E226, E221

18 changes: 18 additions & 0 deletions .github/workflows/lint-markdown.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,18 @@
---
name: Check markdown syntax

"on":
push:
paths:
- '**.md'
- .github/workflows/lint-markdown.yml

jobs:
lint-markdown-syntax:
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v3
- uses: reviewdog/action-markdownlint@v0
with:
github_token: ${{ secrets.GITHUB_TOKEN }}
reporter: github-pr-check
19 changes: 19 additions & 0 deletions .github/workflows/lint-python.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,19 @@
---
name: Check python syntax

"on":
push:
paths:
- '**.py'
- .github/workflows/lint-python.yml

jobs:
lint-python-syntax:
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v3
- uses: actions/setup-python@v4
with:
python-version: '3.x'
- run: pip3 install flake8
- run: flake8
2 changes: 2 additions & 0 deletions Design-Docs/k8s/update-k8s-list.py
Original file line number Diff line number Diff line change
Expand Up @@ -3,9 +3,11 @@

repos = Github().get_organization('SovereignCloudStack').get_repos()


def looks_like_k8s_repo(repo):
return repo.name.startswith('k8s-')


repos = filter(looks_like_k8s_repo, repos)

loader = jinja2.FileSystemLoader(searchpath="")
Expand Down
Loading

0 comments on commit b2bf742

Please sign in to comment.