From 353f5e5623bc6880ec6486d30625b818ae85a3da Mon Sep 17 00:00:00 2001 From: drfho Date: Fri, 15 Sep 2023 19:12:40 +0200 Subject: [PATCH] Using Zope's .editorconfig (#180) * add Zope's .editorconfig * ace editor: prefer spaces over tabs --- .editorconfig | 39 +++++++++++++++++++ .vscode/settings.json | 2 +- .../zms/plugins/www/common/zmi_ace_editor.js | 2 +- 3 files changed, 41 insertions(+), 2 deletions(-) create mode 100644 .editorconfig diff --git a/.editorconfig b/.editorconfig new file mode 100644 index 000000000..9977bd94d --- /dev/null +++ b/.editorconfig @@ -0,0 +1,39 @@ +# Generated from: +# https://github.com/zopefoundation/meta/tree/master/config/zope-product +# +# EditorConfig Configuration file, for more details see: +# http://EditorConfig.org +# EditorConfig is a convention description, that could be interpreted +# by multiple editors to enforce common coding conventions for specific +# file types + +# top-most EditorConfig file: +# Will ignore other EditorConfig files in Home directory or upper tree level. +root = true + + +[*] # For All Files +# Unix-style newlines with a newline ending every file +end_of_line = lf +insert_final_newline = true +trim_trailing_whitespace = true +# Set default charset +charset = utf-8 +# Indent style default +indent_style = space +# Max Line Length - a hard line wrap, should be disabled +max_line_length = off + +[*.{py,cfg,ini}] +# 4 space indentation +indent_size = 4 + +[*.{yml,zpt,pt,dtml,zcml}] +# 2 space indentation +indent_size = 4 + +[{Makefile,.gitmodules}] +# Tab indentation (no size specified, but view as 4 spaces) +indent_style = tab +indent_size = unset +tab_width = unset diff --git a/.vscode/settings.json b/.vscode/settings.json index c5c39b107..cd42ee761 100644 --- a/.vscode/settings.json +++ b/.vscode/settings.json @@ -2,7 +2,7 @@ "python.defaultInterpreterPath": "~/vpy38/bin/python3", "python.linting.enabled": false, "[python]": { - "editor.defaultFormatter": "ms-python.autopep8" + "editor.defaultFormatter": "ms-python.python" }, "python.formatting.provider": "none", diff --git a/Products/zms/plugins/www/common/zmi_ace_editor.js b/Products/zms/plugins/www/common/zmi_ace_editor.js index 78b62a60c..8b8abc6f2 100644 --- a/Products/zms/plugins/www/common/zmi_ace_editor.js +++ b/Products/zms/plugins/www/common/zmi_ace_editor.js @@ -102,7 +102,7 @@ function show_ace_editor(e, toggle=false) { editor.setTheme('ace/theme/eclipse'); editor.getSession().setMode('ace/mode/'+mode); editor.getSession().setValue(value); - editor.getSession().setOptions({ tabSize: 4, useSoftTabs: false }); + editor.getSession().setOptions({ tabSize: 4, useSoftTabs: true }); editor.getSession().on('change',function() { $textarea.val(editor.getSession().getValue()).change(); });