@@ -22,12 +22,12 @@ const defaultReport = ["now3cjson", "inconsistengroups", "invalidw3cjson", "inco
22
22
23
23
// from https://stackoverflow.com/questions/10970078/modifying-a-query-string-without-reloading-the-page
24
24
function insertUrlParam ( key , value ) {
25
- if ( history . pushState ) {
26
- let searchParams = new URLSearchParams ( window . location . search ) ;
27
- searchParams . set ( key , value ) ;
28
- let newurl = window . location . protocol + "//" + window . location . host + window . location . pathname + '?' + searchParams . toString ( ) ;
29
- window . history . pushState ( { path : newurl } , '' , newurl ) ;
30
- }
25
+ if ( history . pushState ) {
26
+ let searchParams = new URLSearchParams ( window . location . search ) ;
27
+ searchParams . set ( key , value ) ;
28
+ let newurl = window . location . protocol + "//" + window . location . host + window . location . pathname + '?' + searchParams . toString ( ) ;
29
+ window . history . pushState ( { path : newurl } , '' , newurl ) ;
30
+ }
31
31
}
32
32
33
33
// from https://stackoverflow.com/a/5158301
@@ -96,59 +96,59 @@ function writeReport() {
96
96
const stats = document . createElement ( 'p' ) ;
97
97
stats . textContent = `${ data . repos . filter ( r => r . owner . login === 'w3c' && ! r . isArchived ) . length } active repos in the w3c github organization; overall, ${ Object . values ( data . groups ) . filter ( g => g . type === 'working group' ) . reduce ( ( acc , g ) => acc + g . repos . length , 0 ) } known repos associated with Working Groups, ${ Object . values ( data . groups ) . filter ( g => g . type === 'community group' ) . reduce ( ( acc , g ) => acc + g . repos . length , 0 ) } associated with Community Groups` ;
98
98
report . appendChild ( stats ) ;
99
- const groups = data . groups ;
100
- Object . keys ( groups ) . sort ( ( a , b ) => groups [ a ] . name . localeCompare ( groups [ b ] . name ) )
101
- . forEach ( groupId => {
102
- const section = document . createElement ( 'section' ) ;
103
- const title = document . createElement ( 'h2' ) ;
104
- title . appendChild ( document . createTextNode ( groups [ groupId ] . name ) ) ;
105
- if ( groupFilter ( groupId ) )
106
- section . appendChild ( title ) ;
107
- if ( groups [ groupId ] . type === "working group" && ! groups [ groupId ] . repos . some ( r => r . hasRecTrack ) ) {
108
- const p = document . createElement ( 'p' ) ;
109
- p . appendChild ( document . createTextNode ( 'No identified repo for rec-track spec.' ) ) ;
110
- section . appendChild ( p ) ;
111
- }
112
- if ( groups [ groupId ] . repos . length ) {
113
- Object . keys ( errortypes ) . filter ( t => errorFilter . size === 0 || errorFilter . has ( t ) )
114
- . forEach ( err => {
115
- const repos = data . errors [ err ] . filter ( r => groups [ groupId ] . repos . find ( x => x . fullName === r || x . fullName === r . repo ) ) ;
116
- if ( repos . length ) {
117
- const errsection = document . createElement ( 'section' ) ;
118
- const errtitle = document . createElement ( 'h3' ) ;
119
- errtitle . appendChild ( document . createTextNode ( errortypes [ err ] ) ) ;
120
- errsection . appendChild ( errtitle ) ;
121
-
122
- const list = document . createElement ( 'ul' ) ;
123
- repos . forEach ( repo => {
124
- const repoName = typeof repo === "string" ? repo : repo . repo ;
125
- mentionedRepos . add ( repoName ) ;
126
- writeErrorEntry ( repoName , list , repo . error ) ;
127
-
128
- } ) ;
129
- errsection . appendChild ( list ) ;
130
- if ( groupFilter ( groupId ) )
131
- section . appendChild ( errsection ) ;
132
- }
133
- } ) ;
134
- }
135
- report . appendChild ( section ) ;
136
- } ) ;
137
- const section = document . createElement ( 'section' ) ;
138
- const title = document . createElement ( 'h2' ) ;
139
- title . appendChild ( document . createTextNode ( "No w3c.json" ) ) ;
140
- section . appendChild ( title ) ;
141
- const ul = document . createElement ( 'ul' ) ;
142
- data . errors . incompletew3cjson
143
- . filter ( x => x . error === "group" )
144
- . forEach ( x => writeErrorEntry ( x . repo , ul , "missing group in w3c.json" ) ) ;
145
- data . errors . illformedw3cjson
146
- . forEach ( x => writeErrorEntry ( x , ul , "ill-formed JSON" ) ) ;
147
- data . errors . now3cjson
148
- . filter ( x => x . startsWith ( 'w3c/' ) || x . startsWith ( 'WICG' ) || x . startsWith ( 'WebAudio' ) )
149
- . filter ( x => ! mentionedRepos . has ( x ) )
150
- . forEach ( x => writeErrorEntry ( x , ul , "no w3c.json" ) ) ;
151
- section . appendChild ( ul ) ;
152
- report . appendChild ( section ) ;
99
+ const groups = data . groups ;
100
+ Object . keys ( groups ) . sort ( ( a , b ) => groups [ a ] . name . localeCompare ( groups [ b ] . name ) )
101
+ . forEach ( groupId => {
102
+ const section = document . createElement ( 'section' ) ;
103
+ const title = document . createElement ( 'h2' ) ;
104
+ title . appendChild ( document . createTextNode ( groups [ groupId ] . name ) ) ;
105
+ if ( groupFilter ( groupId ) )
106
+ section . appendChild ( title ) ;
107
+ if ( groups [ groupId ] . type === "working group" && ! groups [ groupId ] . repos . some ( r => r . hasRecTrack ) ) {
108
+ const p = document . createElement ( 'p' ) ;
109
+ p . appendChild ( document . createTextNode ( 'No identified repo for rec-track spec.' ) ) ;
110
+ section . appendChild ( p ) ;
111
+ }
112
+ if ( groups [ groupId ] . repos . length ) {
113
+ Object . keys ( errortypes ) . filter ( t => errorFilter . size === 0 || errorFilter . has ( t ) )
114
+ . forEach ( err => {
115
+ const repos = data . errors [ err ] . filter ( r => groups [ groupId ] . repos . find ( x => x . fullName === r || x . fullName === r . repo ) ) ;
116
+ if ( repos . length ) {
117
+ const errsection = document . createElement ( 'section' ) ;
118
+ const errtitle = document . createElement ( 'h3' ) ;
119
+ errtitle . appendChild ( document . createTextNode ( errortypes [ err ] ) ) ;
120
+ errsection . appendChild ( errtitle ) ;
121
+
122
+ const list = document . createElement ( 'ul' ) ;
123
+ repos . forEach ( repo => {
124
+ const repoName = typeof repo === "string" ? repo : repo . repo ;
125
+ mentionedRepos . add ( repoName ) ;
126
+ writeErrorEntry ( repoName , list , repo . error ) ;
127
+
128
+ } ) ;
129
+ errsection . appendChild ( list ) ;
130
+ if ( groupFilter ( groupId ) )
131
+ section . appendChild ( errsection ) ;
132
+ }
133
+ } ) ;
134
+ }
135
+ report . appendChild ( section ) ;
136
+ } ) ;
137
+ const section = document . createElement ( 'section' ) ;
138
+ const title = document . createElement ( 'h2' ) ;
139
+ title . appendChild ( document . createTextNode ( "No w3c.json" ) ) ;
140
+ section . appendChild ( title ) ;
141
+ const ul = document . createElement ( 'ul' ) ;
142
+ data . errors . incompletew3cjson
143
+ . filter ( x => x . error === "group" )
144
+ . forEach ( x => writeErrorEntry ( x . repo , ul , "missing group in w3c.json" ) ) ;
145
+ data . errors . illformedw3cjson
146
+ . forEach ( x => writeErrorEntry ( x , ul , "ill-formed JSON" ) ) ;
147
+ data . errors . now3cjson
148
+ . filter ( x => x . startsWith ( 'w3c/' ) || x . startsWith ( 'WICG' ) || x . startsWith ( 'WebAudio' ) )
149
+ . filter ( x => ! mentionedRepos . has ( x ) )
150
+ . forEach ( x => writeErrorEntry ( x , ul , "no w3c.json" ) ) ;
151
+ section . appendChild ( ul ) ;
152
+ report . appendChild ( section ) ;
153
153
}
154
154
0 commit comments