Comments (1)
@gvwilson I looked into this. It's because it falls through checks by the linter and is silently dropped by check_glossary.py.
The linter would flag:
- slug: # nothing here
- slug: an_entry
check_glossary.py would flag:
- slug: entry
unknown_key:
or
- slug: entry
- # missing the slug key
- slug: another_entry
The existing function that could easily catch this is here. My notes inside **
explain why it fails to catch them:
def checkEntry(entry):
'''
Check structure of individual entries, returning a language-to-set
dictionary of terms references in the body.
'''
keys = set(entry.keys())
** ENTRY_REQUIRED_KEYS is {'slug'} (won't be missing for an entry without a body) **
missing = [k for k in ENTRY_REQUIRED_KEYS if k not in keys]
if missing:
print(f'Missing required keys for entry {entry}: {missing}')
slug = entry['slug']
unknown_keys = keys - ENTRY_KEYS
if unknown_keys:
print(f'Unknown keys in {slug}: {unknown_keys}')
result = {}
crossrefs = set(entry['ref']) if ('ref' in entry) else set()
** if the entry is empty, it doesn't have any language keys, so it is silently dropped here **
for lang in ENTRY_LANGUAGE_KEYS:
if lang in entry:
label = f'{slug}/{lang}'
result[lang] = checkLanguageDef(label, crossrefs, entry[lang])
return result
There are different ways this could be solved. An easy one, and the test I used to determine where the bug lay, is to insert: if keys == {'slug'}: print('Empty entry found')
after keys = set(entry.keys())
.
However, it is worth clarifying exactly what sort of 'empty entry' is to be avoided and whether there are other checks worth making.
from glosario.
Related Issues (20)
- January 12, 2022: index sidebar not useful
- 11 February 2022: Suggested addition of "autocorrelation" (checkout) HOT 3
- [26.04.2022]: [Mandarin]
- [9.5.2022.]: [Croatian] HOT 3
- [2022-06-23]: [IsiZulu] Data Science Terms HOT 1
- [20222-07-14]: [Latin] HOT 1
- [2022-07-04]: [Mandarin]
- [2022-09-08]: [Chinese-δΈζ] HOT 4
- 2022-10-21: Build Failure HOT 1
- QUESTION: Weblate integration HOT 3
- [2022-12-12]: [Hungarian | Magyar] HOT 4
- 2023-01-10: Lesson Contribution - Some Translations HOT 2
- 2023-03-08: English/Deep learning terms HOT 10
- 2023-04-07: Reference links to parametric (statistics) and non-parametric (statistics) are broken HOT 1
- [13/06/2023]: [HAUSA]
- [August 31, 2023]: [definition of 'specificity' needs to be rephrased] HOT 1
- 2024-02-19: link from home page to Latin page is broken HOT 2
- [2024-06-10]: [Missing Ukrainian links and overview pages] HOT 1
- [20 June]: [English terms that need defining]
- [2024-06-24]: [Ordering alphabetically for Ukrainian language]
Recommend Projects
-
React
A declarative, efficient, and flexible JavaScript library for building user interfaces.
-
Vue.js
π Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
-
Typescript
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
-
TensorFlow
An Open Source Machine Learning Framework for Everyone
-
Django
The Web framework for perfectionists with deadlines.
-
Laravel
A PHP framework for web artisans
-
D3
Bring data to life with SVG, Canvas and HTML. πππ
-
Recommend Topics
-
javascript
JavaScript (JS) is a lightweight interpreted programming language with first-class functions.
-
web
Some thing interesting about web. New door for the world.
-
server
A server is a program made to process requests and deliver data to clients.
-
Machine learning
Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.
-
Visualization
Some thing interesting about visualization, use data art
-
Game
Some thing interesting about game, make everyone happy.
Recommend Org
-
Facebook
We are working to build community through open source technology. NB: members must have two-factor auth.
-
Microsoft
Open source projects and samples from Microsoft.
-
Google
Google β€οΈ Open Source for everyone.
-
Alibaba
Alibaba Open Source for everyone
-
D3
Data-Driven Documents codes.
-
Tencent
China tencent open source team.
from glosario.