@@ -53,12 +53,16 @@ const readMetadata = async (filePath: string): Promise<Record<string, any>> => {
53
53
}
54
54
} ;
55
55
56
- const isValidMetadata = ( metadata : Record < string , any > ) : boolean =>
56
+ const isValidMetadata = (
57
+ metadata : Record < string , any > ,
58
+ filePath : string ,
59
+ ) : boolean =>
57
60
metadata . title &&
58
61
metadata . description &&
59
- metadata . title != metadata . description &&
60
- metadata . description . length <= 160 &&
61
- metadata . description . length >= 50 ;
62
+ ( isApi ( filePath ) ||
63
+ ( metadata . title != metadata . description &&
64
+ metadata . description . length <= 160 &&
65
+ metadata . description . length >= 50 ) ) ;
62
66
63
67
const main = async ( ) : Promise < void > => {
64
68
const args = readArgs ( ) ;
@@ -67,15 +71,15 @@ const main = async (): Promise<void> => {
67
71
const mdErrors = [ ] ;
68
72
for ( const file of mdFiles ) {
69
73
const metadata = await readMetadata ( file ) ;
70
- if ( ! isValidMetadata ( metadata ) ) {
74
+ if ( ! isValidMetadata ( metadata , file ) ) {
71
75
mdErrors . push ( file ) ;
72
76
}
73
77
}
74
78
75
79
const notebookErrors = [ ] ;
76
80
for ( const file of notebookFiles ) {
77
81
const metadata = await readMetadata ( file ) ;
78
- if ( ! isValidMetadata ( metadata ) ) {
82
+ if ( ! isValidMetadata ( metadata , file ) ) {
79
83
notebookErrors . push ( file ) ;
80
84
}
81
85
}
@@ -99,6 +103,14 @@ async function determineFiles(args: Arguments): Promise<[string[], string[]]> {
99
103
return [ await globby ( mdGlobs ) , await globby ( notebookGlobs ) ] ;
100
104
}
101
105
106
+ function isApi ( filePath : string ) : boolean {
107
+ return (
108
+ filePath . includes ( "/api/qiskit/" ) ||
109
+ filePath . includes ( "/api/qiskit-ibm-runtime/" ) ||
110
+ filePath . includes ( "/api/qiskit-ibm-provider/" )
111
+ ) ;
112
+ }
113
+
102
114
function handleErrors ( mdErrors : string [ ] , notebookErrors : string [ ] ) : void {
103
115
if ( mdErrors . length > 0 ) {
104
116
console . error ( `
0 commit comments