-
-
Notifications
You must be signed in to change notification settings - Fork 114
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
feat: delta analysis scoped by source parameter #174
feat: delta analysis scoped by source parameter #174
Conversation
src/main.js
Outdated
@@ -29,6 +29,12 @@ const checkConfig = (config, repoSetup) => { | |||
) { | |||
errors.push(`${config.output} folder does not exist`) | |||
} | |||
if ( |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Similar blocks of code found in 2 locations. Consider refactoring.
src/main.js
Outdated
) { | ||
errors.push(`${config.output} folder does not exist`) | ||
} | ||
this.chkIfDirExist(config.output); |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Delete ;
src/main.js
Outdated
errors.push(`${config.output} folder does not exist`) | ||
} | ||
this.chkIfDirExist(config.output); | ||
this.chkIfDirExist(config.source); |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Delete ;
src/main.js
Outdated
@@ -43,10 +39,20 @@ const checkConfig = (config, repoSetup) => { | |||
return errors | |||
} | |||
|
|||
function chkIfDirExist(Dir){ |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
'chkIfDirExist' is defined but never used.
src/main.js
Outdated
@@ -43,10 +39,20 @@ const checkConfig = (config, repoSetup) => { | |||
return errors | |||
} | |||
|
|||
function chkIfDirExist(Dir){ |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Insert ·
src/main.js
Outdated
@@ -43,10 +39,20 @@ const checkConfig = (config, repoSetup) => { | |||
return errors | |||
} | |||
|
|||
function chkIfDirExist(Dir){ | |||
if ( |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Replace ⏎····!fs.existsSync(Dir)·||⏎····!fs.statSync(Dir).isDirectory()⏎··
with !fs.existsSync(Dir)·||·!fs.statSync(Dir).isDirectory()
src/main.js
Outdated
if (!repoSetup.isToEqualHead() && config.generateDelta) { | ||
errors.push( | ||
`--generate-delta (-d) parameter cannot be used when --to (-t) parameter is not equivalent to HEAD` | ||
) | ||
errors=chkIfDirExist(config.output, errors) |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Replace errors=
with ··errors·=·
src/main.js
Outdated
if (!repoSetup.isToEqualHead() && config.generateDelta) { | ||
errors.push( | ||
`--generate-delta (-d) parameter cannot be used when --to (-t) parameter is not equivalent to HEAD` | ||
) | ||
errors=chkIfDirExist(config.output, errors) |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
'errors' is constant.
src/main.js
Outdated
if (!repoSetup.isToEqualHead() && config.generateDelta) { | ||
errors.push( | ||
`--generate-delta (-d) parameter cannot be used when --to (-t) parameter is not equivalent to HEAD` | ||
) | ||
errors=chkIfDirExist(config.output, errors) | ||
errors=chkIfDirExist(config.source, errors) |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Replace ··errors=
with ····errors·=·
src/main.js
Outdated
if (!repoSetup.isToEqualHead() && config.generateDelta) { | ||
errors.push( | ||
`--generate-delta (-d) parameter cannot be used when --to (-t) parameter is not equivalent to HEAD` | ||
) | ||
errors=chkIfDirExist(config.output, errors) | ||
errors=chkIfDirExist(config.source, errors) |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
'errors' is constant.
src/main.js
Outdated
} | ||
|
||
return errors | ||
} | ||
|
||
function chkIfDirExist(dir,errors){ |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Replace errors)
with ·errors)·
Thanks for this contribution ! That is great. Could you give me access to your fork please ? So I can add commits to the PR |
Hi @scolladon , I have added you as a contributor to my fork, Please use Sudhanshu/AddModularSupport branch for changes. Thanks |
49ead89
to
1f419a9
Compare
Codecov Report
@@ Coverage Diff @@
## master #174 +/- ##
=======================================
Coverage 99.77% 99.77%
=======================================
Files 18 19 +1
Lines 440 450 +10
=======================================
+ Hits 439 449 +10
Misses 1 1
Continue to review full report at Codecov.
|
1f419a9
to
a1f8f41
Compare
FYI: PR Lint issue is false positive Issue is related to GITHUB_TOKEN not accessible because PR is created from a fork (cf known issue) |
Code Climate has analyzed commit 90b0eb6 and detected 0 issues on this pull request. View more on Code Climate. |
What does this pull request contains
This pull request contains code modification so that the delta can be generated for a particular module or type of metadata, such as delta only for classes/lwc/etc.
It is complementary to '--ignore' and '--ignore-destructive' and works with it
Use same message for both legacy cli and sfdx plugin
Default output folder is now '.'. See "Explain you changes" and "README.md" changesExplain your changes
--source
option added in CLI to select or pass the folder path only to be taken into consideration while generating Delta, by default whole folder is taken into consideration (no change to existing functionality).2. /!\ breaking change /!\ output default folder is now '.' (instead of 'output'). It will be taken automatically when not specified, except if delta generation ('-d') is also passed. In this case an error will be thrown because it would override the current repository with the delta generation file (To be discussed)Does this close any currently open issues?
Closes #168
Any particular element to being able to test locally
-o has now a new default => check your integration !-s newly added can focus the command to sub folder (see README.md changes)
Any other comments?
Where has this been tested?
on Windows, Azure DevOps Pipeline, Mac
Operating System: WINDOWS 10 21H1
**yarn version:**1.22.11
**node version:**14.17.3
**git version:**2.31.0.windows.1
**sfdx version:**7.110.0
**sgd plugin version:**4.7.2