Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Add formatters and apply rules; code refactoring #907

Merged
merged 47 commits into from
Mar 9, 2025

Conversation

pat-s
Copy link
Contributor

@pat-s pat-s commented Mar 5, 2025

@vitabaks Lots of changes but in the end they will result in a consistent formatting for all files.

Due to the amount of changes I went for a dedicated PR. Sometimes changes to quotes might result in changed behaviour. Not sure if the tests cover everything here, let's see how it goes.

You could optionally add some CI checks to enforce these linters in PRs.

Config files

  • .prettierrc.json
  • .editorconfig
  • .sql-formatter.json

Commands

  • prettier -w .
  • editorconfig-checker .

Makefile

make help

## —— Formatting ——————————————————————————————————————————————————————————————————————————-------  
prettier                       Run Prettier formatting 
prettier-check                 Check formatting with Prettier (without modifying files) 
sql-format                     Format all SQL files using sql-formatter 
pg-format                      Format all SQL files using pgFormatter (PostgreSQL SQL queries and PL/PGSQL code beautifier) 

pat-s added 2 commits March 5, 2025 11:07

Verified

This commit was signed with the committer’s verified signature.
pat-s Patrick Schratz

Verified

This commit was created on GitHub.com and signed with GitHub’s verified signature.
@vitabaks
Copy link
Owner

vitabaks commented Mar 5, 2025

Indeed the change is quite big.

Should we stick to these parameters for the entire project or just for the automation component (ansible)? I'm concerned that this might break the Console UI/API, which I didn't develop myself—it's custom-built by a third-party company. If something breaks, I'll have to cover the cost of refactoring. 🙂

@vitabaks
Copy link
Owner

vitabaks commented Mar 5, 2025

@pat-s Please pay attention to linter errors

@pat-s
Copy link
Contributor Author

pat-s commented Mar 5, 2025

Should we stick to these parameters for the entire project or just for the automation component (ansible)?

Can also do that, I personally care most/only for this part 😄️

Will clean up linters and only apply changes to automation/ then.

pat-s added 6 commits March 5, 2025 17:10

Verified

This commit was signed with the committer’s verified signature.
pat-s Patrick Schratz

Verified

This commit was signed with the committer’s verified signature.
pat-s Patrick Schratz

Verified

This commit was signed with the committer’s verified signature.
pat-s Patrick Schratz

Verified

This commit was signed with the committer’s verified signature.
pat-s Patrick Schratz

Verified

This commit was signed with the committer’s verified signature.
pat-s Patrick Schratz

Verified

This commit was signed with the committer’s verified signature.
pat-s Patrick Schratz
@pat-s
Copy link
Contributor Author

pat-s commented Mar 5, 2025

  • Reverted console/ changes
  • Adjusted linter configs to work with prettier
  • Fixed various ansible-lint reports
  • Updated requirements.yml
  • Avoid using reserved keyword query as var name

pat-s added 4 commits March 5, 2025 19:06

Verified

This commit was signed with the committer’s verified signature.
pat-s Patrick Schratz

Verified

This commit was signed with the committer’s verified signature.
pat-s Patrick Schratz

Verified

This commit was signed with the committer’s verified signature.
pat-s Patrick Schratz

Verified

This commit was signed with the committer’s verified signature.
pat-s Patrick Schratz

Verified

This commit was created on GitHub.com and signed with GitHub’s verified signature.

Verified

This commit was created on GitHub.com and signed with GitHub’s verified signature.
Co-authored-by: Vitaliy Kukharik <[email protected]>

Verified

This commit was created on GitHub.com and signed with GitHub’s verified signature.
Co-authored-by: Vitaliy Kukharik <[email protected]>
vitabaks added 5 commits March 7, 2025 14:10

Verified

This commit was created on GitHub.com and signed with GitHub’s verified signature.
for compatibility with ubuntu 24.04

Verified

This commit was created on GitHub.com and signed with GitHub’s verified signature.

Verified

This commit was created on GitHub.com and signed with GitHub’s verified signature.
Set a variable for the python version

Verified

This commit was created on GitHub.com and signed with GitHub’s verified signature.
Add --break-system-packages

Verified

This commit was created on GitHub.com and signed with GitHub’s verified signature.
@vitabaks
Copy link
Owner

vitabaks commented Mar 7, 2025

@pat-s I changed the Python version from 3.13 to 3.12 for compatibility with Ubuntu 24.04, which I use in Gitpod and which is also the default distribution when deploying to cloud providers.

@vitabaks
Copy link
Owner

vitabaks commented Mar 7, 2025

Usually both is good to have/needed to enforce them, yes.

ded08a4 and 3b2ab9e

vitabaks and others added 5 commits March 7, 2025 21:08

Verified

This commit was created on GitHub.com and signed with GitHub’s verified signature.
@vitabaks vitabaks merged commit 0a35bd9 into vitabaks:master Mar 9, 2025
15 checks passed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

None yet

2 participants