Improved editorconfig setup

This commit is contained in:
Eric Froemling 2021-01-05 15:21:25 -08:00
parent 114a62142c
commit 679bc643a7
7 changed files with 62 additions and 9 deletions

37
.editorconfig Normal file
View File

@ -0,0 +1,37 @@
# THIS FILE WAS AUTOGENERATED; DO NOT EDIT.
# Source: config/toolconfigsrc/editorconfig.
# Common config file for supported editors; see editorconfig.org.
# If you are using an editor that doesn't support editorconfig, try to
# conform to these settings manually.
# Note: while we autogenerate this file, we also check it into git
# because it affects how source is displayed on github.
# This is the top-most EditorConfig file.
root = true
# Defaults for all files.
[*]
end_of_line = lf
trim_trailing_whitespace = true
insert_final_newline = true
# Python overrides.
[*.py]
indent_style = space
indent_size = 4
max_line_length = 79
charset = utf-8
# Makefile overrides.
[Makefile]
indent_style = tab
indent_size = 2
max_line_length = 80
# C/C++ overrides.
[*.{c,cc,h,cpp,hpp}]
indent_style = space
indent_size = 2
max_line_length = 80

1
.gitignore vendored
View File

@ -23,7 +23,6 @@ local.properties
.flycheck-dir-locals.el
.pylintrc
.projectile
.editorconfig
.clang-format
.style.yapf
.irony

View File

@ -62,6 +62,7 @@
<excludePattern pattern=".asset_manifest_*.json" />
<excludePattern pattern=".efrocachemap" />
<excludePattern pattern=".pytest_cache" />
<excludePattern pattern=".editorconfig" />
</content>
<orderEntry type="inheritedJdk" />
<orderEntry type="sourceFolder" forTests="false" />

View File

@ -1,22 +1,35 @@
# For configuring supported editors
# Common config file for supported editors; see editorconfig.org.
# If you are using an editor that doesn't support editorconfig, try to
# conform to these settings manually.
# This is the top-most EditorConfig file
# Note: while we autogenerate this file, we also check it into git
# because it affects how source is displayed on github.
# This is the top-most EditorConfig file.
root = true
# Defaults for all files
# Defaults for all files.
[*]
end_of_line = lf
trim_trailing_whitespace = true
insert_final_newline = true
# Python overrides
# Python overrides.
[*.py]
indent_style = space
indent_size = 4
max_line_length = 79
charset = utf-8
# Makefile overrides
# Makefile overrides.
[Makefile]
indent_style = tab
indent_size = 2
max_line_length = 80
# C/C++ overrides.
[*.{c,cc,h,cpp,hpp}]
indent_style = space
indent_size = 2
max_line_length = 80

View File

@ -1,5 +1,5 @@
<!-- THIS FILE IS AUTO GENERATED; DO NOT EDIT BY HAND -->
<h4><em>last updated on 2020-12-22 for Ballistica version 1.5.30 build 20264</em></h4>
<h4><em>last updated on 2021-01-04 for Ballistica version 1.5.30 build 20265</em></h4>
<p>This page documents the Python classes and functions in the 'ba' module,
which are the ones most relevant to modding in Ballistica. If you come across something you feel should be included here or could be better explained, please <a href="mailto:support@froemling.net">let me know</a>. Happy modding!</p>
<hr>

View File

@ -1,3 +1,3 @@
# Released under the MIT License. See LICENSE for details.
#
"""Bits of functionality common to ballistica client and server components."""
"""Functionality and data common to ballistica client and server components."""

View File

@ -116,6 +116,7 @@ def _trim_docstring(docstring: str) -> str:
def _spelling(words: List[str]) -> None:
import os
num_modded_dictionaries = 0
for fname in [
'.idea/dictionaries/ericf.xml',
'ballisticacore-cmake/.idea/dictionaries/ericf.xml'
@ -145,6 +146,8 @@ def _spelling(words: List[str]) -> None:
sorted(lines[3:-3], key=lambda x: x.replace('</w>', '')) +
lines[-3:]))
print(f'Added {added_count} words to {fname}.')
num_modded_dictionaries += 1
print(f'Modified {num_modded_dictionaries} dictionaries.')
def spelling_all() -> None:
@ -347,7 +350,7 @@ def tool_config_install() -> None:
comment = ';;'
elif dst.name in [
'.mypy.ini', '.pycheckers', '.pylintrc', '.style.yapf',
'.clang-format'
'.clang-format', '.editorconfig'
]:
comment = '#'
if comment is not None: