diff --git a/abaplint.jsonc b/abaplint.jsonc index 6447b59da..e21510765 100644 --- a/abaplint.jsonc +++ b/abaplint.jsonc @@ -1,19 +1,12 @@ { "global": { "files": "/file-formats/**/*.*", - "exclude": ["/examples/"], - "skipGeneratedGatewayClasses": true, - "skipGeneratedPersistentClasses": true, - "skipGeneratedFunctionGroups": true, - "useApackDependencies": false, - "skipIncludesWithoutMain": false + "exclude": ["/examples/"] }, "dependencies": [], "syntax": { "version": "v702", - "errorNamespace": ".", - "globalConstants": [], - "globalMacros": [] + "errorNamespace": "." }, "rules": { "align_parameters": true, diff --git a/file-formats/docu-v1.json b/file-formats/docu-v1.json new file mode 100644 index 000000000..b9fa1b209 --- /dev/null +++ b/file-formats/docu-v1.json @@ -0,0 +1,50 @@ +{ + "$comment": "This file is autogenerated, do not edit manually, see https://github.com/SAP/abap-file-formats for more information.", + "$schema": "https://json-schema.org/draft/2020-12/schema", + "$id": "https://github.com/SAP/abap-file-formats/blob/main/file-formats/longtexts-v1.json", + "title": "ABAP Daemon", + "title": "Documentation", + "description": "documentation", + "type": "object", + "properties": { + "formatVersion": { + "title": "ABAP File Format Version", + "description": "The ABAP file format version", + "type": "string", + "const": "1" + }, + "lines": { + "title": "Start Type", + "description": "Start type", + "type": "array", + "items": { + "title": "Long Text Line", + "description": "Long text line with format and content", + "type": "object", + "properties": { + "format": { + "title": "Format", + "description": "Paragraph format, max. length 2", + "type": "string", + "maxLength": 2 + }, + "line": { + "title": "Line", + "description": "Long text line content, max. length 72", + "type": "string", + "maxLength": 72 + } + }, + "additionalProperties": false, + "required": [ + "format", + "line" + ] + } + } + }, + "additionalProperties": false, + "required": [ + "formatVersion" + ] +} diff --git a/file-formats/doma/README.md b/file-formats/doma/README.md index 787099218..6c5e54e2a 100644 --- a/file-formats/doma/README.md +++ b/file-formats/doma/README.md @@ -11,3 +11,4 @@ DOMA | Domain | Dictionary File | Cardinality | Definition | Schema | Example :--- | :--- | :--- | :--- | :--- `.doma.json` | 1 | [`zif_aff_doma_v1.intf.abap`](./type/zif_aff_doma_v1.intf.abap) | [`doma-v1.json`](./doma-v1.json) | [`z_aff_example.doma.json`](./examples/z_aff_example.doma.json) +`.doma.docu.json` | 0...1 | [`zif_aff_docu_v1.intf.abap`](../zif_aff_docu_v1.intf.abap) | [`docu-v1.json`](../docu-v1.json) | [`z_aff_example.doma.docu.json`](./examples/z_aff_example.doma.docu.json) diff --git a/file-formats/doma/examples/z_aff_example.doma.docu.json b/file-formats/doma/examples/z_aff_example.doma.docu.json new file mode 100644 index 000000000..4d9450fe0 --- /dev/null +++ b/file-formats/doma/examples/z_aff_example.doma.docu.json @@ -0,0 +1,13 @@ +{ + "formatVersion": "1", + "lines": [ + { + "format": "P1", + "line": "This is an example long text for the domain Z_AFF_EXAMPLE." + }, + { + "format": "P1", + "line": "It describes the meaning and usage of the domain values." + } + ] +} diff --git a/file-formats/zif_aff_docu_v1.intf.abap b/file-formats/zif_aff_docu_v1.intf.abap new file mode 100644 index 000000000..0d14538ab --- /dev/null +++ b/file-formats/zif_aff_docu_v1.intf.abap @@ -0,0 +1,33 @@ +"!

Long text types

+"! Types for AFF long texts +INTERFACE zif_aff_docu_v1 PUBLIC. + + TYPES: + "!

Long Text Line

+ "! Long text line with format and content + BEGIN OF ty_line, + "!

Format

+ "! Paragraph format, max. length 2 + "! $required + format TYPE c LENGTH 2, + "!

Line

+ "! Long text line content, max. length 72 + "! $required + line TYPE c LENGTH 72, + END OF ty_line, + "!

Long Text Lines

+ "! Long text lines + ty_lines TYPE STANDARD TABLE OF ty_line WITH DEFAULT KEY. + + TYPES: + "!

Documentation

+ "! Documentation + BEGIN OF ty_main, + "! $required + format_version TYPE zif_aff_types_v1=>ty_format_version, + "!

Start Type

+ "! Start type + lines TYPE ty_lines, + END OF ty_main. + +ENDINTERFACE. diff --git a/file-formats/zif_aff_docu_v1.intf.json b/file-formats/zif_aff_docu_v1.intf.json new file mode 100644 index 000000000..a7bbb899f --- /dev/null +++ b/file-formats/zif_aff_docu_v1.intf.json @@ -0,0 +1,7 @@ +{ + "formatVersion": "1", + "header": { + "description": "Common types for longtexts", + "originalLanguage": "en" + } +} diff --git a/json-validator.py b/json-validator.py index bb2c04a11..4b892ec08 100644 --- a/json-validator.py +++ b/json-validator.py @@ -9,7 +9,7 @@ msg_errors = list() msg_warning = list() -schemas = sorted( glob.glob('./file-formats/*/*.json') ) +schemas = sorted( glob.glob('./file-formats/*-v*.json') + glob.glob('./file-formats/*/*.json') ) examples = sorted( glob.glob('./file-formats/*/examples/*.json', recursive=True) ) def decode_json( file ): @@ -42,6 +42,7 @@ def match_schema_to_data( ): example_version = decode_json( example )[ 'formatVersion' ] json_schema = [ schema for schema in schemas if example_type in os.path.basename(schema).split( sep = '-' )[0] and example_version in os.path.basename(schema).split( sep='-')[1]] + try: match[example] = json_schema.pop( 0 ) except IndexError: