ilib-lint 1.5.3 → 1.6.0
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/README.md +132 -11
- package/docs/AnsiConsoleFormatter.html +2 -2
- package/docs/BuiltinPlugin.html +312 -0
- package/docs/ConfigBasedFormatter.html +2 -2
- package/docs/DirItem.html +9 -140
- package/docs/DirItem.js.html +5 -14
- package/docs/FileType.html +7 -4
- package/docs/FileType.js.html +16 -3
- package/docs/FormatterManager.html +6 -6
- package/docs/FormatterManager.js.html +16 -7
- package/docs/LineParser.html +287 -0
- package/docs/LineRegexpChecker.html +353 -0
- package/docs/ParserManager.html +5 -5
- package/docs/ParserManager.js.html +10 -5
- package/docs/PluginManager.html +9 -9
- package/docs/PluginManager.js.html +53 -26
- package/docs/Project.html +490 -19
- package/docs/Project.js.html +279 -9
- package/docs/ResourceCompleteness.html +2 -2
- package/docs/ResourceDNTTerms.html +2 -2
- package/docs/ResourceEdgeWhitespace.html +2 -2
- package/docs/ResourceICUPluralTranslation.html +2 -2
- package/docs/ResourceICUPlurals.html +2 -2
- package/docs/ResourceMatcher.html +7 -454
- package/docs/ResourceNoTranslation.html +2 -2
- package/docs/ResourceQuoteStyle.html +2 -2
- package/docs/ResourceSourceChecker.html +2 -2
- package/docs/ResourceStateChecker.html +2 -2
- package/docs/ResourceTargetChecker.html +2 -2
- package/docs/ResourceUniqueKeys.html +4 -4
- package/docs/RuleManager.html +13 -13
- package/docs/RuleManager.js.html +25 -9
- package/docs/RuleSet.html +8 -8
- package/docs/RuleSet.js.html +6 -2
- package/docs/SourceFile.html +10 -9
- package/docs/SourceFile.js.html +67 -46
- package/docs/SourceRegexpChecker.html +353 -0
- package/docs/StringParser.html +288 -0
- package/docs/XliffParser.html +2 -111
- package/docs/formatters_AnsiConsoleFormatter.js.html +2 -2
- package/docs/formatters_ConfigBasedFormatter.js.html +2 -2
- package/docs/global.html +17 -310
- package/docs/index.html +2 -2
- package/docs/plugins_BuiltinPlugin.js.html +122 -0
- package/docs/plugins_LineParser.js.html +134 -0
- package/docs/plugins_StringParser.js.html +134 -0
- package/docs/plugins_XliffParser.js.html +16 -11
- package/docs/rules_LineRegexpChecker.js.html +223 -0
- package/docs/rules_ResourceCompleteness.js.html +2 -2
- package/docs/rules_ResourceDNTTerms.js.html +2 -2
- package/docs/rules_ResourceEdgeWhitespace.js.html +2 -2
- package/docs/rules_ResourceICUPluralTranslation.js.html +2 -2
- package/docs/rules_ResourceICUPlurals.js.html +2 -2
- package/docs/rules_ResourceMatcher.js.html +10 -5
- package/docs/rules_ResourceNoTranslation.js.html +2 -2
- package/docs/rules_ResourceQuoteStyle.js.html +2 -2
- package/docs/rules_ResourceSourceChecker.js.html +2 -2
- package/docs/rules_ResourceStateChecker.js.html +2 -2
- package/docs/rules_ResourceTargetChecker.js.html +2 -2
- package/docs/rules_ResourceUniqueKeys.js.html +6 -2
- package/docs/rules_SourceRegexpChecker.js.html +226 -0
- package/docs/rules_utils.js.html +2 -2
- package/package.json +3 -3
- package/src/DirItem.js +3 -12
- package/src/FileType.js +14 -1
- package/src/FormatterManager.js +14 -5
- package/src/ParserManager.js +8 -3
- package/src/PluginManager.js +51 -24
- package/src/Project.js +277 -7
- package/src/RuleManager.js +23 -7
- package/src/RuleSet.js +4 -0
- package/src/SourceFile.js +65 -44
- package/src/index.js +85 -78
- package/src/plugins/{XliffPlugin.js → BuiltinPlugin.js} +7 -4
- package/src/plugins/LineParser.js +62 -0
- package/src/plugins/StringParser.js +62 -0
- package/src/plugins/XliffParser.js +14 -9
- package/src/rules/LineRegexpChecker.js +151 -0
- package/src/rules/ResourceMatcher.js +8 -3
- package/src/rules/ResourceUniqueKeys.js +4 -0
- package/src/rules/SourceRegexpChecker.js +154 -0
- package/src/rules/SourceFileChecker.js +0 -180
- package/src/walk.js +0 -155
package/README.md
CHANGED
|
@@ -99,6 +99,9 @@ ilib-lint accepts the following command-line parameters:
|
|
|
99
99
|
with status 2 if there are errors, and status 0 if there are warnings. This
|
|
100
100
|
flag allows you to squelch the warnings and only fail a script if there are
|
|
101
101
|
actual errors.
|
|
102
|
+
* formatter - name the formatter to use to format the results
|
|
103
|
+
* list - list out all the known rulesets and all of the known plugins: parsers,
|
|
104
|
+
rules, and formatters. This can assist you with creating your own configuration.
|
|
102
105
|
* locales - Locales you want your app to support globally. Value is a comma-separated
|
|
103
106
|
list of BCP-47 style locale tags. File types can override this list.
|
|
104
107
|
Default: the top 20 locales on the internet by traffic.
|
|
@@ -107,13 +110,34 @@ ilib-lint accepts the following command-line parameters:
|
|
|
107
110
|
* quiet - Produce no progress output during the run, except for errors running
|
|
108
111
|
the tool such as the inability to load a plugin. Instead exit with a return
|
|
109
112
|
value. Zero indicates no errors, and a positive exit value indicates errors.
|
|
113
|
+
* max-errors {number} - specify the maximum number of acceptable errors. If
|
|
114
|
+
this number is exceeded, the linter will exit with an exit code of 2. The
|
|
115
|
+
default maximum number is zero.
|
|
116
|
+
* max-warnings {number} - specify the maximum number of acceptable warnings.
|
|
117
|
+
If the maximum number of errors is not exceeded, but the maximum number of
|
|
118
|
+
warnings is, the linter will exit with an exit code of 1. The
|
|
119
|
+
default maximum number is zero.
|
|
120
|
+
* max-suggestions {number} - specify the maximum number of acceptable suggestions.
|
|
121
|
+
If the maximum number of errors and warnings are not exceeded, but the maximum
|
|
122
|
+
number of suggestions is, the linter will exit with an exit code of 1. The
|
|
123
|
+
default maximum number is unlimited. (That is, suggestions will not cause an
|
|
124
|
+
exit code unless this command-line parameter is given.)
|
|
125
|
+
* min-score {number} - specify the minimum acceptable I18N score for the project.
|
|
126
|
+
If the minimum score it not reached, the linter will exit with an exit code
|
|
127
|
+
of 2. There is no default minimum, so the linter will not give an exit code
|
|
128
|
+
unless this parameter is specified or unless one of the other limits is
|
|
129
|
+
exceeded.
|
|
130
|
+
|
|
131
|
+
If multiple limits are exceeded (maximum number of errors, warnings, or suggestions,
|
|
132
|
+
or minimum I18N score), the exit code will be the the most severe amongst them
|
|
133
|
+
all. (Usually "2".)
|
|
110
134
|
|
|
111
135
|
## Exit Status
|
|
112
136
|
|
|
113
137
|
If you want to use this linter in a script, you can check for the following
|
|
114
138
|
exit status:
|
|
115
139
|
|
|
116
|
-
* 0 - no problems found
|
|
140
|
+
* 0 - no problems or only suggestions found
|
|
117
141
|
* 1 - warnings found
|
|
118
142
|
* 2 - errors found
|
|
119
143
|
|
|
@@ -287,12 +311,12 @@ Here is an example of a configuration file:
|
|
|
287
311
|
]
|
|
288
312
|
},
|
|
289
313
|
"javascript": {
|
|
290
|
-
"
|
|
314
|
+
"ruleset": [
|
|
291
315
|
"react-rules"
|
|
292
316
|
]
|
|
293
317
|
},
|
|
294
318
|
"jsx": {
|
|
295
|
-
"
|
|
319
|
+
"ruleset": [
|
|
296
320
|
"react-rules"
|
|
297
321
|
]
|
|
298
322
|
}
|
|
@@ -393,16 +417,22 @@ multiple instances of each class during the run of the program.
|
|
|
393
417
|
### Parsers
|
|
394
418
|
|
|
395
419
|
The job of the parser is to convert a source file into an intermediate representation
|
|
396
|
-
that rules can easily digest. There are
|
|
420
|
+
that rules can easily digest. There are a few standard representations that many
|
|
397
421
|
rules use, but your parser and rules can use their own representation, as
|
|
398
|
-
long as the parser and the rules agree on what that format is. Typically,
|
|
399
|
-
parser will produce something like an abstract syntax tree (AST) that
|
|
400
|
-
know how to traverse and interpret.
|
|
422
|
+
long as the parser and the rules agree on what that format is. Typically, a
|
|
423
|
+
sophisticated parser will produce something like an abstract syntax tree (AST) that
|
|
424
|
+
the rules know how to traverse and interpret. The standard representations are
|
|
425
|
+
much simpler than that. These parsers should pick a unique name for their
|
|
426
|
+
representation so that the appropriate rules can parse that representation.
|
|
401
427
|
|
|
402
|
-
The
|
|
428
|
+
The standard representations are:
|
|
403
429
|
|
|
404
|
-
- resources - the file is converted into
|
|
430
|
+
- resources - the file is converted into an array of
|
|
431
|
+
[Resource](https://github.com/iLib-js/ilib-tools-common/blob/main/src/Resource.js)
|
|
432
|
+
instances
|
|
405
433
|
- lines - the file in converted into a simple array of lines
|
|
434
|
+
- source - the file is not parsed. Instead, the entire text of the file is used to
|
|
435
|
+
search for problems. (Usually with regular expressions.)
|
|
406
436
|
|
|
407
437
|
The resources representation is intended to represent entries in resource files
|
|
408
438
|
such as xliff files, gnu po files, or java properties files. Each entry in the
|
|
@@ -466,9 +496,9 @@ Each declarative rule should have the following properties:
|
|
|
466
496
|
* resource-target - check resources in a resource file. If
|
|
467
497
|
the regular expressions match in the target string of a
|
|
468
498
|
resource, a result will be generated
|
|
469
|
-
*
|
|
499
|
+
* source-checker - Check the text in a source file, such as a
|
|
470
500
|
java file or a python file. Regular expressions that match
|
|
471
|
-
in the source file will generate results
|
|
501
|
+
anywhere in the source file will generate results
|
|
472
502
|
* name (String) - a unique dash-separated name of this rule.
|
|
473
503
|
eg. "resource-url-match",
|
|
474
504
|
* description (String) - a description of what this rule is trying
|
|
@@ -488,6 +518,19 @@ Each declarative rule should have the following properties:
|
|
|
488
518
|
and avoided in the future. Often, this is a link to a markdown file
|
|
489
519
|
in the docs folder on the github repo for the plugin, but it can be
|
|
490
520
|
any link you like.
|
|
521
|
+
* severity (String) - the severity of this result if this check fails.
|
|
522
|
+
This should be one of "error", "warning", or "suggestion".
|
|
523
|
+
- Errors are typically things that block localization completely,
|
|
524
|
+
cause exceptions or crashes in code, or which are unacceptable
|
|
525
|
+
from a localization point of view. Teams should strive for
|
|
526
|
+
zero errors in their project.
|
|
527
|
+
- Warnings are things that are not quite as severe as errors
|
|
528
|
+
and therefore do not block localization or cause crashes, but
|
|
529
|
+
which should still be fixed to improve the quality of the
|
|
530
|
+
translations.
|
|
531
|
+
- Suggestions are things that may not necessarily be wrong, but
|
|
532
|
+
where a better way exists or where a recommended practice should
|
|
533
|
+
be followed.
|
|
491
534
|
|
|
492
535
|
Programmatic rules are used when the requirements for the rules are more complicated
|
|
493
536
|
than a simple regular expression string can handle. For example, a rule that checks
|
|
@@ -591,6 +634,70 @@ violate the rules implemented in the plugin so that the linter will produce some
|
|
|
591
634
|
Clone the project, cd to the lint directory, run `npm install`, and then `npm run lint`
|
|
592
635
|
to see the results.
|
|
593
636
|
|
|
637
|
+
## I18N Score
|
|
638
|
+
|
|
639
|
+
At the end of each run, the i18n tool can generate a score that gives you an idea numerically
|
|
640
|
+
of how ready your project is for localization. The score goes from 0 to 100 where 0 means
|
|
641
|
+
that your project is not localization ready at all, and 100 means it is completely ready for
|
|
642
|
+
localization.
|
|
643
|
+
|
|
644
|
+
Many projects do not have a perfect 100 score, and that can be acceptable. It is still possible
|
|
645
|
+
to produce a reasonably localized version of the project without achieving 100. The recommended
|
|
646
|
+
goal for each project should be to continually increase the score as development proceeds up to
|
|
647
|
+
a minimal acceptable threshold that your team agrees to with your localization team. Nicely
|
|
648
|
+
localized projects typically have a score in the range of 80 to 100. Often teams will decide
|
|
649
|
+
that they want a maximum of zero errors, but allow up to N number of warnings, and M number of
|
|
650
|
+
suggestions.
|
|
651
|
+
|
|
652
|
+
### Calculations
|
|
653
|
+
|
|
654
|
+
There are actually a number of things calculated at the end of the run:
|
|
655
|
+
|
|
656
|
+
- percentage of source files containing errors, warnings, suggestions, and total problems
|
|
657
|
+
- percentage of source lines containing errors, warnings, suggestions, and total problems
|
|
658
|
+
- the overall score across the whole project
|
|
659
|
+
|
|
660
|
+
The overall score takes into account the following factors:
|
|
661
|
+
|
|
662
|
+
- the number of source files
|
|
663
|
+
- the number of lines in each source file
|
|
664
|
+
- the number and type of results from applying rules
|
|
665
|
+
- the number of rules being applied
|
|
666
|
+
- the scores from subprojects
|
|
667
|
+
|
|
668
|
+
Errors weigh heaviest in the calculations, followed by warnings, and finally suggestions. That
|
|
669
|
+
is, a project with 5 errors in it will have a lower score than one with 5 warnings or 5
|
|
670
|
+
suggestions.
|
|
671
|
+
|
|
672
|
+
As such, it should be noted that the I18N score is not a percentage, but a
|
|
673
|
+
unit-less score which may change over time as the linter changes, even if your project does
|
|
674
|
+
not change. The relative movement of the score is the most important thing to look at to
|
|
675
|
+
see if the project is improving. As new rules are implemented and set into your configuration
|
|
676
|
+
after updating a newer version of the linter or installing new plugins, the score for a
|
|
677
|
+
project may go down for a while until the problems manifested by the new rules are resolved. This
|
|
678
|
+
does not mean the quality of your project has gone down, just that new things have been
|
|
679
|
+
identified to work on.
|
|
680
|
+
|
|
681
|
+
When your project contains subprojects, each subproject will get its own report and I18N
|
|
682
|
+
score. The reports and scores for subprojects will be rolled up to the main project, which
|
|
683
|
+
will have an overall federated score across the current project and all all subprojects. This
|
|
684
|
+
way, you will be able to measure the progress in libraries, services, or subprojects independently
|
|
685
|
+
of your main project.
|
|
686
|
+
|
|
687
|
+
For example, your project may use a mono-repo which contains "frontend", "backend", and "services"
|
|
688
|
+
subprojects within it, each being developed by different teams. They can each have their
|
|
689
|
+
own I18N scores and the overall project has a federated score based on the scores of the
|
|
690
|
+
subprojects.
|
|
691
|
+
|
|
692
|
+
### Using the Score as a CI/CD Pipeline Check
|
|
693
|
+
|
|
694
|
+
The linter now includes command-line flags where you can specify minimums and maximums
|
|
695
|
+
for various numbers. The linter will exit with an exit code if the minimums or maximums are
|
|
696
|
+
not satisfied. You can use this exit code to determine if your CI/CD pipeline has failed or
|
|
697
|
+
succeeded.
|
|
698
|
+
|
|
699
|
+
See the section above on command-line parameters for details on these.
|
|
700
|
+
|
|
594
701
|
## License
|
|
595
702
|
|
|
596
703
|
Copyright © 2022-2023, JEDLSoft
|
|
@@ -610,6 +717,20 @@ limitations under the License.
|
|
|
610
717
|
|
|
611
718
|
## Release Notes
|
|
612
719
|
|
|
720
|
+
### v1.6.0
|
|
721
|
+
|
|
722
|
+
- added the ability to scan source code files and apply rules
|
|
723
|
+
- added source-checker Rule for declarative rules
|
|
724
|
+
- moved functionality into Project class
|
|
725
|
+
- main loop moved from index.js into the run() method
|
|
726
|
+
- directory walk function moved to a method of Project
|
|
727
|
+
- added I18N score into the summary at the end of the run
|
|
728
|
+
- gives a score from 0 to 100 where 0 means your project
|
|
729
|
+
is not localization ready at all, and 100 means it is completely
|
|
730
|
+
ready for localization.
|
|
731
|
+
- added command-line parameters to control the exit code
|
|
732
|
+
from the linter based on the score
|
|
733
|
+
|
|
613
734
|
### v1.5.3
|
|
614
735
|
|
|
615
736
|
- fixed a problem where the quote checker rule would not handle ASCII single quote
|
|
@@ -29,7 +29,7 @@
|
|
|
29
29
|
<nav >
|
|
30
30
|
|
|
31
31
|
|
|
32
|
-
<h2><a href="index.html">Home</a></h2><h3>Classes</h3><ul><li><a href="AnsiConsoleFormatter.html">AnsiConsoleFormatter</a><ul class='methods'><li data-type='method'><a href="AnsiConsoleFormatter.html#format">format</a></li></ul></li><li><a href="
|
|
32
|
+
<h2><a href="index.html">Home</a></h2><h3>Classes</h3><ul><li><a href="AnsiConsoleFormatter.html">AnsiConsoleFormatter</a><ul class='methods'><li data-type='method'><a href="AnsiConsoleFormatter.html#format">format</a></li></ul></li><li><a href="BuiltinPlugin.html">BuiltinPlugin</a><ul class='methods'><li data-type='method'><a href="BuiltinPlugin.html#getParsers">getParsers</a></li></ul></li><li><a href="ConfigBasedFormatter.html">ConfigBasedFormatter</a><ul class='methods'><li data-type='method'><a href="ConfigBasedFormatter.html#format">format</a></li></ul></li><li><a href="DirItem.html">DirItem</a><ul class='methods'><li data-type='method'><a href="DirItem.html#findIssues">findIssues</a></li><li data-type='method'><a href="DirItem.html#getFilePath">getFilePath</a></li><li data-type='method'><a href="DirItem.html#parse">parse</a></li></ul></li><li><a href="FileType.html">FileType</a><ul class='methods'><li data-type='method'><a href="FileType.html#getRuleSetNames">getRuleSetNames</a></li><li data-type='method'><a href="FileType.html#getRules">getRules</a></li></ul></li><li><a href="FormatterManager.html">FormatterManager</a><ul class='methods'><li data-type='method'><a href="FormatterManager.html#add">add</a></li><li data-type='method'><a href="FormatterManager.html#get">get</a></li><li data-type='method'><a href="FormatterManager.html#getDescriptions">getDescriptions</a></li><li data-type='method'><a href="FormatterManager.html#size">size</a></li></ul></li><li><a href="LineParser.html">LineParser</a><ul class='methods'><li data-type='method'><a href="LineParser.html#parse">parse</a></li></ul></li><li><a href="LineRegexpChecker.html">LineRegexpChecker</a><ul class='methods'><li data-type='method'><a href="LineRegexpChecker.html#match">match</a></li></ul></li><li><a href="ParserManager.html">ParserManager</a><ul class='methods'><li data-type='method'><a href="ParserManager.html#add">add</a></li><li data-type='method'><a href="ParserManager.html#get">get</a></li><li data-type='method'><a href="ParserManager.html#getDescriptions">getDescriptions</a></li></ul></li><li><a href="PluginManager.html">PluginManager</a><ul class='methods'><li data-type='method'><a href="PluginManager.html#add">add</a></li><li data-type='method'><a href="PluginManager.html#getFormatterManager">getFormatterManager</a></li><li data-type='method'><a href="PluginManager.html#getParserManager">getParserManager</a></li><li data-type='method'><a href="PluginManager.html#getRuleManager">getRuleManager</a></li><li data-type='method'><a href="PluginManager.html#getRuleSet">getRuleSet</a></li><li data-type='method'><a href="PluginManager.html#load">load</a></li></ul></li><li><a href="Project.html">Project</a><ul class='methods'><li data-type='method'><a href="Project.html#add">add</a></li><li data-type='method'><a href="Project.html#findIssues">findIssues</a></li><li data-type='method'><a href="Project.html#get">get</a></li><li data-type='method'><a href="Project.html#getExcludes">getExcludes</a></li><li data-type='method'><a href="Project.html#getFileType">getFileType</a></li><li data-type='method'><a href="Project.html#getFileTypeForPath">getFileTypeForPath</a></li><li data-type='method'><a href="Project.html#getIncludes">getIncludes</a></li><li data-type='method'><a href="Project.html#getLocales">getLocales</a></li><li data-type='method'><a href="Project.html#getName">getName</a></li><li data-type='method'><a href="Project.html#getOptions">getOptions</a></li><li data-type='method'><a href="Project.html#getParserManager">getParserManager</a></li><li data-type='method'><a href="Project.html#getPluginManager">getPluginManager</a></li><li data-type='method'><a href="Project.html#getRoot">getRoot</a></li><li data-type='method'><a href="Project.html#getRuleManager">getRuleManager</a></li><li data-type='method'><a href="Project.html#getScore">getScore</a></li><li data-type='method'><a href="Project.html#getSourceLocale">getSourceLocale</a></li><li data-type='method'><a href="Project.html#init">init</a></li><li data-type='method'><a href="Project.html#run">run</a></li><li data-type='method'><a href="Project.html#scan">scan</a></li></ul></li><li><a href="ResourceCompleteness.html">ResourceCompleteness</a><ul class='methods'><li data-type='method'><a href="ResourceCompleteness.html#getRuleType">getRuleType</a></li><li data-type='method'><a href="ResourceCompleteness.html#match">match</a></li></ul></li><li><a href="ResourceDNTTerms.html">ResourceDNTTerms</a><ul class='methods'><li data-type='method'><a href="ResourceDNTTerms.html#getRuleType">getRuleType</a></li><li data-type='method'><a href="ResourceDNTTerms.html#match">match</a></li><li data-type='method'><a href="ResourceDNTTerms.html#.parseTermsFromJsonFile">parseTermsFromJsonFile</a></li><li data-type='method'><a href="ResourceDNTTerms.html#.parseTermsFromTxtFile">parseTermsFromTxtFile</a></li></ul></li><li><a href="ResourceEdgeWhitespace.html">ResourceEdgeWhitespace</a><ul class='methods'><li data-type='method'><a href="ResourceEdgeWhitespace.html#getRuleType">getRuleType</a></li><li data-type='method'><a href="ResourceEdgeWhitespace.html#match">match</a></li></ul></li><li><a href="ResourceICUPluralTranslation.html">ResourceICUPluralTranslation</a><ul class='methods'><li data-type='method'><a href="ResourceICUPluralTranslation.html#match">match</a></li></ul></li><li><a href="ResourceICUPlurals.html">ResourceICUPlurals</a><ul class='methods'><li data-type='method'><a href="ResourceICUPlurals.html#match">match</a></li></ul></li><li><a href="ResourceMatcher.html">ResourceMatcher</a><ul class='methods'><li data-type='method'><a href="ResourceMatcher.html#match">match</a></li></ul></li><li><a href="ResourceNoTranslation.html">ResourceNoTranslation</a><ul class='methods'><li data-type='method'><a href="ResourceNoTranslation.html#match">match</a></li></ul></li><li><a href="ResourceQuoteStyle.html">ResourceQuoteStyle</a><ul class='methods'><li data-type='method'><a href="ResourceQuoteStyle.html#match">match</a></li></ul></li><li><a href="ResourceSourceChecker.html">ResourceSourceChecker</a><ul class='methods'><li data-type='method'><a href="ResourceSourceChecker.html#match">match</a></li></ul></li><li><a href="ResourceStateChecker.html">ResourceStateChecker</a><ul class='methods'><li data-type='method'><a href="ResourceStateChecker.html#match">match</a></li></ul></li><li><a href="ResourceTargetChecker.html">ResourceTargetChecker</a><ul class='methods'><li data-type='method'><a href="ResourceTargetChecker.html#match">match</a></li></ul></li><li><a href="ResourceUniqueKeys.html">ResourceUniqueKeys</a><ul class='methods'><li data-type='method'><a href="ResourceUniqueKeys.html#match">match</a></li></ul></li><li><a href="RuleManager.html">RuleManager</a><ul class='methods'><li data-type='method'><a href="RuleManager.html#add">add</a></li><li data-type='method'><a href="RuleManager.html#addRuleSetDefinition">addRuleSetDefinition</a></li><li data-type='method'><a href="RuleManager.html#addRuleSetDefinitions">addRuleSetDefinitions</a></li><li data-type='method'><a href="RuleManager.html#get">get</a></li><li data-type='method'><a href="RuleManager.html#getDescriptions">getDescriptions</a></li><li data-type='method'><a href="RuleManager.html#getRuleSetDefinition">getRuleSetDefinition</a></li><li data-type='method'><a href="RuleManager.html#getRuleSetDefinitions">getRuleSetDefinitions</a></li><li data-type='method'><a href="RuleManager.html#getRules">getRules</a></li><li data-type='method'><a href="RuleManager.html#size">size</a></li><li data-type='method'><a href="RuleManager.html#sizeRuleSetDefinitions">sizeRuleSetDefinitions</a></li></ul></li><li><a href="RuleSet.html">RuleSet</a><ul class='methods'><li data-type='method'><a href="RuleSet.html#add">add</a></li><li data-type='method'><a href="RuleSet.html#addRule">addRule</a></li><li data-type='method'><a href="RuleSet.html#getRule">getRule</a></li><li data-type='method'><a href="RuleSet.html#getRules">getRules</a></li><li data-type='method'><a href="RuleSet.html#getSize">getSize</a></li></ul></li><li><a href="SourceFile.html">SourceFile</a><ul class='methods'><li data-type='method'><a href="SourceFile.html#findIssues">findIssues</a></li><li data-type='method'><a href="SourceFile.html#getLocaleFromPath">getLocaleFromPath</a></li><li data-type='method'><a href="SourceFile.html#parse">parse</a></li></ul></li><li><a href="SourceRegexpChecker.html">SourceRegexpChecker</a><ul class='methods'><li data-type='method'><a href="SourceRegexpChecker.html#match">match</a></li></ul></li><li><a href="StringParser.html">StringParser</a><ul class='methods'><li data-type='method'><a href="StringParser.html#parse">parse</a></li></ul></li><li><a href="XliffParser.html">XliffParser</a><ul class='methods'><li data-type='method'><a href="XliffParser.html#parse">parse</a></li></ul></li></ul><h3>Global</h3><ul><li><a href="global.html#concatIntlAstText">concatIntlAstText</a></li><li><a href="global.html#typeMap">typeMap</a></li></ul>
|
|
33
33
|
|
|
34
34
|
</nav>
|
|
35
35
|
|
|
@@ -348,7 +348,7 @@ formatted string.</li></ul></dd>
|
|
|
348
348
|
<br class="clear">
|
|
349
349
|
|
|
350
350
|
<footer>
|
|
351
|
-
Documentation generated by <a href="https://github.com/jsdoc3/jsdoc">JSDoc 4.0.2</a> on
|
|
351
|
+
Documentation generated by <a href="https://github.com/jsdoc3/jsdoc">JSDoc 4.0.2</a> on Thu May 11 2023 11:23:09 GMT-0700 (Pacific Daylight Time) using the <a href="https://github.com/clenemt/docdash">docdash</a> theme.
|
|
352
352
|
</footer>
|
|
353
353
|
|
|
354
354
|
<script>prettyPrint();</script>
|
|
@@ -0,0 +1,312 @@
|
|
|
1
|
+
<!DOCTYPE html>
|
|
2
|
+
<html lang="en">
|
|
3
|
+
<head>
|
|
4
|
+
|
|
5
|
+
<meta charset="utf-8">
|
|
6
|
+
<title>BuiltinPlugin - Documentation</title>
|
|
7
|
+
|
|
8
|
+
|
|
9
|
+
<script src="scripts/prettify/prettify.js"></script>
|
|
10
|
+
<script src="scripts/prettify/lang-css.js"></script>
|
|
11
|
+
<!--[if lt IE 9]>
|
|
12
|
+
<script src="//html5shiv.googlecode.com/svn/trunk/html5.js"></script>
|
|
13
|
+
<![endif]-->
|
|
14
|
+
<link type="text/css" rel="stylesheet" href="styles/prettify.css">
|
|
15
|
+
<link type="text/css" rel="stylesheet" href="styles/jsdoc.css">
|
|
16
|
+
<script src="scripts/nav.js" defer></script>
|
|
17
|
+
|
|
18
|
+
<meta name="viewport" content="width=device-width, initial-scale=1.0">
|
|
19
|
+
</head>
|
|
20
|
+
<body>
|
|
21
|
+
|
|
22
|
+
<input type="checkbox" id="nav-trigger" class="nav-trigger" />
|
|
23
|
+
<label for="nav-trigger" class="navicon-button x">
|
|
24
|
+
<div class="navicon"></div>
|
|
25
|
+
</label>
|
|
26
|
+
|
|
27
|
+
<label for="nav-trigger" class="overlay"></label>
|
|
28
|
+
|
|
29
|
+
<nav >
|
|
30
|
+
|
|
31
|
+
|
|
32
|
+
<h2><a href="index.html">Home</a></h2><h3>Classes</h3><ul><li><a href="AnsiConsoleFormatter.html">AnsiConsoleFormatter</a><ul class='methods'><li data-type='method'><a href="AnsiConsoleFormatter.html#format">format</a></li></ul></li><li><a href="BuiltinPlugin.html">BuiltinPlugin</a><ul class='methods'><li data-type='method'><a href="BuiltinPlugin.html#getParsers">getParsers</a></li></ul></li><li><a href="ConfigBasedFormatter.html">ConfigBasedFormatter</a><ul class='methods'><li data-type='method'><a href="ConfigBasedFormatter.html#format">format</a></li></ul></li><li><a href="DirItem.html">DirItem</a><ul class='methods'><li data-type='method'><a href="DirItem.html#findIssues">findIssues</a></li><li data-type='method'><a href="DirItem.html#getFilePath">getFilePath</a></li><li data-type='method'><a href="DirItem.html#parse">parse</a></li></ul></li><li><a href="FileType.html">FileType</a><ul class='methods'><li data-type='method'><a href="FileType.html#getRuleSetNames">getRuleSetNames</a></li><li data-type='method'><a href="FileType.html#getRules">getRules</a></li></ul></li><li><a href="FormatterManager.html">FormatterManager</a><ul class='methods'><li data-type='method'><a href="FormatterManager.html#add">add</a></li><li data-type='method'><a href="FormatterManager.html#get">get</a></li><li data-type='method'><a href="FormatterManager.html#getDescriptions">getDescriptions</a></li><li data-type='method'><a href="FormatterManager.html#size">size</a></li></ul></li><li><a href="LineParser.html">LineParser</a><ul class='methods'><li data-type='method'><a href="LineParser.html#parse">parse</a></li></ul></li><li><a href="LineRegexpChecker.html">LineRegexpChecker</a><ul class='methods'><li data-type='method'><a href="LineRegexpChecker.html#match">match</a></li></ul></li><li><a href="ParserManager.html">ParserManager</a><ul class='methods'><li data-type='method'><a href="ParserManager.html#add">add</a></li><li data-type='method'><a href="ParserManager.html#get">get</a></li><li data-type='method'><a href="ParserManager.html#getDescriptions">getDescriptions</a></li></ul></li><li><a href="PluginManager.html">PluginManager</a><ul class='methods'><li data-type='method'><a href="PluginManager.html#add">add</a></li><li data-type='method'><a href="PluginManager.html#getFormatterManager">getFormatterManager</a></li><li data-type='method'><a href="PluginManager.html#getParserManager">getParserManager</a></li><li data-type='method'><a href="PluginManager.html#getRuleManager">getRuleManager</a></li><li data-type='method'><a href="PluginManager.html#getRuleSet">getRuleSet</a></li><li data-type='method'><a href="PluginManager.html#load">load</a></li></ul></li><li><a href="Project.html">Project</a><ul class='methods'><li data-type='method'><a href="Project.html#add">add</a></li><li data-type='method'><a href="Project.html#findIssues">findIssues</a></li><li data-type='method'><a href="Project.html#get">get</a></li><li data-type='method'><a href="Project.html#getExcludes">getExcludes</a></li><li data-type='method'><a href="Project.html#getFileType">getFileType</a></li><li data-type='method'><a href="Project.html#getFileTypeForPath">getFileTypeForPath</a></li><li data-type='method'><a href="Project.html#getIncludes">getIncludes</a></li><li data-type='method'><a href="Project.html#getLocales">getLocales</a></li><li data-type='method'><a href="Project.html#getName">getName</a></li><li data-type='method'><a href="Project.html#getOptions">getOptions</a></li><li data-type='method'><a href="Project.html#getParserManager">getParserManager</a></li><li data-type='method'><a href="Project.html#getPluginManager">getPluginManager</a></li><li data-type='method'><a href="Project.html#getRoot">getRoot</a></li><li data-type='method'><a href="Project.html#getRuleManager">getRuleManager</a></li><li data-type='method'><a href="Project.html#getScore">getScore</a></li><li data-type='method'><a href="Project.html#getSourceLocale">getSourceLocale</a></li><li data-type='method'><a href="Project.html#init">init</a></li><li data-type='method'><a href="Project.html#run">run</a></li><li data-type='method'><a href="Project.html#scan">scan</a></li></ul></li><li><a href="ResourceCompleteness.html">ResourceCompleteness</a><ul class='methods'><li data-type='method'><a href="ResourceCompleteness.html#getRuleType">getRuleType</a></li><li data-type='method'><a href="ResourceCompleteness.html#match">match</a></li></ul></li><li><a href="ResourceDNTTerms.html">ResourceDNTTerms</a><ul class='methods'><li data-type='method'><a href="ResourceDNTTerms.html#getRuleType">getRuleType</a></li><li data-type='method'><a href="ResourceDNTTerms.html#match">match</a></li><li data-type='method'><a href="ResourceDNTTerms.html#.parseTermsFromJsonFile">parseTermsFromJsonFile</a></li><li data-type='method'><a href="ResourceDNTTerms.html#.parseTermsFromTxtFile">parseTermsFromTxtFile</a></li></ul></li><li><a href="ResourceEdgeWhitespace.html">ResourceEdgeWhitespace</a><ul class='methods'><li data-type='method'><a href="ResourceEdgeWhitespace.html#getRuleType">getRuleType</a></li><li data-type='method'><a href="ResourceEdgeWhitespace.html#match">match</a></li></ul></li><li><a href="ResourceICUPluralTranslation.html">ResourceICUPluralTranslation</a><ul class='methods'><li data-type='method'><a href="ResourceICUPluralTranslation.html#match">match</a></li></ul></li><li><a href="ResourceICUPlurals.html">ResourceICUPlurals</a><ul class='methods'><li data-type='method'><a href="ResourceICUPlurals.html#match">match</a></li></ul></li><li><a href="ResourceMatcher.html">ResourceMatcher</a><ul class='methods'><li data-type='method'><a href="ResourceMatcher.html#match">match</a></li></ul></li><li><a href="ResourceNoTranslation.html">ResourceNoTranslation</a><ul class='methods'><li data-type='method'><a href="ResourceNoTranslation.html#match">match</a></li></ul></li><li><a href="ResourceQuoteStyle.html">ResourceQuoteStyle</a><ul class='methods'><li data-type='method'><a href="ResourceQuoteStyle.html#match">match</a></li></ul></li><li><a href="ResourceSourceChecker.html">ResourceSourceChecker</a><ul class='methods'><li data-type='method'><a href="ResourceSourceChecker.html#match">match</a></li></ul></li><li><a href="ResourceStateChecker.html">ResourceStateChecker</a><ul class='methods'><li data-type='method'><a href="ResourceStateChecker.html#match">match</a></li></ul></li><li><a href="ResourceTargetChecker.html">ResourceTargetChecker</a><ul class='methods'><li data-type='method'><a href="ResourceTargetChecker.html#match">match</a></li></ul></li><li><a href="ResourceUniqueKeys.html">ResourceUniqueKeys</a><ul class='methods'><li data-type='method'><a href="ResourceUniqueKeys.html#match">match</a></li></ul></li><li><a href="RuleManager.html">RuleManager</a><ul class='methods'><li data-type='method'><a href="RuleManager.html#add">add</a></li><li data-type='method'><a href="RuleManager.html#addRuleSetDefinition">addRuleSetDefinition</a></li><li data-type='method'><a href="RuleManager.html#addRuleSetDefinitions">addRuleSetDefinitions</a></li><li data-type='method'><a href="RuleManager.html#get">get</a></li><li data-type='method'><a href="RuleManager.html#getDescriptions">getDescriptions</a></li><li data-type='method'><a href="RuleManager.html#getRuleSetDefinition">getRuleSetDefinition</a></li><li data-type='method'><a href="RuleManager.html#getRuleSetDefinitions">getRuleSetDefinitions</a></li><li data-type='method'><a href="RuleManager.html#getRules">getRules</a></li><li data-type='method'><a href="RuleManager.html#size">size</a></li><li data-type='method'><a href="RuleManager.html#sizeRuleSetDefinitions">sizeRuleSetDefinitions</a></li></ul></li><li><a href="RuleSet.html">RuleSet</a><ul class='methods'><li data-type='method'><a href="RuleSet.html#add">add</a></li><li data-type='method'><a href="RuleSet.html#addRule">addRule</a></li><li data-type='method'><a href="RuleSet.html#getRule">getRule</a></li><li data-type='method'><a href="RuleSet.html#getRules">getRules</a></li><li data-type='method'><a href="RuleSet.html#getSize">getSize</a></li></ul></li><li><a href="SourceFile.html">SourceFile</a><ul class='methods'><li data-type='method'><a href="SourceFile.html#findIssues">findIssues</a></li><li data-type='method'><a href="SourceFile.html#getLocaleFromPath">getLocaleFromPath</a></li><li data-type='method'><a href="SourceFile.html#parse">parse</a></li></ul></li><li><a href="SourceRegexpChecker.html">SourceRegexpChecker</a><ul class='methods'><li data-type='method'><a href="SourceRegexpChecker.html#match">match</a></li></ul></li><li><a href="StringParser.html">StringParser</a><ul class='methods'><li data-type='method'><a href="StringParser.html#parse">parse</a></li></ul></li><li><a href="XliffParser.html">XliffParser</a><ul class='methods'><li data-type='method'><a href="XliffParser.html#parse">parse</a></li></ul></li></ul><h3>Global</h3><ul><li><a href="global.html#concatIntlAstText">concatIntlAstText</a></li><li><a href="global.html#typeMap">typeMap</a></li></ul>
|
|
33
|
+
|
|
34
|
+
</nav>
|
|
35
|
+
|
|
36
|
+
<div id="main">
|
|
37
|
+
|
|
38
|
+
<h1 class="page-title">BuiltinPlugin</h1>
|
|
39
|
+
|
|
40
|
+
|
|
41
|
+
|
|
42
|
+
|
|
43
|
+
|
|
44
|
+
|
|
45
|
+
|
|
46
|
+
<section>
|
|
47
|
+
|
|
48
|
+
<header>
|
|
49
|
+
|
|
50
|
+
<h2>
|
|
51
|
+
|
|
52
|
+
BuiltinPlugin
|
|
53
|
+
|
|
54
|
+
</h2>
|
|
55
|
+
|
|
56
|
+
<div class="class-description usertext">ilib-lint plugin that can parse XLIFF files</div>
|
|
57
|
+
|
|
58
|
+
|
|
59
|
+
</header>
|
|
60
|
+
|
|
61
|
+
<article>
|
|
62
|
+
|
|
63
|
+
<div class="container-overview">
|
|
64
|
+
|
|
65
|
+
|
|
66
|
+
|
|
67
|
+
|
|
68
|
+
<h2>Constructor</h2>
|
|
69
|
+
|
|
70
|
+
|
|
71
|
+
<h4 class="name" id="BuiltinPlugin"><span class="type-signature"></span>new BuiltinPlugin<span class="signature">()</span><span class="type-signature"></span></h4>
|
|
72
|
+
|
|
73
|
+
|
|
74
|
+
|
|
75
|
+
|
|
76
|
+
|
|
77
|
+
|
|
78
|
+
<dl class="details">
|
|
79
|
+
|
|
80
|
+
<dt class="tag-description">Description:</dt>
|
|
81
|
+
<dd class="tag-description"><ul class="dummy"><li>Create a new xliff plugin instance.</li></ul></dd>
|
|
82
|
+
|
|
83
|
+
|
|
84
|
+
|
|
85
|
+
<dt class="tag-source">Source:</dt>
|
|
86
|
+
<dd class="tag-source"><ul class="dummy"><li>
|
|
87
|
+
<a href="plugins_BuiltinPlugin.js.html">plugins/BuiltinPlugin.js</a>, <a href="plugins_BuiltinPlugin.js.html#line29">line 29</a>
|
|
88
|
+
</li></ul></dd>
|
|
89
|
+
|
|
90
|
+
|
|
91
|
+
|
|
92
|
+
|
|
93
|
+
|
|
94
|
+
|
|
95
|
+
|
|
96
|
+
|
|
97
|
+
|
|
98
|
+
|
|
99
|
+
|
|
100
|
+
|
|
101
|
+
|
|
102
|
+
|
|
103
|
+
|
|
104
|
+
|
|
105
|
+
|
|
106
|
+
|
|
107
|
+
|
|
108
|
+
|
|
109
|
+
|
|
110
|
+
|
|
111
|
+
|
|
112
|
+
|
|
113
|
+
|
|
114
|
+
|
|
115
|
+
|
|
116
|
+
|
|
117
|
+
|
|
118
|
+
|
|
119
|
+
|
|
120
|
+
</dl>
|
|
121
|
+
|
|
122
|
+
|
|
123
|
+
|
|
124
|
+
|
|
125
|
+
|
|
126
|
+
|
|
127
|
+
|
|
128
|
+
|
|
129
|
+
|
|
130
|
+
|
|
131
|
+
|
|
132
|
+
|
|
133
|
+
|
|
134
|
+
|
|
135
|
+
|
|
136
|
+
|
|
137
|
+
|
|
138
|
+
|
|
139
|
+
|
|
140
|
+
|
|
141
|
+
|
|
142
|
+
|
|
143
|
+
|
|
144
|
+
|
|
145
|
+
|
|
146
|
+
|
|
147
|
+
|
|
148
|
+
|
|
149
|
+
|
|
150
|
+
|
|
151
|
+
|
|
152
|
+
</div>
|
|
153
|
+
|
|
154
|
+
|
|
155
|
+
|
|
156
|
+
|
|
157
|
+
|
|
158
|
+
|
|
159
|
+
|
|
160
|
+
|
|
161
|
+
|
|
162
|
+
|
|
163
|
+
|
|
164
|
+
|
|
165
|
+
|
|
166
|
+
|
|
167
|
+
|
|
168
|
+
|
|
169
|
+
|
|
170
|
+
<h3 class="subsection-title">Methods</h3>
|
|
171
|
+
|
|
172
|
+
|
|
173
|
+
|
|
174
|
+
|
|
175
|
+
|
|
176
|
+
|
|
177
|
+
<h4 class="name" id="getParsers"><span class="type-signature"></span>getParsers<span class="signature">()</span><span class="type-signature"> → {Array.<Parser>}</span></h4>
|
|
178
|
+
|
|
179
|
+
|
|
180
|
+
|
|
181
|
+
|
|
182
|
+
|
|
183
|
+
|
|
184
|
+
<dl class="details">
|
|
185
|
+
|
|
186
|
+
<dt class="tag-description">Description:</dt>
|
|
187
|
+
<dd class="tag-description"><ul class="dummy"><li>For a "parser" type of plugin, this returns a list of Parser classes
|
|
188
|
+
that this plugin implements.</li></ul></dd>
|
|
189
|
+
|
|
190
|
+
|
|
191
|
+
|
|
192
|
+
<dt class="tag-source">Source:</dt>
|
|
193
|
+
<dd class="tag-source"><ul class="dummy"><li>
|
|
194
|
+
<a href="plugins_BuiltinPlugin.js.html">plugins/BuiltinPlugin.js</a>, <a href="plugins_BuiltinPlugin.js.html#line45">line 45</a>
|
|
195
|
+
</li></ul></dd>
|
|
196
|
+
|
|
197
|
+
|
|
198
|
+
|
|
199
|
+
|
|
200
|
+
|
|
201
|
+
|
|
202
|
+
|
|
203
|
+
|
|
204
|
+
|
|
205
|
+
|
|
206
|
+
|
|
207
|
+
|
|
208
|
+
|
|
209
|
+
|
|
210
|
+
|
|
211
|
+
|
|
212
|
+
|
|
213
|
+
|
|
214
|
+
|
|
215
|
+
|
|
216
|
+
|
|
217
|
+
|
|
218
|
+
|
|
219
|
+
|
|
220
|
+
|
|
221
|
+
|
|
222
|
+
|
|
223
|
+
|
|
224
|
+
|
|
225
|
+
|
|
226
|
+
|
|
227
|
+
</dl>
|
|
228
|
+
|
|
229
|
+
|
|
230
|
+
|
|
231
|
+
|
|
232
|
+
|
|
233
|
+
|
|
234
|
+
|
|
235
|
+
|
|
236
|
+
|
|
237
|
+
|
|
238
|
+
|
|
239
|
+
|
|
240
|
+
|
|
241
|
+
|
|
242
|
+
|
|
243
|
+
|
|
244
|
+
|
|
245
|
+
|
|
246
|
+
|
|
247
|
+
|
|
248
|
+
|
|
249
|
+
|
|
250
|
+
|
|
251
|
+
|
|
252
|
+
|
|
253
|
+
|
|
254
|
+
|
|
255
|
+
<h5 class="h5-returns">Returns:</h5>
|
|
256
|
+
|
|
257
|
+
|
|
258
|
+
<div class="param-desc">
|
|
259
|
+
list of Parser classes implemented by this
|
|
260
|
+
plugin
|
|
261
|
+
</div>
|
|
262
|
+
|
|
263
|
+
|
|
264
|
+
|
|
265
|
+
<dl class="param-type">
|
|
266
|
+
<dt>
|
|
267
|
+
Type
|
|
268
|
+
</dt>
|
|
269
|
+
<dd>
|
|
270
|
+
|
|
271
|
+
<span class="param-type">Array.<Parser></span>
|
|
272
|
+
|
|
273
|
+
|
|
274
|
+
|
|
275
|
+
</dd>
|
|
276
|
+
</dl>
|
|
277
|
+
|
|
278
|
+
|
|
279
|
+
|
|
280
|
+
|
|
281
|
+
|
|
282
|
+
|
|
283
|
+
|
|
284
|
+
|
|
285
|
+
|
|
286
|
+
|
|
287
|
+
|
|
288
|
+
</article>
|
|
289
|
+
|
|
290
|
+
</section>
|
|
291
|
+
|
|
292
|
+
|
|
293
|
+
|
|
294
|
+
|
|
295
|
+
|
|
296
|
+
|
|
297
|
+
</div>
|
|
298
|
+
|
|
299
|
+
<br class="clear">
|
|
300
|
+
|
|
301
|
+
<footer>
|
|
302
|
+
Documentation generated by <a href="https://github.com/jsdoc3/jsdoc">JSDoc 4.0.2</a> on Thu May 11 2023 11:23:09 GMT-0700 (Pacific Daylight Time) using the <a href="https://github.com/clenemt/docdash">docdash</a> theme.
|
|
303
|
+
</footer>
|
|
304
|
+
|
|
305
|
+
<script>prettyPrint();</script>
|
|
306
|
+
<script src="scripts/polyfill.js"></script>
|
|
307
|
+
<script src="scripts/linenumber.js"></script>
|
|
308
|
+
|
|
309
|
+
|
|
310
|
+
|
|
311
|
+
</body>
|
|
312
|
+
</html>
|