FazBrowse GitHub Viewer
|
Trending
|
URL:
|
Home
Tools:
[Download Repo ZIP]
[View Raw Code]
[Original HTTPS Page]
codeql/config/blame-deprecations.mjs at codeql-cli/v2.26.0 · github/codeql · GitHub
Uh oh!
There was an error while loading.
Please reload this page
.
github
/
codeql
Public
Notifications
You must be signed in to change notification settings
Fork
2.1k
Star
10k
Code
Issues
996
Pull requests
467
Discussions
Actions
Projects
Security and quality
0
Insights
Additional navigation options
Code
Issues
Pull requests
Discussions
Actions
Projects
Security and quality
Insights
Expand file tree
Breadcrumbs
codeql
/
config
/
blame-deprecations.mjs
Copy path
More file actions
More file actions
Latest commit
History
History
History
58 lines (55 loc) · 1.78 KB
Breadcrumbs
codeql
/
config
/
blame-deprecations.mjs
Copy path
File metadata and controls
58 lines (55 loc) · 1.78 KB
Raw
Copy raw file
Download raw file
Open symbols panel
Edit and raw actions
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
import
fs
from
"fs"
;
import
path
from
"path"
;
import
cp
from
"child_process"
;
function
*
walk
(
dir
)
{
for
(
const
file
of
fs
.
readdirSync
(
dir
)
)
{
const
filePath
=
path
.
join
(
dir
,
file
)
;
if
(
fs
.
statSync
(
filePath
)
.
isDirectory
(
)
)
{
yield
*
walk
(
filePath
)
;
}
else
{
yield
filePath
;
}
}
}
function
*
deprecatedFiles
(
dir
)
{
for
(
const
file
of
walk
(
dir
)
)
{
if
(
file
.
endsWith
(
".ql"
)
||
file
.
endsWith
(
".qll"
)
)
{
const
contents
=
fs
.
readFileSync
(
file
,
"utf8"
)
;
if
(
/
\s
d
e
p
r
e
c
a
t
e
d
\s
/
.
test
(
contents
)
)
{
yield
file
;
}
}
}
}
const
blameRegExp
=
/
^
(
\^
?
\w
+
)
\s
.
+
\s
+
(
\d
{
4
}
-
\d
{
2
}
-
\d
{
2
}
\d
{
2
}
:
\d
{
2
}
:
\d
{
2
}
(?:
\+
|
-
)
\d
{
4
}
)
\s
+
(
\d
+
)
\)
.
*
$
/
;
function
*
deprecationMessages
(
dir
)
{
for
(
const
file
of
deprecatedFiles
(
dir
)
)
{
const
blame
=
cp
.
execFileSync
(
"git"
,
[
"blame"
,
"--"
,
file
]
)
;
const
lines
=
blame
.
toString
(
)
.
split
(
"\n"
)
;
for
(
let
i
=
0
;
i
<
lines
.
length
;
i
++
)
{
const
line
=
lines
[
i
]
;
if
(
line
.
includes
(
" deprecated "
)
)
{
try
{
const
[
_
,
sha
,
time
,
lineNumber
]
=
line
.
match
(
blameRegExp
)
;
const
date
=
new
Date
(
time
)
;
// check if it's within the last 14 months (a year, plus 2 months for safety, in case a PR was delayed)
if
(
date
.
getTime
(
)
>=
Date
.
now
(
)
-
14
*
31
*
24
*
60
*
60
*
1000
)
{
continue
;
}
const
message
=
`
${
file
}
:
${
lineNumber
}
was last updated on
${
date
.
getFullYear
(
)
}
-
${
date
.
getMonth
(
)
}
-
${
date
.
getDate
(
)
}
`
;
yield
[
message
,
date
]
;
}
catch
(
e
)
{
console
.
log
(
e
)
;
console
.
log
(
"----"
)
;
console
.
log
(
line
)
;
console
.
log
(
"----"
)
;
process
.
exit
(
0
)
;
}
}
}
}
}
[
...
deprecationMessages
(
"."
)
]
.
sort
(
(
a
,
b
)
=>
a
[
1
]
.
getTime
(
)
-
b
[
1
]
.
getTime
(
)
)
.
forEach
(
(
msg
)
=>
console
.
log
(
msg
[
0
]
)
)
;
Back
|
FazBrowse Home
|
New Git URL