Commit graph

22 commits

Author SHA1 Message Date
Kunal Mehta 139a8aafea Fix up 11f4a97ba6
CategoryManager is a member variable. Also explicitly define the
haveParserMigrationExt member variable too.

Change-Id: I2aa77e5c1819a80ba18f67c0f65b2d47dbaa0303
2017-08-22 16:08:50 -07:00
Subramanya Sastry 11f4a97ba6 Provide parsermigration-edit edit link option for categories
* Since the high priority categories are being used to effect
  Tidy migration, we need editors to be able to compare their fixes
  and ensure that the pages look identical after the fix.

* This patch adds a new property for linter categories and displays
  the requested edit link in the pager.

* This patch enables the property for high priority categories.

Change-Id: Ia9b23d79da686f0a6c0203e2dba58a876a4a3d4a
2017-08-22 10:07:39 +00:00
Subramanya Sastry ce8b7c873c Add tidy-whitespace-bug linter high-priority category
Change-Id: I9c068c2c45b4cf9bb5612f41dfa63a606a7a679a
2017-08-10 12:20:09 -04:00
Subramanya Sastry f85184df54 Parsoid provides ns-prefixed template titles => don't use NS_TEMPLATE
* This prevents resolving main namespace titles as template titles

Bug: T169472
Change-Id: I3c10227767257bcd62f95e0284d44f5e44c33057
2017-07-05 15:17:18 -05:00
Subramanya Sastry eb99fd05e3 Display table tag for deletable-table-tag pages to prevent UI confusion
I remember reading in some talk page / phab task about what the tag
was that had to be deleted.

Change-Id: I74bc6f3207177239f7173ce2963ed55350e26f6f
2017-07-05 14:39:53 -05:00
Kunal Mehta f2a516582d build: Updating mediawiki/mediawiki-codesniffer to 0.9.0
The following sniffs are failing and were disabled:
* MediaWiki.FunctionComment.Missing.Protected
* MediaWiki.FunctionComment.Missing.Public

Change-Id: I96e32df48d13040893bfd1be6d90d0db4f7c7d0a
2017-06-20 00:10:41 -07:00
Subramanya Sastry 3eea8ed824 Handle multi-part-template-block output from Parsoid's linter
The messaging is a bit tricky. In some cases, the flag is set
because the output involves a single template and some top-level
content -- not multiple templates always.

Ex: '{{1x|<div>}}foo</span>'

In this case, the entire content is considered template-affected
because of DOM structuring reasons. This wikitext will generate
lint errors with multi-part-template-block template info.

In production usage, however, the probability is quite high that
multiple templates will be involved. This is usually because of
tables that are constructed with multiple templates, for example.

So, if we want to fudge and hand-wave a bit, the i18n message can
say that the output came from multiple templates.

Bug: T162920
Change-Id: I35cee6787800b03724856775fdf53991ae8e8125
2017-05-08 23:01:32 -05:00
Subramanya Sastry a866fa7c76 Add pwrap-bug-workaround linter category
Change-Id: If1ec022e5bb741f4dc825428b5a689c2f0b0c445
2017-04-19 15:19:13 -05:00
Subramanya Sastry a5e2f822f3 Show tag name for the stripped-tag category
Change-Id: I53546c11391fb2388dbcf3f70c0a21b2b1af9b09
2017-04-19 08:51:21 -04:00
Kunal Mehta fbff1cffff Add namespace filter to Special:LintErrors
Bug: T162918
Change-Id: Id41faeafb9af161d32d5c273094fb2e6d8a8a64b
2017-04-13 20:49:21 -07:00
Subramanya Sastry 0d230e722f Add misnested-tag linter category
Change-Id: I3508c68272940d21be6a5c9b78ee34c845debc74
2017-04-10 17:28:36 -05:00
Subramanya Sastry 619ddc8677 Add deletable-table-tag linter category
Change-Id: I48000170a74363872edbce8f78780bccf160600c
2017-04-06 12:47:51 -05:00
Kunal Mehta 7f17abe393 Add link to history on Special:LintErrors
Bug: T160607
Change-Id: Ifd2ef33dd7477722691c8f2e570b7ac1af206135
2017-03-22 13:28:33 -07:00
Kunal Mehta f3778856f2 Add severity for error categories
Categories can now have a severity level of "error" or "warning"
designated, which places them in a different heading on
Special:LintErrors.

Bug: T152822
Change-Id: I1276b9502d90765e88dcb8ea78569dee910c5d88
2016-12-14 17:07:40 -08:00
Kunal Mehta 651d8f174b Add missing semicolon to &mdash
Change-Id: If669c89cd06ca173c0dcf6a01a793ddf8ce31793
2016-12-14 01:01:57 -08:00
Kunal Mehta 419610bcdb Enforce category/page/position uniqueness constraint in the database
Move location to two separate columns in the database: linter_start and
linter_end. This allows us to have the database enforce the uniqueness
of those fields, instead of just relying upon the PHP code to do so,
which could be bypassed since we have multiple servers and concurrent
processes.

Change-Id: I3e67ce1b7cb3c93866a388ec3248af4cff2a81e0
2016-11-30 18:55:19 -08:00
Kunal Mehta d8437fc9c3 LintErrorsPager: Set explicit output format on some messages
Bug: T151283
Change-Id: Ic52bc11a6aacf7f5bb23d9273fa0bf2a27e0cfc4
2016-11-22 18:31:21 -08:00
Kunal Mehta b41e74ce8b Hardcode category ids
Instead of having a complex auto-increment category manager that had
additional caching, just hardcode the (currently 6) ids for each
category, which allows us to simplify a lot of code.

If Parsoid sends a lint error in a category that we don't know about, it
is silently dropped.

Bug: T151287
Change-Id: Ice6edf1b7985390aa0c1c410d357bc565bb69108
2016-11-22 18:31:17 -08:00
Arlo Breault 958623f0fb Display self-closed tags
Change-Id: I6c084a6c72114b57a21cd367d398c673c5c4d991
2016-11-17 12:32:46 -08:00
Kunal Mehta ec6f4722aa Store linter_cat names in a separate table
linter_cat is now an int ID that points to a row in the new
lint_categories table.

The mapping between category names and ids is all handled in PHP, and
cached in APC.

Note that you will need to drop the `linter` table manually and re-run
update.php for this to take effect.

Change-Id: I369d9b4d8d08289b4a20d1cd29a2e327bad28ef8
2016-11-03 14:51:10 -07:00
Kunal Mehta c33361e980 Show tag name for missing-end-tag too
Added in Parsoid 6d432a61f.

Change-Id: Ia716949f4fadacc3c8aab25337897c9b039f1e54
2016-10-20 14:03:25 -07:00
Kunal Mehta bce5b31616 Initial commit
This configures a MediaWiki extension to recieve Parsoid's lint errors
and expose them to users.

Change-Id: Ie0776aecf145eb1c87c2a539ddf3ea8d35a899f5
2016-10-17 16:02:53 -07:00