Cleanup: spelling (make check_spelling_*)

Also exclude some files that have too many false positives.
This commit is contained in:
Campbell Barton
2025-07-20 14:39:42 +10:00
parent 732436946e
commit e5947bdf63
8 changed files with 20 additions and 19 deletions

View File

@@ -26,7 +26,7 @@ settings = settings_i18n.I18nSettings()
# Operators ################################################################### # Operators ###################################################################
class UI_OT_i18n_settings_load(Operator): class UI_OT_i18n_settings_load(Operator):
"""Load translations' settings from a persistent JSon file""" """Load translations' settings from a persistent JSON file"""
bl_idname = "ui.i18n_settings_load" bl_idname = "ui.i18n_settings_load"
bl_label = "I18n Load Settings" bl_label = "I18n Load Settings"
bl_option = {'REGISTER'} bl_option = {'REGISTER'}
@@ -58,7 +58,7 @@ class UI_OT_i18n_settings_load(Operator):
class UI_OT_i18n_settings_save(Operator): class UI_OT_i18n_settings_save(Operator):
"""Save translations' settings in a persistent JSon file""" """Save translations' settings in a persistent JSON file"""
bl_idname = "ui.i18n_settings_save" bl_idname = "ui.i18n_settings_save"
bl_label = "I18n Save Settings" bl_label = "I18n Save Settings"
bl_option = {'REGISTER'} bl_option = {'REGISTER'}

View File

@@ -1248,7 +1248,7 @@ def main():
parser.add_argument('-m', '--no_messages', default=True, action="store_false", help="No export of UI messages.") parser.add_argument('-m', '--no_messages', default=True, action="store_false", help="No export of UI messages.")
parser.add_argument('-o', '--output', default=None, help="Output POT file path.") parser.add_argument('-o', '--output', default=None, help="Output POT file path.")
parser.add_argument('-s', '--settings', default=None, parser.add_argument('-s', '--settings', default=None,
help="Override (some) default settings. Either a JSon file name, or a JSon string.") help="Override (some) default settings. Either a JSON file name, or a JSON string.")
args = parser.parse_args(argv) args = parser.parse_args(argv)
settings = settings_i18n.I18nSettings() settings = settings_i18n.I18nSettings()

View File

@@ -716,7 +716,7 @@ def _check_valid_data(uid, val):
class I18nSettings: class I18nSettings:
""" """
Class allowing persistence of our settings! Class allowing persistence of our settings!
Saved in JSon format, so settings should be JSon'able objects! Saved in JSON format, so settings should be JSON'able objects!
""" """
_settings = None _settings = None
@@ -763,7 +763,7 @@ class I18nSettings:
return return
if isinstance(fname, str): if isinstance(fname, str):
if not os.path.isfile(fname): if not os.path.isfile(fname):
# Assume it is already real JSon string... # Assume it is already real JSON string.
self.from_json(fname) self.from_json(fname)
return return
with open(fname, encoding="utf8") as f: with open(fname, encoding="utf8") as f:

View File

@@ -86,7 +86,7 @@ def main():
parser = argparse.ArgumentParser(description="Tool to perform common actions over PO/MO files.") parser = argparse.ArgumentParser(description="Tool to perform common actions over PO/MO files.")
parser.add_argument( parser.add_argument(
'-s', '--settings', default=None, '-s', '--settings', default=None,
help="Override (some) default settings. Either a JSon file name, or a JSon string.", help="Override (some) default settings. Either a JSON file name, or a JSON string.",
) )
sub_parsers = parser.add_subparsers() sub_parsers = parser.add_subparsers()

View File

@@ -399,7 +399,7 @@ def ngon_tessellate(from_data, indices, fix_loops=True, debug_print=True):
if not fill: if not fill:
if debug_print: if debug_print:
print('Warning Cannot scanfill, fallback on a triangle fan.') print('Warning Cannot scan-fill, fallback on a triangle fan.')
fill = [[0, i - 1, i] for i in range(2, len(indices))] fill = [[0, i - 1, i] for i in range(2, len(indices))]
else: else:
# Use real scan-fill. # Use real scan-fill.

View File

@@ -1454,10 +1454,10 @@ static ImBuf *seq_render_scene_strip(const RenderData *context,
use_gpencil = false; use_gpencil = false;
} }
/* prevent eternal loop */ /* Prevent eternal loop. */
scene->r.scemode &= ~R_DOSEQ; scene->r.scemode &= ~R_DOSEQ;
/* stooping to new low's in hackyness :( */ /* Temporarily disable camera switching to enforce using `camera`. */
scene->r.mode |= R_NO_CAMERA_SWITCH; scene->r.mode |= R_NO_CAMERA_SWITCH;
is_frame_update = (orig_data.timeline_frame != scene->r.cfra) || is_frame_update = (orig_data.timeline_frame != scene->r.cfra) ||
@@ -1606,7 +1606,6 @@ finally:
BKE_scene_graph_update_for_newframe(depsgraph); BKE_scene_graph_update_for_newframe(depsgraph);
} }
/* stooping to new low's in hackyness :( */
scene->r.mode &= orig_data.mode | ~R_NO_CAMERA_SWITCH; scene->r.mode &= orig_data.mode | ~R_NO_CAMERA_SWITCH;
return ibuf; return ibuf;

View File

@@ -905,6 +905,8 @@ dict_ignore_hyphenated_suffix = {
} }
files_ignore = { files_ignore = {
"scripts/modules/bl_i18n_utils/utils_spell_check.py", # UI spelling, doesn't always match code spelling.
"tools/utils/git_data_canonical_authors.py", # Too many names which aren't in the dictionary.
"tools/utils_doc/rna_manual_reference_updater.py", # Contains language ID references. "tools/utils_doc/rna_manual_reference_updater.py", # Contains language ID references.
# Maintained by 3rd parties. # Maintained by 3rd parties.

View File

@@ -4,7 +4,7 @@
# SPDX-License-Identifier: GPL-2.0-or-later # SPDX-License-Identifier: GPL-2.0-or-later
""" """
This is a tool for generating a JSon version of a blender file (only its structure, or all its data included). This is a tool for generating a JSON version of a blender file (only its structure, or all its data included).
It can also run some simple validity checks over a .blend file. It can also run some simple validity checks over a .blend file.
@@ -27,7 +27,7 @@ making diff pretty noisy):
./blend2json.py --no-old-addresses foo.blend ./blend2json.py --no-old-addresses foo.blend
To check a .blend file instead of outputting its JSon version (use explicit -o option to do both at the same time): To check a .blend file instead of outputting its JSON version (use explicit -o option to do both at the same time):
./blend2json.py -c foo.blend ./blend2json.py -c foo.blend
@@ -331,7 +331,7 @@ def check_file(args, blend):
addr_old = set() addr_old = set()
for block in blend.blocks: for block in blend.blocks:
if block.addr_old in addr_old: if block.addr_old in addr_old:
print("ERROR! Several data blocks share same 'addr_old' uuid %d, " print("ERROR! Several data blocks share same 'addr_old' UUID %d, "
"this should never happen!" % block.addr_old) "this should never happen!" % block.addr_old)
continue continue
addr_old.add(block.addr_old) addr_old.add(block.addr_old)
@@ -366,7 +366,7 @@ def argparse_create():
parser.add_argument( parser.add_argument(
"--no-old-addresses", dest="no_address", default=False, action='store_true', required=False, "--no-old-addresses", dest="no_address", default=False, action='store_true', required=False,
help=("Do not output old memory address of each block of data " help=("Do not output old memory address of each block of data "
"(used as 'uuid' in .blend files, but change pretty noisily)")) "(used as 'UUID' in .blend files, but change pretty noisily)"))
parser.add_argument( parser.add_argument(
"--no-fake-old-addresses", dest="use_fake_address", default=True, action='store_false', "--no-fake-old-addresses", dest="use_fake_address", default=True, action='store_false',
required=False, required=False,
@@ -376,22 +376,22 @@ def argparse_create():
parser.add_argument( parser.add_argument(
"--full-data", dest="full_data", "--full-data", dest="full_data",
default=False, action='store_true', required=False, default=False, action='store_true', required=False,
help=("Also put in JSon file data itself " help=("Also put in JSON file data itself "
"(WARNING! will generate *huge* verbose files - and is far from complete yet)")) "(WARNING! will generate *huge* verbose files - and is far from complete yet)"))
parser.add_argument( parser.add_argument(
"--filter-data", dest="filter_data", "--filter-data", dest="filter_data",
default=None, required=False, default=None, required=False,
help=("Only put in JSon file data fields which names match given comma-separated list " help=("Only put in JSON file data fields which names match given comma-separated list "
"(ignored if --full-data is set)")) "(ignored if --full-data is set)"))
parser.add_argument( parser.add_argument(
"--full-dna", dest="full_dna", default=False, action='store_true', required=False, "--full-dna", dest="full_dna", default=False, action='store_true', required=False,
help=("Also put in JSon file dna properties description (ignored when --compact-output is used)")) help=("Also put in JSON file dna properties description (ignored when --compact-output is used)"))
parser.add_argument( parser.add_argument(
"--raw-bblock", dest="raw_bblock", "--raw-bblock", dest="raw_bblock",
default=False, action='store_true', required=False, default=False, action='store_true', required=False,
help=("Do not attempt to open and parse the Blendfile at a high level, but only handles its basic data layout " help=("Do not attempt to open and parse the blend-file at a high level, but only handles its basic data layout "
"(usable when the given files are not valid blendfiles - e.g. corrupted ones)")) "(usable when the given files are not valid blend-files - e.g. corrupted ones)"))
group = parser.add_argument_group("Filters", FILTER_DOC) group = parser.add_argument_group("Filters", FILTER_DOC)
group.add_argument( group.add_argument(