feat: add universal formatting configuration (black, prettier, editorconfig)

This commit is contained in:
2026-06-24 06:36:35 -05:00
parent f6efc209d7
commit ef9a3cee2e
5 changed files with 88 additions and 0 deletions

30
.editorconfig Normal file
View File

@@ -0,0 +1,30 @@
# EditorConfig helps maintain consistent coding styles across all files
# https://editorconfig.org
root = true
# Unix-style newlines, UTF-8 encoding for all files
[*]
end_of_line = lf
charset = utf-8
insert_final_newline = true
trim_trailing_whitespace = true
# Python: 4 spaces (PEP 8)
[*.py]
indent_style = space
indent_size = 4
# JavaScript/JSON/YAML: 2 spaces (common web standard)
[*.{js,json,yml,yaml}]
indent_style = space
indent_size = 2
# HTML/CSS: 2 spaces
[*.{html,css}]
indent_style = space
indent_size = 2
# Markdown: preserve formatting
[*.md]
trim_trailing_whitespace = false

2
.gitignore vendored
View File

@@ -8,6 +8,8 @@ releases/*/kx-bridge
releases/*/extract_credentials
releases/*/extract_credentials.exe
node_modules/*
!kx-bridge.spec
# Laufzeit-Daten und Drucker-Credentials — nie committen

31
package-lock.json generated Normal file
View File

@@ -0,0 +1,31 @@
{
"name": "kx-bridge",
"version": "0.9.27",
"lockfileVersion": 3,
"requires": true,
"packages": {
"": {
"name": "kx-bridge",
"version": "0.9.27",
"devDependencies": {
"prettier": "^3.0.0"
}
},
"node_modules/prettier": {
"version": "3.8.4",
"resolved": "https://registry.npmjs.org/prettier/-/prettier-3.8.4.tgz",
"integrity": "sha512-N2MylSdi48+5N/6S5j+maeHbUSIzzZ5uOcX5Hm4QpV8Dkb1HFjfAKTKX6yNPJQD9AhcT3ifHNB66tWTTJDi11Q==",
"dev": true,
"license": "MIT",
"bin": {
"prettier": "bin/prettier.cjs"
},
"engines": {
"node": ">=14"
},
"funding": {
"url": "https://github.com/prettier/prettier?sponsor=1"
}
}
}
}

23
package.json Normal file
View File

@@ -0,0 +1,23 @@
{
"name": "kx-bridge",
"version": "0.9.27",
"description": "Moonraker-compatible bridge for Anycubic Kobra X",
"type": "module",
"devDependencies": {
"prettier": "^3.0.0"
},
"scripts": {
"format:js": "prettier --write 'web/**/*.js' '*.js'",
"format:json": "prettier --write '*.json' 'web/**/*.json'",
"format:web": "prettier --write 'web/**/*.{js,json,html,css,yml,yaml,md}'",
"format": "npm run format:web"
},
"prettier": {
"semi": true,
"singleQuote": false,
"trailingComma": "es5",
"printWidth": 100,
"tabWidth": 2,
"useTabs": false
}
}

2
requirements-dev.txt Normal file
View File

@@ -0,0 +1,2 @@
# Code formatting
black>=24.1.0