-
Notifications
You must be signed in to change notification settings - Fork 39
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Implement 'meaningful' checks to
.js
(#112)
Implement 'meaningful' checks to `.js` Part of #110 ## Ignore Override Warning ``` | IGNR | Override (phtml/js/html) | vendor/ampersand/upgrade-patch-helper-test-module/src/theme/Magento_Checkout/web/js/ignore.js | app/design/frontend/Ampersand/theme/Magento_Checkout/web/js/ignore.js | ``` In this case `vendor/ampersand/upgrade-patch-helper-test-module/src/theme/Magento_Checkout/web/js/ignore.js` was updated with some whitespace/comment/etc so its not really changed, so don't bother reporting on it. The `IGNR` entries are suppressed without `--show-ignore` ## Redundant override ``` | WARN | Redundant Override | vendor/ampersand/upgrade-patch-helper-test-module/src/theme/Magento_Checkout/web/js/redundant.js | app/design/frontend/Ampersand/theme/Magento_Checkout/web/js/redundant.js | ``` In this case `vendor/ampersand/upgrade-patch-helper-test-module/src/theme/Magento_Checkout/web/js/redundant.js` has been updated and is now equivalent (excluding some whitespace/comments) to `app/design/frontend/Ampersand/theme/Magento_Checkout/web/js/redundant.js` The `app/design` override is now redundant and not necessary ## Additional test case changes The additional test cases needed updated as this file is being ignored, due to the fact its only a comment / whitespace from magento/magento2@1697149 Previously a human would have had to look at the change and work it out themselves, now its not reported. ```diff diff -ur -N vendor_orig/magento/module-vault/view/frontend/web/js/view/payment/vault.js vendor/magento/module-vault/view/frontend/web/js/view/payment/vault.js --- vendor_orig/magento/module-vault/view/frontend/web/js/view/payment/vault.js 2020-04-13 17:35:44.000000000 +0000 +++ vendor/magento/module-vault/view/frontend/web/js/view/payment/vault.js 2023-06-07 19:25:10.000000000 +0000 @@ -3,7 +3,7 @@ * See COPYING.txt for license details. */ /*browser:true*/ -/*global define*/ + /* @api */ define([ 'underscore', ``` And these files are being flagged as redundant, because `vendor/paypal/module-braintree-core/view/base/web/js/form-builder.js` has been edited/changed and is now the same as `vendor/paypal/module-braintree-core/view/frontend/web/js/form-builder.js` ``` e676f80e153b2a8e55da763f237cabf4 vendor/paypal/module-braintree-core/view/base/web/js/form-builder.js e676f80e153b2a8e55da763f237cabf4 vendor/paypal/module-braintree-core/view/frontend/web/js/form-builder.js ```
- Loading branch information
1 parent
fe63dc1
commit 7c6bb63
Showing
16 changed files
with
182 additions
and
22 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
33 changes: 33 additions & 0 deletions
33
dev/TestModule/app/design/frontend/Ampersand/theme/Magento_Checkout/web/js/ignore.js
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,33 @@ | ||
/** | ||
* Some copyright header. | ||
* Goes here | ||
* | ||
* | ||
* foobar | ||
*/ | ||
define([ | ||
'abc123' | ||
], function (resolver) { | ||
'use strict'; | ||
|
||
/** | ||
* Some function comment. | ||
* | ||
* @param {Object} config - Optional configuration | ||
*/ | ||
function the_function_names_are_different(config) { | ||
// this has been overridden and the function is different now | ||
var foo = 1; | ||
} | ||
|
||
/** | ||
* Some other function comment | ||
* | ||
* @param {Object} config - Optional configuration | ||
*/ | ||
function init(config) { | ||
resolver(the_function_names_are_different.bind(config)); | ||
} | ||
|
||
return init; | ||
}); |
40 changes: 40 additions & 0 deletions
40
dev/TestModule/app/design/frontend/Ampersand/theme/Magento_Checkout/web/js/redundant.js
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,40 @@ | ||
/** | ||
* Some copyright header. | ||
* Goes here | ||
*/ | ||
define([ | ||
'abc123' | ||
], function (resolver) { | ||
'use strict'; | ||
|
||
/** | ||
* Some function comment. | ||
* | ||
* @param {Object} config - Optional configuration | ||
*/ | ||
function foobar(config) { | ||
var foo = 1; | ||
} | ||
|
||
|
||
/** | ||
* what comments // do we have here | ||
* /* | ||
* | ||
* oh what comments are here | ||
* / | ||
*/ | ||
|
||
|
||
/** | ||
* Some other function comment | ||
* | ||
* @param {Object} config - Optional configuration | ||
*/ | ||
function init(config) { | ||
resolver(foobar.bind(config)); | ||
} | ||
// more comments | ||
|
||
return init; | ||
}); |
29 changes: 29 additions & 0 deletions
29
dev/TestVendorModule/src/theme/Magento_Checkout/web/js/ignore.js
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,29 @@ | ||
/** | ||
* Some copyright header. | ||
* Goes here | ||
*/ | ||
define([ | ||
'abc123' | ||
], function (resolver) { | ||
'use strict'; | ||
|
||
/** | ||
* Some function comment. | ||
* | ||
* @param {Object} config - Optional configuration | ||
*/ | ||
function this_is_the_base_function_name(config) { | ||
var foo = 1; | ||
} | ||
|
||
/** | ||
* Some other function comment | ||
* | ||
* @param {Object} config - Optional configuration | ||
*/ | ||
function init(config) { | ||
resolver(this_is_the_base_function_name.bind(config)); | ||
} | ||
|
||
return init; | ||
}); |
36 changes: 36 additions & 0 deletions
36
dev/TestVendorModule/src/theme/Magento_Checkout/web/js/redundant.js
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,36 @@ | ||
/** | ||
* Some copyright header. | ||
* Goes here | ||
*/ | ||
define([ | ||
'abc123' | ||
], function (resolver) { | ||
'use strict'; | ||
|
||
|
||
// more comments | ||
/* | ||
like this | ||
*/ | ||
/** | ||
* Some function comment. | ||
* | ||
* @param {Object} config - Optional configuration | ||
*/ | ||
function foobar(config) { | ||
var foo = 1; | ||
} | ||
|
||
// more comments | ||
|
||
/** | ||
* Some other function comment | ||
* | ||
* @param {Object} config - Optional configuration | ||
*/ | ||
function init(config) { | ||
resolver(foobar.bind(config)); | ||
} | ||
|
||
return init; | ||
}); |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Oops, something went wrong.