Tidying and language updates

This commit is contained in:
Eric Froemling 2021-01-01 15:04:40 -08:00
parent 7025a537c2
commit a6130aaf5f
7 changed files with 187 additions and 28 deletions

View File

@ -30,8 +30,8 @@
<w>achname</w>
<w>achs</w>
<w>acinstance</w>
<w>ack'ed</w>
<w>ack</w>
<w>ack'ed</w>
<w>acked</w>
<w>acks</w>
<w>acnt</w>
@ -156,8 +156,8 @@
<w>bacommon</w>
<w>badguy</w>
<w>bafoundation</w>
<w>ballistica's</w>
<w>ballistica</w>
<w>ballistica's</w>
<w>ballisticacore</w>
<w>ballisticacorecb</w>
<w>bamaster</w>
@ -816,8 +816,8 @@
<w>gamedata</w>
<w>gameinstance</w>
<w>gamemap</w>
<w>gamepad's</w>
<w>gamepad</w>
<w>gamepad's</w>
<w>gamepadadvanced</w>
<w>gamepads</w>
<w>gamepadselect</w>
@ -1208,8 +1208,8 @@
<w>lsqlite</w>
<w>lssl</w>
<w>lstart</w>
<w>lstr's</w>
<w>lstr</w>
<w>lstr's</w>
<w>lstrs</w>
<w>lsval</w>
<w>ltex</w>
@ -1848,8 +1848,8 @@
<w>sessionname</w>
<w>sessionplayer</w>
<w>sessionplayers</w>
<w>sessionteam's</w>
<w>sessionteam</w>
<w>sessionteam's</w>
<w>sessionteams</w>
<w>sessiontype</w>
<w>setactivity</w>
@ -1998,6 +1998,7 @@
<w>subfolders</w>
<w>subname</w>
<w>subpath</w>
<w>subpaths</w>
<w>subplatform</w>
<w>subplatforms</w>
<w>subprocess's</w>
@ -2185,8 +2186,8 @@
<w>txtw</w>
<w>typeargs</w>
<w>typecheck</w>
<w>typechecker's</w>
<w>typechecker</w>
<w>typechecker's</w>
<w>typedval</w>
<w>typeshed</w>
<w>typestr</w>

139
Makefile
View File

@ -638,6 +638,75 @@ pycharm-full: prereqs
mypy-full pycharm pycharm-full
################################################################################
# #
# Checking (Internal) #
# #
################################################################################
# Run all project checks in the cloud.
check-cloud:
@tools/cloudshell ${CLOUDSHELL_HOST_CHECK} --env ${CLOUDSHELL_ENV_CHECK} -- \
make check
# Cloud version of check-full
check-cloud-full:
@tools/cloudshell ${CLOUDSHELL_HOST_CHECK} --env ${CLOUDSHELL_ENV_CHECK} -- \
make check-full
# Cloud version of check2
check2-cloud:
@tools/cloudshell ${CLOUDSHELL_HOST_CHECK} --env ${CLOUDSHELL_ENV_CHECK} \
--lock pycharm -- \
EFROTOOLS_FULL_PYCHARM_RECACHE=${EFROTOOLS_FULL_PYCHARM_RECACHE} \
make check2
# Cloud version of check2-full
check2-cloud-full:
@tools/cloudshell ${CLOUDSHELL_HOST_CHECK} --env ${CLOUDSHELL_ENV_CHECK} \
--lock pycharm -- \
EFROTOOLS_FULL_PYCHARM_RECACHE=${EFROTOOLS_FULL_PYCHARM_RECACHE} \
make check2-full
# Cloud version of pylint check
pylint-cloud:
@tools/cloudshell ${CLOUDSHELL_HOST_CHECK} --env ${CLOUDSHELL_ENV_CHECK} -- \
make pylint
# Cloud version of pylint-full
pylint-cloud-full:
@tools/cloudshell ${CLOUDSHELL_HOST_CHECK} --env ${CLOUDSHELL_ENV_CHECK} -- \
make pylint-full
# Cloud version of mypy check
mypy-cloud:
@tools/cloudshell ${CLOUDSHELL_HOST_CHECK} --env ${CLOUDSHELL_ENV_CHECK} -- \
make mypy
# Cloud version of mypy-full check
mypy-cloud-full:
@tools/cloudshell ${CLOUDSHELL_HOST_CHECK} --env ${CLOUDSHELL_ENV_CHECK} -- \
make mypy-full
# Cloud version of pycharm check
pycharm-cloud:
@tools/cloudshell ${CLOUDSHELL_HOST_CHECK} --env ${CLOUDSHELL_ENV_CHECK} \
--lock pycharm -- \
EFROTOOLS_FULL_PYCHARM_RECACHE=${EFROTOOLS_FULL_PYCHARM_RECACHE} \
make pycharm
# Cloud version of pycharm-full
pycharm-cloud-full:
@tools/cloudshell ${CLOUDSHELL_HOST_CHECK} --env ${CLOUDSHELL_ENV_CHECK} \
--lock pycharm -- \
EFROTOOLS_FULL_PYCHARM_RECACHE=${EFROTOOLS_FULL_PYCHARM_RECACHE} \
make pycharm-full
# Tell make which of these targets don't represent files.
.PHONY: check-cloud check-cloud-full check2-cloud-full pylint-cloud \
pylint-cloud-full mypy-cloud mypy-cloud-full pycharm-cloud pycharm-cloud-full
################################################################################
# #
# Testing #
@ -671,6 +740,26 @@ test-entity:
.PHONY: test test-full test-assetmanager
################################################################################
# #
# Testing (Internal) #
# #
################################################################################
# Cloud version of test
test-cloud:
@tools/cloudshell ${CLOUDSHELL_HOST_TEST} --env ${CLOUDSHELL_ENV_CHECK} -- \
make test
# Cloud version of test-full
test-cloud-full:
@tools/cloudshell ${CLOUDSHELL_HOST_TEST} --env ${CLOUDSHELL_ENV_CHECK} -- \
make test-full
# Tell make which of these targets don't represent files.
.PHONY: test-cloud test-cloud-full
################################################################################
# #
# Preflighting #
@ -709,6 +798,56 @@ preflight2-full:
.PHONY: preflight preflight-full preflight2 preflight2-full
################################################################################
# #
# Preflighting (Internal) #
# #
################################################################################
# TODO: If we add the ability to sync an entire env back, we could
# simply run preflight targets in their entirety in cloudshell instead
# of splitting them up like this.
# Run preflight in the cloud.
preflight-cloud:
@${MAKE} format
@${MAKE} update
@tools/cloudshell ${CLOUDSHELL_HOST_CHECK} --env ${CLOUDSHELL_ENV_CHECK} -- \
make -j4 cpplint pylint mypy test
@tools/pcommand echo SGRN BLD PREFLIGHT SUCCESSFUL!
# Run preflight-full in the cloud.
preflight-cloud-full:
@${MAKE} format-full
@${MAKE} update
@tools/cloudshell ${CLOUDSHELL_HOST_CHECK} --env ${CLOUDSHELL_ENV_CHECK} \
-- \
make -j4 cpplint-full pylint-full mypy-full test-full
@tools/pcommand echo SGRN BLD PREFLIGHT SUCCESSFUL!
# Run preflight2 in the cloud.
preflight2-cloud:
@${MAKE} format
@${MAKE} update
@tools/cloudshell ${CLOUDSHELL_HOST_CHECK} --env ${CLOUDSHELL_ENV_CHECK} \
--lock pycharm -- \
make -j5 cpplint pylint mypy pycharm test
@tools/pcommand echo SGRN BLD PREFLIGHT SUCCESSFUL!
# Run preflight2-full in the cloud.
preflight2-cloud-full:
@${MAKE} format-full
@${MAKE} update
@tools/cloudshell ${CLOUDSHELL_HOST_CHECK} --env ${CLOUDSHELL_ENV_CHECK} \
--lock pycharm -- \
make -j5 cpplint-full pylint-full mypy-full pycharm-full test-full
@tools/pcommand echo SGRN BLD PREFLIGHT SUCCESSFUL!
# Tell make which of these targets don't represent files.
.PHONY: preflight-cloud preflight-cloud-full preflight2-cloud \
preflight2-cloud-full
################################################################################
# #
# CMake #

View File

@ -13,8 +13,8 @@
<w>ack'ed</w>
<w>acked</w>
<w>acks</w>
<w>aclass's</w>
<w>aclass</w>
<w>aclass's</w>
<w>activityplayer</w>
<w>addrs</w>
<w>adjoint</w>
@ -153,8 +153,8 @@
<w>cmath</w>
<w>cmds</w>
<w>cmdvals</w>
<w>codewarrior's</w>
<w>codewarrior</w>
<w>codewarrior's</w>
<w>cofnodes</w>
<w>collapseable</w>
<w>collidable</w>
@ -833,6 +833,7 @@
<w>subclsssing</w>
<w>subentities</w>
<w>subitems</w>
<w>subpaths</w>
<w>subplatform</w>
<w>subscale</w>
<w>subscr</w>

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.29 build 20263</em></h4>
<h4><em>last updated on 2020-12-22 for Ballistica version 1.5.30 build 20264</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

@ -4,11 +4,13 @@
A system for defining structured data, supporting both static and runtime
type safety, serialization, efficient/sparse storage, per-field value
limits, etc. These are heavy-weight in comparison to things such as
limits, etc. This is a heavyweight option in comparison to things such as
dataclasses, but the increased features can make the overhead worth it for
certain use cases.
Advantages compared to nested dataclasses:
- Field names separated from their data representation so can get more
concise json data, change variable names while preserving back-compat, etc.
- Can wrap and preserve unmapped data (so fields can be added to new versions
of something without breaking old versions' ability to read the data)
- Incorrectly typed data is caught at runtime (for dataclasses we rely on

View File

@ -798,31 +798,41 @@ def check_pycharm(projroot: Path, full: bool, verbose: bool) -> None:
# In full mode, clear out pycharm's caches first.
# It seems we need to spin up the GUI and give it a bit to
# re-cache system python for this to work...
# UPDATE: This really slows things down, so we now only do it in
# very specific cases where time isn't important.
# (such as our daily full-test-runs)
# UPDATE 2: Looks like we might no longer need to do the GUI spin-up bit.
# If we can be certain of this, we can go back to simply blowing away
# the cache for 'full' mode checks without the env var.
if full and os.environ.get('EFROTOOLS_FULL_PYCHARM_RECACHE') == '1':
print('Clearing PyCharm caches...', flush=True)
subprocess.run('rm -rf ~/Library/Caches/PyCharmCE*',
subprocess.run('rm -rf ~/Library/Caches/JetBrains/PyCharmCE*',
shell=True,
check=True)
print('Launching GUI PyCharm to rebuild caches...', flush=True)
process = subprocess.Popen(str(pycharmbin))
# Wait a bit and ask it nicely to die.
# We need to make sure it has enough time to do its cache updating
# thing even if the system is fully under load.
time.sleep(5 * 60)
# Hoping this isn't necessary anymore. Need to rework this if it is,
# since it now gets run through ssh and gui stuff doesn't seem to
# work that way.
if bool(False):
print('Launching GUI PyCharm to rebuild caches...', flush=True)
process = subprocess.Popen(str(pycharmbin))
# Seems killing it via applescript is more likely to leave it
# in a working state for offline inspections than TERM signal..
subprocess.run(
"osascript -e 'tell application \"PyCharm CE\" to quit'",
shell=True,
check=False)
# process.terminate()
print('Waiting for GUI PyCharm to quit...', flush=True)
process.wait()
# Wait a bit and ask it nicely to die.
# We need to make sure it has enough time to do its cache updating
# thing even if the system is fully under load.
time.sleep(5 * 60)
# Seems killing it via applescript is more likely to leave it
# in a working state for offline inspections than TERM signal..
subprocess.run(
"osascript -e 'tell application \"PyCharm CE\" to quit'",
shell=True,
check=False)
# process.terminate()
print('Waiting for GUI PyCharm to quit...', flush=True)
process.wait()
_run_idea_inspections_cached(cachepath=cachepath,
filenames=filenames,

View File

@ -136,8 +136,14 @@ def _spelling(words: List[str]) -> None:
with open(fname, 'w') as outfile:
# Sort lines in the words section.
assert all(l.startswith(' <w>') for l in lines[3:-3])
outfile.write('\n'.join(lines[:3] + sorted(lines[3:-3]) +
lines[-3:]))
# Note: need to pull the </w> off the end of the line when sorting
# or it messes with the order and we get different results than
# Jetbrains stuff.
outfile.write('\n'.join(
lines[:3] +
sorted(lines[3:-3], key=lambda x: x.replace('</w>', '')) +
lines[-3:]))
print(f'Added {added_count} words to {fname}.')