File tree Expand file tree Collapse file tree 5 files changed +47
-0
lines changed
Expand file tree Collapse file tree 5 files changed +47
-0
lines changed Original file line number Diff line number Diff line change @@ -71,6 +71,11 @@ Defaults to `MYMETA.json MYMETA.yml META.json META.yml Makefile _build/params cp
7171
7272A list of regular expressions of prerequisites to exclude. One pattern per line.
7373
74+ # ## `omit-core`
75+
76+ A boolean value to exclude core only modules from the output. Enabled by
77+ default.
78+
7479# # Outputs
7580
7681# ## `perl`
Original file line number Diff line number Diff line change @@ -29,6 +29,10 @@ inputs:
2929 description : ' Include prerequisites from all sources rather than only the first'
3030 required : false
3131 default : false
32+ omit-core :
33+ description : ' Omit core-only prerequisites'
34+ required : false
35+ default : true
3236
3337outputs :
3438 perl :
Original file line number Diff line number Diff line change @@ -21,6 +21,7 @@ export const run = async (argv) => {
2121 boolean : [
2222 'perl' ,
2323 'allSources' ,
24+ 'omitCore' ,
2425 ] ,
2526 string : [
2627 'phases' ,
@@ -35,6 +36,7 @@ export const run = async (argv) => {
3536 features : 'feature' ,
3637 sources : 'source' ,
3738 allSources : [ 'all-sources' , 'all' ] ,
39+ omitCore : [ 'omit-core' ] ,
3840 } ,
3941 } ) ,
4042 ) . map ( ( [ k , v ] ) => {
Original file line number Diff line number Diff line change @@ -40,6 +40,35 @@ const parsers = [
4040 [ / M a k e f i l e .P L $ / i, parseMakefilePL ] ,
4141] ;
4242
43+ const coreModules = [
44+ 'B' ,
45+ 'B::Deparse' ,
46+ 'Config' ,
47+ 'DynaLoader' ,
48+ 'English' ,
49+ 'POSIX' ,
50+ 'Symbol' ,
51+ 'UNIVERSAL' ,
52+ 'blib' ,
53+ 'bytes' ,
54+ 'charnames' ,
55+ 'deprecate' ,
56+ 'feature' ,
57+ 'integer' ,
58+ 'lib' ,
59+ 'open' ,
60+ 'overload' ,
61+ 'overloading' ,
62+ 're' ,
63+ 'sort' ,
64+ 'strict' ,
65+ 'utf8' ,
66+ 'vars' ,
67+ 'warnings' ,
68+ ] ;
69+
70+ const coreMatch = new RegExp ( `^(?:${ coreModules . join ( '|' ) } )$` ) ;
71+
4372const parserFor = ( file ) => {
4473 for ( const [ pattern , parser ] of parsers ) {
4574 if ( file . match ( pattern ) ) {
@@ -74,9 +103,14 @@ export const getPrereqs = async ({
74103 ] ,
75104 excludes = [ ] ,
76105 allSources = false ,
106+ omitCore = true ,
77107} ) => {
78108 const prereqs = { } ;
79109
110+ if ( omitCore ) {
111+ excludes = [ ...excludes , coreMatch ] ;
112+ }
113+
80114 for ( const source of sources ) {
81115 const parser = parserFor ( source ) ;
82116
Original file line number Diff line number Diff line change @@ -9,6 +9,7 @@ export const run = async () => {
99 const sourcesInput = core . getInput ( 'sources' ) ;
1010 const excludeInput = core . getMultilineInput ( 'exclude' ) ;
1111 const allSources = core . getBooleanInput ( 'all-sources' ) ;
12+ const omitCore = core . getBooleanInput ( 'omit-core' ) ;
1213
1314 const phases = new Set ( phasesInput . split ( / \s + / ) ) ;
1415 const relationships = new Set ( relationshipsInput . split ( / \s + / ) ) ;
@@ -23,6 +24,7 @@ export const run = async () => {
2324 sources,
2425 excludes,
2526 allSources,
27+ omitCore,
2628 } ) ;
2729
2830 if ( perl ) {
You can’t perform that action at this time.
0 commit comments