arelle-release 2.37.46__py3-none-any.whl → 2.38.0__py3-none-any.whl
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- arelle/BetaFeatures.py +0 -21
- arelle/Cntlr.py +15 -8
- arelle/CntlrCmdLine.py +121 -56
- arelle/CntlrWinMain.py +143 -70
- arelle/DialogFind.py +1 -1
- arelle/DialogPluginManager.py +6 -4
- arelle/DisclosureSystem.py +7 -0
- arelle/ErrorManager.py +21 -6
- arelle/FileSource.py +11 -4
- arelle/FunctionIxt.py +16 -11
- arelle/HtmlUtil.py +5 -4
- arelle/LeiUtil.py +63 -43
- arelle/ModelDocument.py +20 -15
- arelle/ModelDtsObject.py +8 -0
- arelle/ModelInstanceObject.py +1 -1
- arelle/ModelObject.py +16 -18
- arelle/ModelObjectFactory.py +35 -17
- arelle/ModelXbrl.py +28 -11
- arelle/PluginManager.py +130 -105
- arelle/RuntimeOptions.py +1 -0
- arelle/UrlUtil.py +14 -0
- arelle/Validate.py +17 -12
- arelle/ValidateDuplicateFacts.py +3 -1
- arelle/ValidateFileSource.py +38 -0
- arelle/ValidateFilingText.py +3 -3
- arelle/ValidateXbrl.py +5 -2
- arelle/ValidateXbrlCalcs.py +210 -186
- arelle/ValidateXbrlDTS.py +1 -1
- arelle/ViewFile.py +1 -0
- arelle/ViewFileFactTable.py +2 -2
- arelle/ViewWinDTS.py +4 -1
- arelle/WebCache.py +28 -24
- arelle/XbrlConst.py +22 -0
- arelle/XmlUtil.py +16 -21
- arelle/XmlValidate.py +6 -9
- arelle/_version.py +16 -3
- arelle/api/Session.py +11 -2
- arelle/config/disclosuresystems.xsd +2 -0
- arelle/config/rosettaEntitlements.plist +8 -0
- arelle/conformance/CSVTestcaseLoader.py +1 -1
- arelle/formula/XPathContext.py +3 -3
- arelle/logging/formatters/LogFormatter.py +3 -1
- arelle/packages/report/ReportPackage.py +26 -13
- arelle/packages/report/ReportPackageConst.py +0 -1
- arelle/plugin/inlineXbrlDocumentSet.py +19 -5
- arelle/plugin/validate/DBA/DisclosureSystems.py +19 -1
- arelle/plugin/validate/DBA/PluginValidationDataExtension.py +2 -4
- arelle/plugin/validate/DBA/ValidationPluginExtension.py +2 -1
- arelle/plugin/validate/DBA/resources/config.xml +5 -0
- arelle/plugin/validate/DBA/rules/__init__.py +2 -2
- arelle/plugin/validate/DBA/rules/fr.py +19 -2
- arelle/plugin/validate/DBA/rules/tc.py +2 -0
- arelle/plugin/validate/DBA/rules/th.py +6 -0
- arelle/plugin/validate/DBA/rules/tm.py +18 -5
- arelle/plugin/validate/DBA/rules/tr.py +11 -5
- arelle/plugin/validate/EDINET/Constants.py +193 -9
- arelle/plugin/validate/EDINET/ContextRequirement.py +58 -0
- arelle/plugin/validate/EDINET/ControllerPluginData.py +220 -1
- arelle/plugin/validate/EDINET/CoverItemRequirements.py +42 -0
- arelle/plugin/validate/EDINET/DeiRequirements.py +118 -0
- arelle/plugin/validate/EDINET/FilingFormat.py +275 -0
- arelle/plugin/validate/EDINET/FormType.py +134 -0
- arelle/plugin/validate/EDINET/ManifestInstance.py +72 -5
- arelle/plugin/validate/EDINET/NamespaceConfig.py +50 -0
- arelle/plugin/validate/EDINET/PluginValidationDataExtension.py +493 -132
- arelle/plugin/validate/EDINET/{InstanceType.py → ReportFolderType.py} +72 -15
- arelle/plugin/validate/EDINET/Statement.py +139 -0
- arelle/plugin/validate/EDINET/TableOfContentsBuilder.py +595 -0
- arelle/plugin/validate/EDINET/UploadContents.py +48 -0
- arelle/plugin/validate/EDINET/ValidationPluginExtension.py +20 -2
- arelle/plugin/validate/EDINET/__init__.py +31 -6
- arelle/plugin/validate/EDINET/resources/config.xml +8 -1
- arelle/plugin/validate/EDINET/resources/cover-item-requirements.json +793 -0
- arelle/plugin/validate/EDINET/resources/dei-requirements.csv +27 -0
- arelle/plugin/validate/EDINET/resources/edinet-taxonomies.xml +2 -0
- arelle/plugin/validate/EDINET/rules/contexts.py +375 -14
- arelle/plugin/validate/EDINET/rules/edinet.py +1934 -45
- arelle/plugin/validate/EDINET/rules/frta.py +122 -3
- arelle/plugin/validate/EDINET/rules/gfm.py +1907 -11
- arelle/plugin/validate/EDINET/rules/upload.py +989 -141
- arelle/plugin/validate/ESEF/Const.py +3 -1
- arelle/plugin/validate/ESEF/ESEF_2021/DTS.py +5 -0
- arelle/plugin/validate/ESEF/ESEF_2021/Image.py +2 -2
- arelle/plugin/validate/ESEF/ESEF_2021/ValidateXbrlFinally.py +23 -20
- arelle/plugin/validate/ESEF/ESEF_Current/DTS.py +47 -14
- arelle/plugin/validate/ESEF/ESEF_Current/ValidateXbrlFinally.py +100 -25
- arelle/plugin/validate/ESEF/__init__.py +20 -6
- arelle/plugin/validate/ESEF/resources/authority-validations.json +76 -9
- arelle/plugin/validate/ESEF/resources/config.xml +20 -0
- arelle/plugin/validate/NL/DisclosureSystems.py +22 -0
- arelle/plugin/validate/NL/PluginValidationDataExtension.py +27 -9
- arelle/plugin/validate/NL/ValidationPluginExtension.py +51 -7
- arelle/plugin/validate/NL/resources/config.xml +18 -0
- arelle/plugin/validate/NL/rules/br_kvk.py +17 -61
- arelle/plugin/validate/NL/rules/fg_nl.py +7 -38
- arelle/plugin/validate/NL/rules/fr_kvk.py +7 -42
- arelle/plugin/validate/NL/rules/fr_nl.py +31 -147
- arelle/plugin/validate/NL/rules/nl_kvk.py +142 -28
- arelle/plugin/validate/ROS/PluginValidationDataExtension.py +2 -0
- arelle/plugin/validate/ROS/ValidationPluginExtension.py +4 -1
- arelle/plugin/validate/ROS/rules/ros.py +41 -9
- arelle/plugin/validate/UK/ValidateUK.py +130 -66
- arelle/plugin/validate/UK/__init__.py +89 -103
- arelle/utils/EntryPointDetection.py +79 -13
- arelle/utils/PluginHooks.py +125 -0
- arelle/utils/validate/ESEFImage.py +6 -6
- arelle/utils/validate/Validation.py +18 -0
- arelle/utils/validate/ValidationPlugin.py +76 -11
- arelle/utils/validate/ValidationUtil.py +35 -3
- {arelle_release-2.37.46.dist-info → arelle_release-2.38.0.dist-info}/METADATA +30 -20
- {arelle_release-2.37.46.dist-info → arelle_release-2.38.0.dist-info}/RECORD +115 -191
- {arelle_release-2.37.46.dist-info → arelle_release-2.38.0.dist-info}/licenses/LICENSE.md +0 -3
- arelle/archive/CustomLogger.py +0 -43
- arelle/archive/LoadEFMvalidate.py +0 -32
- arelle/archive/LoadSavePreLbCsv.py +0 -26
- arelle/archive/LoadValidate.cs +0 -31
- arelle/archive/LoadValidate.py +0 -36
- arelle/archive/LoadValidateCmdLine.java +0 -69
- arelle/archive/LoadValidatePostedZip.java +0 -57
- arelle/archive/LoadValidateWebService.java +0 -34
- arelle/archive/SaveTableToExelle.py +0 -140
- arelle/archive/TR3toTR4.py +0 -88
- arelle/archive/plugin/ESEF_2022/__init__.py +0 -47
- arelle/archive/plugin/bigInstance.py +0 -394
- arelle/archive/plugin/cmdWebServerExtension.py +0 -43
- arelle/archive/plugin/crashTest.py +0 -38
- arelle/archive/plugin/functionsXmlCreation.py +0 -106
- arelle/archive/plugin/hello_i18n.pot +0 -26
- arelle/archive/plugin/hello_i18n.py +0 -32
- arelle/archive/plugin/importTestChild1.py +0 -21
- arelle/archive/plugin/importTestChild2.py +0 -22
- arelle/archive/plugin/importTestGrandchild1.py +0 -21
- arelle/archive/plugin/importTestGrandchild2.py +0 -21
- arelle/archive/plugin/importTestImported1.py +0 -23
- arelle/archive/plugin/importTestImported11.py +0 -22
- arelle/archive/plugin/importTestParent.py +0 -48
- arelle/archive/plugin/instanceInfo.py +0 -306
- arelle/archive/plugin/loadFromOIM-2018.py +0 -1282
- arelle/archive/plugin/locale/fr/LC_MESSAGES/hello_i18n.po +0 -25
- arelle/archive/plugin/objectmaker.py +0 -285
- arelle/archive/plugin/packagedImportTest/__init__.py +0 -47
- arelle/archive/plugin/packagedImportTest/importTestChild1.py +0 -21
- arelle/archive/plugin/packagedImportTest/importTestChild2.py +0 -22
- arelle/archive/plugin/packagedImportTest/importTestGrandchild1.py +0 -21
- arelle/archive/plugin/packagedImportTest/importTestGrandchild2.py +0 -21
- arelle/archive/plugin/packagedImportTest/importTestImported1.py +0 -24
- arelle/archive/plugin/packagedImportTest/importTestImported11.py +0 -21
- arelle/archive/plugin/packagedImportTest/subdir/importTestImported111.py +0 -21
- arelle/archive/plugin/packagedImportTest/subdir/subsubdir/importTestImported1111.py +0 -21
- arelle/archive/plugin/sakaCalendar.py +0 -215
- arelle/archive/plugin/saveInstanceInfoset.py +0 -121
- arelle/archive/plugin/sphinx/FormulaGenerator.py +0 -823
- arelle/archive/plugin/sphinx/SphinxContext.py +0 -404
- arelle/archive/plugin/sphinx/SphinxEvaluator.py +0 -783
- arelle/archive/plugin/sphinx/SphinxMethods.py +0 -1287
- arelle/archive/plugin/sphinx/SphinxParser.py +0 -1093
- arelle/archive/plugin/sphinx/SphinxValidator.py +0 -163
- arelle/archive/plugin/sphinx/US-GAAP Ratios Example.xsr +0 -52
- arelle/archive/plugin/sphinx/__init__.py +0 -285
- arelle/archive/plugin/streamingExtensions.py +0 -335
- arelle/archive/plugin/updateTableLB.py +0 -242
- arelle/archive/plugin/validate/SBRnl/CustomLoader.py +0 -19
- arelle/archive/plugin/validate/SBRnl/DTS.py +0 -305
- arelle/archive/plugin/validate/SBRnl/Dimensions.py +0 -357
- arelle/archive/plugin/validate/SBRnl/Document.py +0 -799
- arelle/archive/plugin/validate/SBRnl/Filing.py +0 -467
- arelle/archive/plugin/validate/SBRnl/__init__.py +0 -75
- arelle/archive/plugin/validate/SBRnl/config.xml +0 -26
- arelle/archive/plugin/validate/SBRnl/sbr-nl-taxonomies.xml +0 -754
- arelle/archive/plugin/validate/USBestPractices.py +0 -570
- arelle/archive/plugin/validate/USCorpAction.py +0 -557
- arelle/archive/plugin/validate/USSecTagging.py +0 -337
- arelle/archive/plugin/validate/XDC/__init__.py +0 -77
- arelle/archive/plugin/validate/XDC/config.xml +0 -20
- arelle/archive/plugin/validate/XFsyntax/__init__.py +0 -64
- arelle/archive/plugin/validate/XFsyntax/xf.py +0 -2227
- arelle/archive/plugin/validate/calc2.py +0 -536
- arelle/archive/plugin/validateSchemaLxml.py +0 -156
- arelle/archive/plugin/validateTableInfoset.py +0 -52
- arelle/archive/us-gaap-dei-docType-extraction-frm.xml +0 -90
- arelle/archive/us-gaap-dei-ratio-cash-frm.xml +0 -150
- arelle/examples/plugin/formulaSuiteConverter.py +0 -212
- arelle/examples/plugin/functionsCustom.py +0 -59
- arelle/examples/plugin/hello_dolly.py +0 -64
- arelle/examples/plugin/multi.py +0 -58
- arelle/examples/plugin/rssSaveOim.py +0 -96
- arelle/examples/plugin/validate/XYZ/DisclosureSystems.py +0 -2
- arelle/examples/plugin/validate/XYZ/PluginValidationDataExtension.py +0 -10
- arelle/examples/plugin/validate/XYZ/ValidationPluginExtension.py +0 -49
- arelle/examples/plugin/validate/XYZ/__init__.py +0 -75
- arelle/examples/plugin/validate/XYZ/resources/config.xml +0 -16
- arelle/examples/plugin/validate/XYZ/rules/__init__.py +0 -0
- arelle/examples/plugin/validate/XYZ/rules/rules01.py +0 -110
- arelle/examples/plugin/validate/XYZ/rules/rules02.py +0 -59
- arelle/model/CommentBase.py +0 -9
- arelle/model/ElementBase.py +0 -11
- arelle/model/PIBase.py +0 -10
- arelle/model/__init__.py +0 -15
- arelle/scripts-macOS/startWebServer.command +0 -3
- arelle/scripts-unix/startWebServer.sh +0 -1
- arelle/scripts-windows/startWebServer.bat +0 -5
- {arelle_release-2.37.46.dist-info → arelle_release-2.38.0.dist-info}/WHEEL +0 -0
- {arelle_release-2.37.46.dist-info → arelle_release-2.38.0.dist-info}/entry_points.txt +0 -0
- {arelle_release-2.37.46.dist-info → arelle_release-2.38.0.dist-info}/top_level.txt +0 -0
arelle/Validate.py
CHANGED
|
@@ -14,6 +14,7 @@ from arelle import (FileSource, ModelXbrl, ModelDocument, ModelVersReport, XbrlC
|
|
|
14
14
|
ValidateXbrl, ValidateVersReport,
|
|
15
15
|
ValidateInfoset, ViewFileRenderedLayout, UrlUtil)
|
|
16
16
|
from arelle.PythonUtil import isLegacyAbs
|
|
17
|
+
from arelle.ValidateFileSource import ValidateFileSource
|
|
17
18
|
from arelle.formula import ValidateFormula
|
|
18
19
|
from arelle.ModelDocument import Type, ModelDocumentReference, load as modelDocumentLoad
|
|
19
20
|
from arelle.ModelDtsObject import ModelResource
|
|
@@ -24,7 +25,6 @@ from arelle.ModelTestcaseObject import testcaseVariationsByTarget, ModelTestcase
|
|
|
24
25
|
from arelle.ModelValue import (qname, QName)
|
|
25
26
|
from arelle.PluginManager import pluginClassMethods
|
|
26
27
|
from arelle.packages.report.DetectReportPackage import isReportPackageExtension
|
|
27
|
-
from arelle.packages.report.ReportPackageValidator import ReportPackageValidator
|
|
28
28
|
from arelle.rendering import RenderingEvaluator
|
|
29
29
|
from arelle.utils.EntryPointDetection import filesourceEntrypointFiles
|
|
30
30
|
from arelle.XmlUtil import collapseWhitespace, xmlstring
|
|
@@ -126,10 +126,6 @@ class Validate:
|
|
|
126
126
|
elif self.modelXbrl.modelDocument.type == Type.RSSFEED:
|
|
127
127
|
self.validateRssFeed()
|
|
128
128
|
else:
|
|
129
|
-
if self.modelXbrl.fileSource.isReportPackage or self.modelXbrl.modelManager.validateAllFilesAsReportPackages:
|
|
130
|
-
rpValidator = ReportPackageValidator(self.modelXbrl.fileSource)
|
|
131
|
-
for val in rpValidator.validate():
|
|
132
|
-
self.modelXbrl.log(level=val.level.name, codes=val.codes, msg=val.msg, modelXbrl=self.modelXbrl, **val.args)
|
|
133
129
|
try:
|
|
134
130
|
self.instValidator.validate(self.modelXbrl, self.modelXbrl.modelManager.formulaOptions.typedParameters(self.modelXbrl.prefixedNamespaces))
|
|
135
131
|
self.instValidator.close()
|
|
@@ -137,9 +133,10 @@ class Validate:
|
|
|
137
133
|
self.modelXbrl.error("exception:" + type(err).__name__,
|
|
138
134
|
_("Instance validation exception: %(error)s, instance: %(instance)s"),
|
|
139
135
|
modelXbrl=self.modelXbrl,
|
|
140
|
-
instance=self.modelXbrl.modelDocument.basename,
|
|
136
|
+
instance=self.modelXbrl.modelDocument.basename if hasattr(self.modelXbrl, "modelDocument") and hasattr(self.modelXbrl.modelDocument, "basename") else "(closed)",
|
|
137
|
+
error=err,
|
|
141
138
|
# traceback=traceback.format_tb(sys.exc_info()[2]),
|
|
142
|
-
exc_info=
|
|
139
|
+
exc_info=True)
|
|
143
140
|
self.close()
|
|
144
141
|
|
|
145
142
|
def validateRssFeed(self):
|
|
@@ -304,6 +301,7 @@ class Validate:
|
|
|
304
301
|
def _testcaseLoadReadMeFirstUri(self, testcase, modelTestcaseVariation, index, readMeFirstUri, resultIsVersioningReport, resultIsTaxonomyPackage, inputDTSes, errorCaptureLevel, baseForElement, parameters):
|
|
305
302
|
preLoadingErrors = [] # accumulate pre-loading errors, such as during taxonomy package loading
|
|
306
303
|
loadedModels = []
|
|
304
|
+
filesource = None
|
|
307
305
|
readMeFirstElements = modelTestcaseVariation.readMeFirstElements
|
|
308
306
|
expectTaxonomyPackage = (index < len(readMeFirstElements) and
|
|
309
307
|
readMeFirstElements[index] is not None and
|
|
@@ -387,10 +385,11 @@ class Validate:
|
|
|
387
385
|
pluginXbrlMethod(self, _rptPkgIxdsOptions)
|
|
388
386
|
reportPackageErrors = False
|
|
389
387
|
if (filesource.isReportPackage or self.modelXbrl.modelManager.validateAllFilesAsReportPackages) and not _rptPkgIxdsOptions:
|
|
390
|
-
|
|
391
|
-
|
|
388
|
+
preLoadingErrorsCount = len(preLoadingErrors)
|
|
389
|
+
fileSourceValidator = ValidateFileSource(self.modelXbrl.modelManager.cntlr, filesource)
|
|
390
|
+
fileSourceValidator.validate(self.modelXbrl.modelManager.validateAllFilesAsReportPackages, preLoadingErrors)
|
|
391
|
+
if len(preLoadingErrors) > preLoadingErrorsCount:
|
|
392
392
|
reportPackageErrors = True
|
|
393
|
-
preLoadingErrors.append(val.codes)
|
|
394
393
|
if filesource and not filesource.selection and filesource.isArchive:
|
|
395
394
|
try:
|
|
396
395
|
if filesource.isTaxonomyPackage or expectTaxonomyPackage:
|
|
@@ -398,6 +397,8 @@ class Validate:
|
|
|
398
397
|
filesource.select(None) # must select loadable reports (not the taxonomy package itself)
|
|
399
398
|
elif not filesource.isReportPackage:
|
|
400
399
|
entrypoints = filesourceEntrypointFiles(filesource)
|
|
400
|
+
fileSourceValidator = ValidateFileSource(self.modelXbrl.modelManager.cntlr, filesource)
|
|
401
|
+
fileSourceValidator.validate(self.modelXbrl.modelManager.validateAllFilesAsReportPackages, preLoadingErrors)
|
|
401
402
|
if entrypoints:
|
|
402
403
|
# resolve an IXDS in entrypoints
|
|
403
404
|
for pluginXbrlMethod in pluginClassMethods("ModelTestcaseVariation.ArchiveIxds"):
|
|
@@ -421,6 +422,8 @@ class Validate:
|
|
|
421
422
|
if not reportPackageErrors:
|
|
422
423
|
assert isinstance(filesource.basefile, str)
|
|
423
424
|
if entrypoints := filesourceEntrypointFiles(filesource):
|
|
425
|
+
fileSourceValidator = ValidateFileSource(self.modelXbrl.modelManager.cntlr, filesource)
|
|
426
|
+
fileSourceValidator.validate(self.modelXbrl.modelManager.validateAllFilesAsReportPackages, preLoadingErrors)
|
|
424
427
|
for pluginXbrlMethod in pluginClassMethods("ModelTestcaseVariation.ArchiveIxds"):
|
|
425
428
|
pluginXbrlMethod(self, filesource, entrypoints)
|
|
426
429
|
for entrypoint in entrypoints:
|
|
@@ -486,8 +489,10 @@ class Validate:
|
|
|
486
489
|
except Exception as err:
|
|
487
490
|
model.error("exception:" + type(err).__name__,
|
|
488
491
|
_("Testcase variation validation exception: %(error)s, instance: %(instance)s"),
|
|
489
|
-
modelXbrl=model, instance=model.modelDocument.basename, error=err, exc_info=
|
|
492
|
+
modelXbrl=model, instance=model.modelDocument.basename, error=err, exc_info=True)
|
|
490
493
|
model.hasFormulae = _hasFormulae
|
|
494
|
+
for pluginXbrlMethod in pluginClassMethods("Validate.Complete"):
|
|
495
|
+
pluginXbrlMethod(self.modelXbrl.modelManager.cntlr, filesource)
|
|
491
496
|
errors = [error for model in loadedModels for error in model.errors]
|
|
492
497
|
for err in preLoadingErrors:
|
|
493
498
|
if err not in errors:
|
|
@@ -570,7 +575,7 @@ class Validate:
|
|
|
570
575
|
except Exception as err:
|
|
571
576
|
modelXbrl.error("exception:" + type(err).__name__,
|
|
572
577
|
_("Testcase formula variation validation exception: %(error)s, instance: %(instance)s"),
|
|
573
|
-
modelXbrl=modelXbrl, instance=modelXbrl.modelDocument.basename, error=err, exc_info=
|
|
578
|
+
modelXbrl=modelXbrl, instance=modelXbrl.modelDocument.basename, error=err, exc_info=True)
|
|
574
579
|
if modelTestcaseVariation.resultIsInfoset and self.modelXbrl.modelManager.validateInfoset:
|
|
575
580
|
for pluginXbrlMethod in pluginClassMethods("Validate.Infoset"):
|
|
576
581
|
pluginXbrlMethod(modelXbrl, modelTestcaseVariation.resultInfosetUri)
|
arelle/ValidateDuplicateFacts.py
CHANGED
|
@@ -207,6 +207,8 @@ class DuplicateFactSet:
|
|
|
207
207
|
:return: A subset of the facts where the fact of lower precision in every consistent pair has been removed.
|
|
208
208
|
"""
|
|
209
209
|
facts = self.deduplicateCompleteSubsets()
|
|
210
|
+
if len(facts) < 2:
|
|
211
|
+
return facts
|
|
210
212
|
if not self.areNumeric:
|
|
211
213
|
# Consistency is equivalent to completeness for non-numeric facts
|
|
212
214
|
return facts
|
|
@@ -402,7 +404,7 @@ def getAspectEqualFacts(
|
|
|
402
404
|
fact.qname,
|
|
403
405
|
(
|
|
404
406
|
cast(str, fact.xmlLang or "").lower()
|
|
405
|
-
if useLang and fact.concept.type.
|
|
407
|
+
if useLang and fact.concept.type.isOimTextFactType
|
|
406
408
|
else None
|
|
407
409
|
),
|
|
408
410
|
)
|
|
@@ -0,0 +1,38 @@
|
|
|
1
|
+
"""
|
|
2
|
+
See COPYRIGHT.md for copyright information.
|
|
3
|
+
"""
|
|
4
|
+
|
|
5
|
+
from __future__ import annotations
|
|
6
|
+
|
|
7
|
+
from typing import TYPE_CHECKING
|
|
8
|
+
|
|
9
|
+
from arelle import PluginManager
|
|
10
|
+
from arelle.packages.report.ReportPackageValidator import ReportPackageValidator
|
|
11
|
+
|
|
12
|
+
if TYPE_CHECKING:
|
|
13
|
+
from arelle.Cntlr import Cntlr
|
|
14
|
+
from arelle.FileSource import FileSource
|
|
15
|
+
|
|
16
|
+
|
|
17
|
+
class ValidateFileSource:
|
|
18
|
+
def __init__(self, cntrl: Cntlr, filesource: FileSource):
|
|
19
|
+
self._cntrl = cntrl
|
|
20
|
+
self._filesource = filesource
|
|
21
|
+
|
|
22
|
+
def validate(self, forceValidateAsReportPackages: bool = False, errors: list[str] | None = None) -> None:
|
|
23
|
+
for pluginXbrlMethod in PluginManager.pluginClassMethods("Validate.FileSource"):
|
|
24
|
+
pluginXbrlMethod(self._cntrl, self._filesource)
|
|
25
|
+
|
|
26
|
+
if self._filesource.isReportPackage or forceValidateAsReportPackages:
|
|
27
|
+
rpValidator = ReportPackageValidator(self._filesource)
|
|
28
|
+
for val in rpValidator.validate():
|
|
29
|
+
codes = [val.codes] if isinstance(val.codes, str) else val.codes
|
|
30
|
+
for code in codes:
|
|
31
|
+
self._cntrl.addToLog(
|
|
32
|
+
messageCode=code,
|
|
33
|
+
message=val.msg,
|
|
34
|
+
messageArgs=val.args,
|
|
35
|
+
level=val.level.name,
|
|
36
|
+
)
|
|
37
|
+
if errors is not None:
|
|
38
|
+
errors.append(code)
|
arelle/ValidateFilingText.py
CHANGED
|
@@ -13,7 +13,7 @@ from arelle.PythonUtil import isLegacyAbs
|
|
|
13
13
|
from arelle.XbrlConst import ixbrlAll, xhtml
|
|
14
14
|
from arelle.XmlUtil import setXmlns, xmlstring, xmlDeclarationPattern, XmlDeclarationLocationException
|
|
15
15
|
from arelle.ModelObject import ModelObject
|
|
16
|
-
from arelle.UrlUtil import decodeBase64DataImage, isHttpUrl, scheme
|
|
16
|
+
from arelle.UrlUtil import decodeBase64DataImage, isExternalUrl, isHttpUrl, scheme
|
|
17
17
|
|
|
18
18
|
XMLpattern = re.compile(r".*(<|<|<|<)[A-Za-z_]+[A-Za-z0-9_:]*[^>]*(/>|>|>|/>).*", re.DOTALL)
|
|
19
19
|
CDATApattern = re.compile(r"<!\[CDATA\[(.+)\]\]")
|
|
@@ -631,7 +631,7 @@ def validateTextBlockFacts(modelXbrl):
|
|
|
631
631
|
attribute=attrTag, element=eltTag)
|
|
632
632
|
elif eltTag == "a" and (not allowedExternalHrefPattern or allowedExternalHrefPattern.match(attrValue)):
|
|
633
633
|
pass
|
|
634
|
-
elif
|
|
634
|
+
elif isExternalUrl(attrValue):
|
|
635
635
|
modelXbrl.error(("EFM.6.05.16.externalReference", "FERC.6.05.16.externalReference"),
|
|
636
636
|
_("Fact %(fact)s of context %(contextID)s has an invalid external reference in '%(attribute)s' for <%(element)s>"),
|
|
637
637
|
modelObject=f1, fact=f1.qname, contextID=f1.contextID,
|
|
@@ -773,7 +773,7 @@ def validateHtmlContent(modelXbrl, referenceElt, htmlEltTree, validatedObjectLab
|
|
|
773
773
|
messageCodes=("EFM.6.05.34.activeContent", "EFM.5.02.05.activeContent", "FERC.6.05.34.activeContent", "FERC.5.02.05.activeContent"))
|
|
774
774
|
elif eltTag == "a" and (not allowedExternalHrefPattern or allowedExternalHrefPattern.match(attrValue)):
|
|
775
775
|
pass
|
|
776
|
-
elif
|
|
776
|
+
elif isExternalUrl(attrValue):
|
|
777
777
|
modelXbrl.error(messageCodePrefix + "externalReference",
|
|
778
778
|
_("%(validatedObjectLabel)s has an invalid external reference in '%(attribute)s' for <%(element)s>: %(value)s"),
|
|
779
779
|
modelObject=elt, validatedObjectLabel=validatedObjectLabel,
|
arelle/ValidateXbrl.py
CHANGED
|
@@ -147,6 +147,8 @@ class ValidateXbrl:
|
|
|
147
147
|
if arcrole.startswith("XBRL-") or ELR is None or \
|
|
148
148
|
linkqname is None or arcqname is None:
|
|
149
149
|
continue
|
|
150
|
+
elif arcrole in self.modelXbrl.modelManager.disclosureSystem.arcroleCyclesAllowed:
|
|
151
|
+
cyclesAllowed, specSect = self.modelXbrl.modelManager.disclosureSystem.arcroleCyclesAllowed[arcrole]
|
|
150
152
|
elif arcrole in XbrlConst.standardArcroleCyclesAllowed:
|
|
151
153
|
# TODO: table should be in this module, where it is used
|
|
152
154
|
cyclesAllowed, specSect = XbrlConst.standardArcroleCyclesAllowed[arcrole]
|
|
@@ -163,7 +165,7 @@ class ValidateXbrl:
|
|
|
163
165
|
or arcrole in self.genericArcArcroles \
|
|
164
166
|
or arcrole.startswith(XbrlConst.formulaStartsWith) \
|
|
165
167
|
or (modelXbrl.hasXDT and arcrole.startswith(XbrlConst.dimStartsWith)):
|
|
166
|
-
relsSet = modelXbrl.relationshipSet(arcrole,ELR,linkqname,arcqname)
|
|
168
|
+
relsSet = modelXbrl.relationshipSet(arcrole, ELR, linkqname, arcqname)
|
|
167
169
|
if cyclesAllowed != "any" and \
|
|
168
170
|
((XbrlConst.isStandardExtLinkQname(linkqname) and XbrlConst.isStandardArcQname(arcqname)) \
|
|
169
171
|
or arcrole in self.genericArcArcroles):
|
|
@@ -426,7 +428,8 @@ class ValidateXbrl:
|
|
|
426
428
|
|
|
427
429
|
if self.validateCalcs:
|
|
428
430
|
modelXbrl.modelManager.showStatus(_("Validating instance calculations"))
|
|
429
|
-
ValidateXbrlCalcs.validate(modelXbrl, self.validateCalcs)
|
|
431
|
+
for val in ValidateXbrlCalcs.validate(modelXbrl, self.validateCalcs):
|
|
432
|
+
modelXbrl.validation(val)
|
|
430
433
|
modelXbrl.profileStat(_("validateCalculations"))
|
|
431
434
|
|
|
432
435
|
if self.validateUTR:
|