Skip to content
This repository has been archived by the owner on Sep 30, 2020. It is now read-only.

feat!: enforce standard formatting for deprecation annotations #175

Merged
merged 2 commits into from
Apr 24, 2020

Conversation

wincent
Copy link
Contributor

@wincent wincent commented Apr 23, 2020

Closes: #55

@wincent
Copy link
Contributor Author

wincent commented Apr 23, 2020

Testing this in liferay-portal, it finds these problems:

✖ 36 problems (36 errors, 0 warnings)
  11 errors and 0 warnings potentially fixable with the `--fix` option.

Some can't be autofixed; typical example (from apps/frontend-js/frontend-js-aui-web/src/main/resources/META-INF/resources/liferay/autocomplete_input_caretindex.js):

/**
 * The Autocomplete Input Caretindex Component.
 *
 * @deprecated since 7.2, unused
 * @module liferay-autocomplete-input-caretindex
 */

These are the autofixes that it can apply:

diff --git a/modules/apps/frontend-js/frontend-js-aui-web/src/main/resources/META-INF/resources/liferay/crop_region.js b/modules/apps/frontend-js/frontend-js-aui-web/src/main/resources/META-INF/resources/liferay/crop_region.js
index 9e2d095737fa..0d037a5395a7 100644
--- a/modules/apps/frontend-js/frontend-js-aui-web/src/main/resources/META-INF/resources/liferay/crop_region.js
+++ b/modules/apps/frontend-js/frontend-js-aui-web/src/main/resources/META-INF/resources/liferay/crop_region.js
@@ -15,7 +15,7 @@
 /**
  * The Crop Region Utility
  *
- * @deprecated As of Athanasius(7.3.x), replaced by Liferay.Util.getCropRegion
+ * @deprecated As of Athanasius (7.3.x), replaced by Liferay.Util.getCropRegion
  * @module liferay-crop-region
  */
 
diff --git a/modules/apps/frontend-js/frontend-js-aui-web/src/main/resources/META-INF/resources/liferay/item_selector_dialog.js b/modules/apps/frontend-js/frontend-js-aui-web/src/main/resources/META-INF/resources/liferay/item_selector_dialog.js
index 959fd63015a8..b813726c76a5 100644
--- a/modules/apps/frontend-js/frontend-js-aui-web/src/main/resources/META-INF/resources/liferay/item_selector_dialog.js
+++ b/modules/apps/frontend-js/frontend-js-aui-web/src/main/resources/META-INF/resources/liferay/item_selector_dialog.js
@@ -13,7 +13,7 @@
  */
 
 /**
- * @deprecated As of Athanasius(7.3.x), replaced by ItemSelectorDialog.es.js
+ * @deprecated As of Athanasius (7.3.x), replaced by ItemSelectorDialog.es.js
  * @module liferay-item-selector-dialog
  */
 
diff --git a/modules/apps/frontend-js/frontend-js-aui-web/src/main/resources/META-INF/resources/liferay/item_selector_repository_entry_browser.js b/modules/apps/frontend-js/frontend-js-aui-web/src/main/resources/META-INF/resources/liferay/item_selector_repository_entry_browser.js
index 9b0a9cb9f769..275f5ad52a62 100644
--- a/modules/apps/frontend-js/frontend-js-aui-web/src/main/resources/META-INF/resources/liferay/item_selector_repository_entry_browser.js
+++ b/modules/apps/frontend-js/frontend-js-aui-web/src/main/resources/META-INF/resources/liferay/item_selector_repository_entry_browser.js
@@ -13,7 +13,7 @@
  */
 
 /**
- * @deprecated As of Athanasius(7.3.x), replaced by ItemSelectorRepositoryEntryBrowser.es.js
+ * @deprecated As of Athanasius (7.3.x), replaced by ItemSelectorRepositoryEntryBrowser.es.js
  * @module liferay-item-selector-repository-entry-browser
  */
 
diff --git a/modules/apps/frontend-js/frontend-js-aui-web/src/main/resources/META-INF/resources/liferay/item_selector_url.js b/modules/apps/frontend-js/frontend-js-aui-web/src/main/resources/META-INF/resources/liferay/item_selector_url.js
index fa4eca3eba51..f2a7f514c16b 100644
--- a/modules/apps/frontend-js/frontend-js-aui-web/src/main/resources/META-INF/resources/liferay/item_selector_url.js
+++ b/modules/apps/frontend-js/frontend-js-aui-web/src/main/resources/META-INF/resources/liferay/item_selector_url.js
@@ -13,7 +13,7 @@
  */
 
 /**
- * @deprecated As of Athanasius(7.3.x), replaced by ItemSelectorUrl.es.js
+ * @deprecated As of Athanasius (7.3.x), replaced by ItemSelectorUrl.es.js
  * @module liferay-item-selector-url
  */
 
diff --git a/modules/apps/frontend-js/frontend-js-aui-web/src/main/resources/META-INF/resources/liferay/item_viewer.js b/modules/apps/frontend-js/frontend-js-aui-web/src/main/resources/META-INF/resources/liferay/item_viewer.js
index 233783e29fc6..01c125336391 100644
--- a/modules/apps/frontend-js/frontend-js-aui-web/src/main/resources/META-INF/resources/liferay/item_viewer.js
+++ b/modules/apps/frontend-js/frontend-js-aui-web/src/main/resources/META-INF/resources/liferay/item_viewer.js
@@ -13,7 +13,7 @@
  */
 
 /**
- * @deprecated As of Athanasius(7.3.x), replaced by ItemSelectorPreview.es.js
+ * @deprecated As of Athanasius (7.3.x), replaced by ItemSelectorPreview.es.js
  * @module liferay-item-viewer
  */
 
diff --git a/modules/apps/frontend-js/frontend-js-aui-web/src/main/resources/META-INF/resources/liferay/node.js b/modules/apps/frontend-js/frontend-js-aui-web/src/main/resources/META-INF/resources/liferay/node.js
index 858ba14c37e2..1bbc15d89817 100644
--- a/modules/apps/frontend-js/frontend-js-aui-web/src/main/resources/META-INF/resources/liferay/node.js
+++ b/modules/apps/frontend-js/frontend-js-aui-web/src/main/resources/META-INF/resources/liferay/node.js
@@ -15,7 +15,7 @@
 /**
  * The Liferay Node Utility
  *
- * @deprecated As of Athanasius(7.3.x), with no direct replacement
+ * @deprecated As of Athanasius (7.3.x), with no direct replacement
  * @module liferay-node
  */
 
diff --git a/modules/apps/frontend-js/frontend-js-aui-web/src/main/resources/META-INF/resources/liferay/portlet_url.js b/modules/apps/frontend-js/frontend-js-aui-web/src/main/resources/META-INF/resources/liferay/portlet_url.js
index 91be51d3d328..4b72378dedf6 100644
--- a/modules/apps/frontend-js/frontend-js-aui-web/src/main/resources/META-INF/resources/liferay/portlet_url.js
+++ b/modules/apps/frontend-js/frontend-js-aui-web/src/main/resources/META-INF/resources/liferay/portlet_url.js
@@ -15,7 +15,7 @@
 /**
  * The Portlet URL Utility
  *
- * @deprecated As of Athanasius(7.3.x), replaced by Liferay.Util.PortletURL
+ * @deprecated As of Athanasius (7.3.x), replaced by Liferay.Util.PortletURL
  * @module liferay-portlet-url
  */
 
diff --git a/modules/apps/frontend-js/frontend-js-aui-web/src/main/resources/META-INF/resources/liferay/storage_formatter.js b/modules/apps/frontend-js/frontend-js-aui-web/src/main/resources/META-INF/resources/liferay/storage_formatter.js
index dc260579bbd0..5f243464abe4 100644
--- a/modules/apps/frontend-js/frontend-js-aui-web/src/main/resources/META-INF/resources/liferay/storage_formatter.js
+++ b/modules/apps/frontend-js/frontend-js-aui-web/src/main/resources/META-INF/resources/liferay/storage_formatter.js
@@ -15,7 +15,7 @@
 /**
  * The Storage Formatter Utility
  *
- * @deprecated As of Athanasius(7.3.x), replaced by Liferay.Util.formatStorage
+ * @deprecated As of Athanasius (7.3.x), replaced by Liferay.Util.formatStorage
  * @module liferay-storage-formatter
  */
 
diff --git a/modules/apps/frontend-js/frontend-js-aui-web/src/main/resources/META-INF/resources/liferay/store.js b/modules/apps/frontend-js/frontend-js-aui-web/src/main/resources/META-INF/resources/liferay/store.js
index dcbe5999c593..3e836b2a000e 100644
--- a/modules/apps/frontend-js/frontend-js-aui-web/src/main/resources/META-INF/resources/liferay/store.js
+++ b/modules/apps/frontend-js/frontend-js-aui-web/src/main/resources/META-INF/resources/liferay/store.js
@@ -15,7 +15,7 @@
 /**
  * The Store Utility
  *
- * @deprecated As of Athanasius(7.3.x), replaced by Liferay.Util.Session
+ * @deprecated As of Athanasius (7.3.x), replaced by Liferay.Util.Session
  * @module liferay-store
  */
 
diff --git a/modules/apps/frontend-js/frontend-js-aui-web/src/main/resources/META-INF/resources/liferay/xml_formatter.js b/modules/apps/frontend-js/frontend-js-aui-web/src/main/resources/META-INF/resources/liferay/xml_formatter.js
index 95256c4e8ad3..3082a61b49af 100644
--- a/modules/apps/frontend-js/frontend-js-aui-web/src/main/resources/META-INF/resources/liferay/xml_formatter.js
+++ b/modules/apps/frontend-js/frontend-js-aui-web/src/main/resources/META-INF/resources/liferay/xml_formatter.js
@@ -15,7 +15,7 @@
 /**
  * The XML Formatter Utility
  *
- * @deprecated As of Athanasius(7.3.x), replaced by Liferay.Util.formatXML
+ * @deprecated As of Athanasius (7.3.x), replaced by Liferay.Util.formatXML
  * @module liferay-xml-formatter
  */
 
diff --git a/modules/apps/frontend-js/frontend-js-web/src/main/resources/META-INF/resources/liferay/PortletBase.es.js b/modules/apps/frontend-js/frontend-js-web/src/main/resources/META-INF/resources/liferay/PortletBase.es.js
index 384d7a84daa8..54dcccafd88b 100644
--- a/modules/apps/frontend-js/frontend-js-web/src/main/resources/META-INF/resources/liferay/PortletBase.es.js
+++ b/modules/apps/frontend-js/frontend-js-web/src/main/resources/META-INF/resources/liferay/PortletBase.es.js
@@ -167,7 +167,7 @@ PortletBase.STATE = {
 	/**
 	 * Portlet's namespace.
 	 *
-	 * @deprecated since 7.1
+	 * @deprecated As of Judson (7.1.x)
 	 * @instance
 	 * @memberof PortletBase
 	 * @type {string}

Can probably fix the others manually easily enough.

@wincent
Copy link
Contributor Author

wincent commented Apr 24, 2020

Seeing as nobody is going to review that regex, going to merge this.

@wincent
Copy link
Contributor Author

wincent commented Apr 24, 2020

PR fixing annotations in liferay-portal is here: https://github.com/wincent/liferay-portal/pull/232

@wincent wincent merged commit f4394c6 into master Apr 24, 2020
@wincent wincent deleted the wincent/deprecations branch April 24, 2020 14:12
brianchandotcom pushed a commit to brianchandotcom/liferay-portal that referenced this pull request Apr 24, 2020
This is a preview of the auto-enforcement that will come with:

liferay/eslint-config-liferay#175

In the next commit I'll deal with the places where we need a manual fix.
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
Projects
None yet
Development

Successfully merging this pull request may close these issues.

feat: enforce deprecation notices to contain version names
1 participant