Skip to content

Commit a1930d2

Browse files
authored
Add a single linter rule to remove non-applicable type-specific keywords (#1773)
Signed-off-by: Juan Cruz Viotti <jv@jviotti.com>
1 parent ea1a0c6 commit a1930d2

File tree

95 files changed

+112
-3923
lines changed

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

95 files changed

+112
-3923
lines changed

src/extension/alterschema/CMakeLists.txt

Lines changed: 1 addition & 92 deletions
Original file line numberDiff line numberDiff line change
@@ -46,98 +46,7 @@ sourcemeta_library(NAMESPACE sourcemeta PROJECT core NAME alterschema
4646
linter/unsatisfiable_min_properties.h
4747
linter/content_media_type_without_encoding.h
4848
linter/content_schema_without_media_type.h
49-
linter/drop_non_array_keywords_applicator_2019_09.h
50-
linter/drop_non_array_keywords_applicator_2020_12.h
51-
linter/drop_non_array_keywords_content_2019_09.h
52-
linter/drop_non_array_keywords_content_2020_12.h
53-
linter/drop_non_array_keywords_draft0.h
54-
linter/drop_non_array_keywords_draft1.h
55-
linter/drop_non_array_keywords_draft2.h
56-
linter/drop_non_array_keywords_draft3.h
57-
linter/drop_non_array_keywords_draft4.h
58-
linter/drop_non_array_keywords_draft6.h
59-
linter/drop_non_array_keywords_draft7.h
60-
linter/drop_non_array_keywords_format_2019_09.h
61-
linter/drop_non_array_keywords_format_2020_12.h
62-
linter/drop_non_array_keywords_unevaluated_2020_12.h
63-
linter/drop_non_array_keywords_validation_2019_09.h
64-
linter/drop_non_array_keywords_validation_2020_12.h
65-
linter/drop_non_boolean_keywords_applicator_2019_09.h
66-
linter/drop_non_boolean_keywords_applicator_2020_12.h
67-
linter/drop_non_boolean_keywords_content_2019_09.h
68-
linter/drop_non_boolean_keywords_content_2020_12.h
69-
linter/drop_non_boolean_keywords_draft0.h
70-
linter/drop_non_boolean_keywords_draft1.h
71-
linter/drop_non_boolean_keywords_draft2.h
72-
linter/drop_non_boolean_keywords_draft3.h
73-
linter/drop_non_boolean_keywords_draft4.h
74-
linter/drop_non_boolean_keywords_draft6.h
75-
linter/drop_non_boolean_keywords_draft7.h
76-
linter/drop_non_boolean_keywords_format_2019_09.h
77-
linter/drop_non_boolean_keywords_format_2020_12.h
78-
linter/drop_non_boolean_keywords_unevaluated_2020_12.h
79-
linter/drop_non_boolean_keywords_validation_2019_09.h
80-
linter/drop_non_boolean_keywords_validation_2020_12.h
81-
linter/drop_non_null_keywords_applicator_2019_09.h
82-
linter/drop_non_null_keywords_applicator_2020_12.h
83-
linter/drop_non_null_keywords_content_2019_09.h
84-
linter/drop_non_null_keywords_content_2020_12.h
85-
linter/drop_non_null_keywords_draft0.h
86-
linter/drop_non_null_keywords_draft1.h
87-
linter/drop_non_null_keywords_draft2.h
88-
linter/drop_non_null_keywords_draft3.h
89-
linter/drop_non_null_keywords_draft4.h
90-
linter/drop_non_null_keywords_draft6.h
91-
linter/drop_non_null_keywords_draft7.h
92-
linter/drop_non_null_keywords_format_2019_09.h
93-
linter/drop_non_null_keywords_format_2020_12.h
94-
linter/drop_non_null_keywords_unevaluated_2020_12.h
95-
linter/drop_non_null_keywords_validation_2019_09.h
96-
linter/drop_non_null_keywords_validation_2020_12.h
97-
linter/drop_non_numeric_keywords_applicator_2019_09.h
98-
linter/drop_non_numeric_keywords_applicator_2020_12.h
99-
linter/drop_non_numeric_keywords_content_2019_09.h
100-
linter/drop_non_numeric_keywords_content_2020_12.h
101-
linter/drop_non_numeric_keywords_draft0.h
102-
linter/drop_non_numeric_keywords_draft1.h
103-
linter/drop_non_numeric_keywords_draft2.h
104-
linter/drop_non_numeric_keywords_draft3.h
105-
linter/drop_non_numeric_keywords_draft4.h
106-
linter/drop_non_numeric_keywords_draft6.h
107-
linter/drop_non_numeric_keywords_draft7.h
108-
linter/drop_non_numeric_keywords_format_2019_09.h
109-
linter/drop_non_numeric_keywords_format_2020_12.h
110-
linter/drop_non_numeric_keywords_unevaluated_2020_12.h
111-
linter/drop_non_numeric_keywords_validation_2019_09.h
112-
linter/drop_non_numeric_keywords_validation_2020_12.h
113-
linter/drop_non_object_keywords_applicator_2019_09.h
114-
linter/drop_non_object_keywords_applicator_2020_12.h
115-
linter/drop_non_object_keywords_content_2019_09.h
116-
linter/drop_non_object_keywords_content_2020_12.h
117-
linter/drop_non_object_keywords_draft0.h
118-
linter/drop_non_object_keywords_draft1.h
119-
linter/drop_non_object_keywords_draft2.h
120-
linter/drop_non_object_keywords_draft3.h
121-
linter/drop_non_object_keywords_draft4.h
122-
linter/drop_non_object_keywords_draft6.h
123-
linter/drop_non_object_keywords_draft7.h
124-
linter/drop_non_object_keywords_format_2019_09.h
125-
linter/drop_non_object_keywords_format_2020_12.h
126-
linter/drop_non_object_keywords_unevaluated_2020_12.h
127-
linter/drop_non_object_keywords_validation_2019_09.h
128-
linter/drop_non_object_keywords_validation_2020_12.h
129-
linter/drop_non_string_keywords_applicator_2019_09.h
130-
linter/drop_non_string_keywords_applicator_2020_12.h
131-
linter/drop_non_string_keywords_draft0.h
132-
linter/drop_non_string_keywords_draft1.h
133-
linter/drop_non_string_keywords_draft2.h
134-
linter/drop_non_string_keywords_draft3.h
135-
linter/drop_non_string_keywords_draft4.h
136-
linter/drop_non_string_keywords_draft6.h
137-
linter/drop_non_string_keywords_draft7.h
138-
linter/drop_non_string_keywords_unevaluated_2020_12.h
139-
linter/drop_non_string_keywords_validation_2019_09.h
140-
linter/drop_non_string_keywords_validation_2020_12.h
49+
linter/non_applicable_type_specific_keywords.h
14150
linter/unnecessary_allof_ref_wrapper.h
14251
linter/duplicate_allof_branches.h
14352
linter/duplicate_anyof_branches.h

src/extension/alterschema/alterschema.cc

Lines changed: 2 additions & 184 deletions
Original file line numberDiff line numberDiff line change
@@ -56,98 +56,6 @@ static auto every_item_is_boolean(const T &container) -> bool {
5656
#include "linter/dependencies_property_tautology.h"
5757
#include "linter/dependent_required_default.h"
5858
#include "linter/dependent_required_tautology.h"
59-
#include "linter/drop_non_array_keywords_applicator_2019_09.h"
60-
#include "linter/drop_non_array_keywords_applicator_2020_12.h"
61-
#include "linter/drop_non_array_keywords_content_2019_09.h"
62-
#include "linter/drop_non_array_keywords_content_2020_12.h"
63-
#include "linter/drop_non_array_keywords_draft0.h"
64-
#include "linter/drop_non_array_keywords_draft1.h"
65-
#include "linter/drop_non_array_keywords_draft2.h"
66-
#include "linter/drop_non_array_keywords_draft3.h"
67-
#include "linter/drop_non_array_keywords_draft4.h"
68-
#include "linter/drop_non_array_keywords_draft6.h"
69-
#include "linter/drop_non_array_keywords_draft7.h"
70-
#include "linter/drop_non_array_keywords_format_2019_09.h"
71-
#include "linter/drop_non_array_keywords_format_2020_12.h"
72-
#include "linter/drop_non_array_keywords_unevaluated_2020_12.h"
73-
#include "linter/drop_non_array_keywords_validation_2019_09.h"
74-
#include "linter/drop_non_array_keywords_validation_2020_12.h"
75-
#include "linter/drop_non_boolean_keywords_applicator_2019_09.h"
76-
#include "linter/drop_non_boolean_keywords_applicator_2020_12.h"
77-
#include "linter/drop_non_boolean_keywords_content_2019_09.h"
78-
#include "linter/drop_non_boolean_keywords_content_2020_12.h"
79-
#include "linter/drop_non_boolean_keywords_draft0.h"
80-
#include "linter/drop_non_boolean_keywords_draft1.h"
81-
#include "linter/drop_non_boolean_keywords_draft2.h"
82-
#include "linter/drop_non_boolean_keywords_draft3.h"
83-
#include "linter/drop_non_boolean_keywords_draft4.h"
84-
#include "linter/drop_non_boolean_keywords_draft6.h"
85-
#include "linter/drop_non_boolean_keywords_draft7.h"
86-
#include "linter/drop_non_boolean_keywords_format_2019_09.h"
87-
#include "linter/drop_non_boolean_keywords_format_2020_12.h"
88-
#include "linter/drop_non_boolean_keywords_unevaluated_2020_12.h"
89-
#include "linter/drop_non_boolean_keywords_validation_2019_09.h"
90-
#include "linter/drop_non_boolean_keywords_validation_2020_12.h"
91-
#include "linter/drop_non_null_keywords_applicator_2019_09.h"
92-
#include "linter/drop_non_null_keywords_applicator_2020_12.h"
93-
#include "linter/drop_non_null_keywords_content_2019_09.h"
94-
#include "linter/drop_non_null_keywords_content_2020_12.h"
95-
#include "linter/drop_non_null_keywords_draft0.h"
96-
#include "linter/drop_non_null_keywords_draft1.h"
97-
#include "linter/drop_non_null_keywords_draft2.h"
98-
#include "linter/drop_non_null_keywords_draft3.h"
99-
#include "linter/drop_non_null_keywords_draft4.h"
100-
#include "linter/drop_non_null_keywords_draft6.h"
101-
#include "linter/drop_non_null_keywords_draft7.h"
102-
#include "linter/drop_non_null_keywords_format_2019_09.h"
103-
#include "linter/drop_non_null_keywords_format_2020_12.h"
104-
#include "linter/drop_non_null_keywords_unevaluated_2020_12.h"
105-
#include "linter/drop_non_null_keywords_validation_2019_09.h"
106-
#include "linter/drop_non_null_keywords_validation_2020_12.h"
107-
#include "linter/drop_non_numeric_keywords_applicator_2019_09.h"
108-
#include "linter/drop_non_numeric_keywords_applicator_2020_12.h"
109-
#include "linter/drop_non_numeric_keywords_content_2019_09.h"
110-
#include "linter/drop_non_numeric_keywords_content_2020_12.h"
111-
#include "linter/drop_non_numeric_keywords_draft0.h"
112-
#include "linter/drop_non_numeric_keywords_draft1.h"
113-
#include "linter/drop_non_numeric_keywords_draft2.h"
114-
#include "linter/drop_non_numeric_keywords_draft3.h"
115-
#include "linter/drop_non_numeric_keywords_draft4.h"
116-
#include "linter/drop_non_numeric_keywords_draft6.h"
117-
#include "linter/drop_non_numeric_keywords_draft7.h"
118-
#include "linter/drop_non_numeric_keywords_format_2019_09.h"
119-
#include "linter/drop_non_numeric_keywords_format_2020_12.h"
120-
#include "linter/drop_non_numeric_keywords_unevaluated_2020_12.h"
121-
#include "linter/drop_non_numeric_keywords_validation_2019_09.h"
122-
#include "linter/drop_non_numeric_keywords_validation_2020_12.h"
123-
#include "linter/drop_non_object_keywords_applicator_2019_09.h"
124-
#include "linter/drop_non_object_keywords_applicator_2020_12.h"
125-
#include "linter/drop_non_object_keywords_content_2019_09.h"
126-
#include "linter/drop_non_object_keywords_content_2020_12.h"
127-
#include "linter/drop_non_object_keywords_draft0.h"
128-
#include "linter/drop_non_object_keywords_draft1.h"
129-
#include "linter/drop_non_object_keywords_draft2.h"
130-
#include "linter/drop_non_object_keywords_draft3.h"
131-
#include "linter/drop_non_object_keywords_draft4.h"
132-
#include "linter/drop_non_object_keywords_draft6.h"
133-
#include "linter/drop_non_object_keywords_draft7.h"
134-
#include "linter/drop_non_object_keywords_format_2019_09.h"
135-
#include "linter/drop_non_object_keywords_format_2020_12.h"
136-
#include "linter/drop_non_object_keywords_unevaluated_2020_12.h"
137-
#include "linter/drop_non_object_keywords_validation_2019_09.h"
138-
#include "linter/drop_non_object_keywords_validation_2020_12.h"
139-
#include "linter/drop_non_string_keywords_applicator_2019_09.h"
140-
#include "linter/drop_non_string_keywords_applicator_2020_12.h"
141-
#include "linter/drop_non_string_keywords_draft0.h"
142-
#include "linter/drop_non_string_keywords_draft1.h"
143-
#include "linter/drop_non_string_keywords_draft2.h"
144-
#include "linter/drop_non_string_keywords_draft3.h"
145-
#include "linter/drop_non_string_keywords_draft4.h"
146-
#include "linter/drop_non_string_keywords_draft6.h"
147-
#include "linter/drop_non_string_keywords_draft7.h"
148-
#include "linter/drop_non_string_keywords_unevaluated_2020_12.h"
149-
#include "linter/drop_non_string_keywords_validation_2019_09.h"
150-
#include "linter/drop_non_string_keywords_validation_2020_12.h"
15159
#include "linter/duplicate_allof_branches.h"
15260
#include "linter/duplicate_anyof_branches.h"
15361
#include "linter/duplicate_enum_values.h"
@@ -165,6 +73,7 @@ static auto every_item_is_boolean(const T &container) -> bool {
16573
#include "linter/maximum_real_for_integer.h"
16674
#include "linter/min_contains_without_contains.h"
16775
#include "linter/minimum_real_for_integer.h"
76+
#include "linter/non_applicable_type_specific_keywords.h"
16877
#include "linter/pattern_properties_default.h"
16978
#include "linter/properties_default.h"
17079
#include "linter/single_type_array.h"
@@ -184,98 +93,7 @@ auto add(SchemaTransformer &bundle, const AlterSchemaMode mode)
18493
// Common rules that apply to all modes
18594
bundle.add<ContentMediaTypeWithoutEncoding>();
18695
bundle.add<ContentSchemaWithoutMediaType>();
187-
bundle.add<DropNonArrayKeywordsApplicator_2019_09>();
188-
bundle.add<DropNonArrayKeywordsApplicator_2020_12>();
189-
bundle.add<DropNonArrayKeywordsContent_2019_09>();
190-
bundle.add<DropNonArrayKeywordsContent_2020_12>();
191-
bundle.add<DropNonArrayKeywords_Draft0>();
192-
bundle.add<DropNonArrayKeywords_Draft1>();
193-
bundle.add<DropNonArrayKeywords_Draft2>();
194-
bundle.add<DropNonArrayKeywords_Draft3>();
195-
bundle.add<DropNonArrayKeywords_Draft4>();
196-
bundle.add<DropNonArrayKeywords_Draft6>();
197-
bundle.add<DropNonArrayKeywords_Draft7>();
198-
bundle.add<DropNonArrayKeywordsFormat_2019_09>();
199-
bundle.add<DropNonArrayKeywordsFormat_2020_12>();
200-
bundle.add<DropNonArrayKeywordsUnevaluated_2020_12>();
201-
bundle.add<DropNonArrayKeywordsValidation_2019_09>();
202-
bundle.add<DropNonArrayKeywordsValidation_2020_12>();
203-
bundle.add<DropNonBooleanKeywordsApplicator_2019_09>();
204-
bundle.add<DropNonBooleanKeywordsApplicator_2020_12>();
205-
bundle.add<DropNonBooleanKeywordsContent_2019_09>();
206-
bundle.add<DropNonBooleanKeywordsContent_2020_12>();
207-
bundle.add<DropNonBooleanKeywords_Draft0>();
208-
bundle.add<DropNonBooleanKeywords_Draft1>();
209-
bundle.add<DropNonBooleanKeywords_Draft2>();
210-
bundle.add<DropNonBooleanKeywords_Draft3>();
211-
bundle.add<DropNonBooleanKeywords_Draft4>();
212-
bundle.add<DropNonBooleanKeywords_Draft6>();
213-
bundle.add<DropNonBooleanKeywords_Draft7>();
214-
bundle.add<DropNonBooleanKeywordsFormat_2019_09>();
215-
bundle.add<DropNonBooleanKeywordsFormat_2020_12>();
216-
bundle.add<DropNonBooleanKeywordsUnevaluated_2020_12>();
217-
bundle.add<DropNonBooleanKeywordsValidation_2019_09>();
218-
bundle.add<DropNonBooleanKeywordsValidation_2020_12>();
219-
bundle.add<DropNonNullKeywordsApplicator_2019_09>();
220-
bundle.add<DropNonNullKeywordsApplicator_2020_12>();
221-
bundle.add<DropNonNullKeywordsContent_2019_09>();
222-
bundle.add<DropNonNullKeywordsContent_2020_12>();
223-
bundle.add<DropNonNullKeywords_Draft0>();
224-
bundle.add<DropNonNullKeywords_Draft1>();
225-
bundle.add<DropNonNullKeywords_Draft2>();
226-
bundle.add<DropNonNullKeywords_Draft3>();
227-
bundle.add<DropNonNullKeywords_Draft4>();
228-
bundle.add<DropNonNullKeywords_Draft6>();
229-
bundle.add<DropNonNullKeywords_Draft7>();
230-
bundle.add<DropNonNullKeywordsFormat_2019_09>();
231-
bundle.add<DropNonNullKeywordsFormat_2020_12>();
232-
bundle.add<DropNonNullKeywordsUnevaluated_2020_12>();
233-
bundle.add<DropNonNullKeywordsValidation_2019_09>();
234-
bundle.add<DropNonNullKeywordsValidation_2020_12>();
235-
bundle.add<DropNonNumericKeywordsApplicator_2019_09>();
236-
bundle.add<DropNonNumericKeywordsApplicator_2020_12>();
237-
bundle.add<DropNonNumericKeywordsContent_2019_09>();
238-
bundle.add<DropNonNumericKeywordsContent_2020_12>();
239-
bundle.add<DropNonNumericKeywords_Draft0>();
240-
bundle.add<DropNonNumericKeywords_Draft1>();
241-
bundle.add<DropNonNumericKeywords_Draft2>();
242-
bundle.add<DropNonNumericKeywords_Draft3>();
243-
bundle.add<DropNonNumericKeywords_Draft4>();
244-
bundle.add<DropNonNumericKeywords_Draft6>();
245-
bundle.add<DropNonNumericKeywords_Draft7>();
246-
bundle.add<DropNonNumericKeywordsFormat_2019_09>();
247-
bundle.add<DropNonNumericKeywordsFormat_2020_12>();
248-
bundle.add<DropNonNumericKeywordsUnevaluated_2020_12>();
249-
bundle.add<DropNonNumericKeywordsValidation_2019_09>();
250-
bundle.add<DropNonNumericKeywordsValidation_2020_12>();
251-
bundle.add<DropNonObjectKeywordsApplicator_2019_09>();
252-
bundle.add<DropNonObjectKeywordsApplicator_2020_12>();
253-
bundle.add<DropNonObjectKeywordsContent_2019_09>();
254-
bundle.add<DropNonObjectKeywordsContent_2020_12>();
255-
bundle.add<DropNonObjectKeywords_Draft0>();
256-
bundle.add<DropNonObjectKeywords_Draft1>();
257-
bundle.add<DropNonObjectKeywords_Draft2>();
258-
bundle.add<DropNonObjectKeywords_Draft3>();
259-
bundle.add<DropNonObjectKeywords_Draft4>();
260-
bundle.add<DropNonObjectKeywords_Draft6>();
261-
bundle.add<DropNonObjectKeywords_Draft7>();
262-
bundle.add<DropNonObjectKeywordsFormat_2019_09>();
263-
bundle.add<DropNonObjectKeywordsFormat_2020_12>();
264-
bundle.add<DropNonObjectKeywordsUnevaluated_2020_12>();
265-
bundle.add<DropNonObjectKeywordsValidation_2019_09>();
266-
bundle.add<DropNonObjectKeywordsValidation_2020_12>();
267-
bundle.add<DropNonStringKeywordsApplicator_2019_09>();
268-
bundle.add<DropNonStringKeywordsApplicator_2020_12>();
269-
bundle.add<DropNonStringKeywords_Draft0>();
270-
bundle.add<DropNonStringKeywords_Draft1>();
271-
bundle.add<DropNonStringKeywords_Draft2>();
272-
bundle.add<DropNonStringKeywords_Draft3>();
273-
bundle.add<DropNonStringKeywords_Draft4>();
274-
bundle.add<DropNonStringKeywords_Draft6>();
275-
bundle.add<DropNonStringKeywords_Draft7>();
276-
bundle.add<DropNonStringKeywordsUnevaluated_2020_12>();
277-
bundle.add<DropNonStringKeywordsValidation_2019_09>();
278-
bundle.add<DropNonStringKeywordsValidation_2020_12>();
96+
bundle.add<NonApplicableTypeSpecificKeywords>();
27997
bundle.add<UnnecessaryAllOfRefWrapper>();
28098
bundle.add<DuplicateAllOfBranches>();
28199
bundle.add<DuplicateAnyOfBranches>();

src/extension/alterschema/linter/drop_non_array_keywords_applicator_2019_09.h

Lines changed: 0 additions & 37 deletions
This file was deleted.

src/extension/alterschema/linter/drop_non_array_keywords_applicator_2020_12.h

Lines changed: 0 additions & 37 deletions
This file was deleted.

0 commit comments

Comments
 (0)