Skip to content

Commit eaaeb8a

Browse files
Merge branch 'development'
2 parents 8eb2d09 + b514879 commit eaaeb8a

File tree

3 files changed

+22
-19
lines changed

3 files changed

+22
-19
lines changed

index.js

Lines changed: 20 additions & 17 deletions
Original file line numberDiff line numberDiff line change
@@ -48,32 +48,35 @@ program.on( "--help", function() {
4848
// Parse the command line parameters.
4949
program.parse( process.argv );
5050

51+
// Get the specified options.
52+
const options = program.opts();
53+
5154
// Check for required input path option.
5255
// If missing assume current working directory.
53-
if ( typeof( program.input ) === "undefined" ) {
54-
program.input = process.cwd();
56+
if ( typeof( options.input ) === "undefined" ) {
57+
options.input = process.cwd();
5558
}
5659

5760
// Output some useful information.
5861
log( chalk.bold( "RPA Lint - " + appPackage.version ) );
5962

6063
// Resolve a relative path if required.
61-
if ( !path.isAbsolute( program.input ) ) {
62-
program.input = path.resolve( process.cwd().toString(), program.input );
64+
if ( !path.isAbsolute( options.input ) ) {
65+
options.input = path.resolve( process.cwd().toString(), options.input );
6366
} else {
6467

6568
// Normalise the path for sanity.
66-
program.input = path.normalize( program.input );
69+
options.input = path.normalize( options.input );
6770
}
6871

6972
// Get a list of files to process.
70-
if ( program.recursive === true ) {
73+
if ( options.recursive === true ) {
7174
log( "INFO: Searching recursively for XAML files" );
7275
}
7376

7477
let xamlFiles = StyleRuleFactory.getXamlFileList(
75-
program.input,
76-
program.recursive
78+
options.input,
79+
options.recursive
7780
);
7881

7982
// Check to make sure XAML files were found.
@@ -83,15 +86,15 @@ if ( xamlFiles.length === 0 ) {
8386
}
8487

8588
// Get some information about the project.
86-
const projectInfo = new UiPathProject( program.input );
89+
const projectInfo = new UiPathProject( options.input );
8790

8891
log( "INFO: Project name: %s", projectInfo.getName() );
8992
log( "INFO: Project version: %s", projectInfo.getVersion() );
9093

9194
// Output some additional information.
92-
log( "INFO: Found %d files in %s", xamlFiles.length, program.input );
95+
log( "INFO: Found %d files in %s", xamlFiles.length, options.input );
9396

94-
if ( program.quiet === true ) {
97+
if ( options.quiet === true ) {
9598
log( warn( "WARN:" ) + " Warning messages are being suppressed" );
9699
}
97100

@@ -111,7 +114,7 @@ let libraryStyleRules = [];
111114
let libraryPublicWorkflows = [];
112115

113116
// Build a list of library specific style rules if required.
114-
if ( projectInfo.isLibrary() === false && program.includePrivate === true ) {
117+
if ( projectInfo.isLibrary() === false && options.includePrivate === true ) {
115118
log( warn( "WARN: " ) + "--include-private option is only applicable to library projects" );
116119
}
117120

@@ -129,7 +132,7 @@ if ( projectInfo.isLibrary() ) {
129132
);
130133

131134
// Filter out private workflows if required.
132-
if ( program.includePrivate !== true ) {
135+
if ( options.includePrivate !== true ) {
133136
log( "INFO: Ignoring private workflows." );
134137
xamlFiles = StyleRuleFactory.filterPublicWorkflows(
135138
xamlFiles,
@@ -186,7 +189,7 @@ xamlFiles.forEach( function( file ) {
186189
} );
187190

188191
// Suppress warnings if required.
189-
if ( program.quiet === true ) {
192+
if ( options.quiet === true ) {
190193

191194
// Check to see if only warnings have been found.
192195
if ( haveErrors === false && haveIssues === true ) {
@@ -197,9 +200,9 @@ if ( program.quiet === true ) {
197200
}
198201

199202
// Filter the results list if required.
200-
if ( program.filter !== undefined ) {
203+
if ( options.filter !== undefined ) {
201204
log( warn( "WARN: " ) + "Results are filtered." );
202-
results = StyleRuleFactory.filterResults( results, program.filter );
205+
results = StyleRuleFactory.filterResults( results, options.filter );
203206

204207
if ( results.size === 0 ) {
205208
haveIssues = false;
@@ -232,7 +235,7 @@ if ( haveIssues ) {
232235
}
233236

234237
// Check the UiPath project dependencies if required.
235-
if ( program.depCheck ) {
238+
if ( options.depCheck ) {
236239
console.log( "INFO: Checking UiPath project dependencies. This will take some time..." );
237240

238241
let depCheck = new NoOutdatedProjectDependencies( projectInfo );

package-lock.json

Lines changed: 1 addition & 1 deletion
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

package.json

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
{
22
"name": "rpa-lint",
3-
"version": "1.4.1",
3+
"version": "1.4.2",
44
"description": "A CLI app to lint UiPath projects against rules developed by the Flinders RPA team",
55
"homepage": "https://github.com/flindersuni/rpa-lint/#readme",
66
"bugs": {

0 commit comments

Comments
 (0)