-
-
Notifications
You must be signed in to change notification settings - Fork 460
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
Conversation
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. 🙂 |
@pat-s Please pay attention to linter errors |
Can also do that, I personally care most/only for this part 😄️ Will clean up linters and only apply changes to |
|
RedHat 7 is not supported
Co-authored-by: Vitaliy Kukharik <[email protected]>
Co-authored-by: Vitaliy Kukharik <[email protected]>
for compatibility with ubuntu 24.04
Set a variable for the python version
Add --break-system-packages
@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)