diff --git a/src/__phutil_library_map__.php b/src/__phutil_library_map__.php --- a/src/__phutil_library_map__.php +++ b/src/__phutil_library_map__.php @@ -97,9 +97,6 @@ 'ArcanistBuildRef' => 'ref/ArcanistBuildRef.php', 'ArcanistBundle' => 'parser/ArcanistBundle.php', 'ArcanistBundleTestCase' => 'parser/__tests__/ArcanistBundleTestCase.php', - 'ArcanistCSSLintLinter' => 'lint/linter/ArcanistCSSLintLinter.php', - 'ArcanistCSSLintLinterTestCase' => 'lint/linter/__tests__/ArcanistCSSLintLinterTestCase.php', - 'ArcanistCSharpLinter' => 'lint/linter/ArcanistCSharpLinter.php', 'ArcanistCallConduitWorkflow' => 'workflow/ArcanistCallConduitWorkflow.php', 'ArcanistCallParenthesesXHPASTLinterRule' => 'lint/linter/xhpast/rules/ArcanistCallParenthesesXHPASTLinterRule.php', 'ArcanistCallParenthesesXHPASTLinterRuleTestCase' => 'lint/linter/xhpast/rules/__tests__/ArcanistCallParenthesesXHPASTLinterRuleTestCase.php', @@ -120,10 +117,6 @@ 'ArcanistClassNameLiteralXHPASTLinterRuleTestCase' => 'lint/linter/xhpast/rules/__tests__/ArcanistClassNameLiteralXHPASTLinterRuleTestCase.php', 'ArcanistCloseRevisionWorkflow' => 'workflow/ArcanistCloseRevisionWorkflow.php', 'ArcanistCloseWorkflow' => 'workflow/ArcanistCloseWorkflow.php', - 'ArcanistClosureLinter' => 'lint/linter/ArcanistClosureLinter.php', - 'ArcanistClosureLinterTestCase' => 'lint/linter/__tests__/ArcanistClosureLinterTestCase.php', - 'ArcanistCoffeeLintLinter' => 'lint/linter/ArcanistCoffeeLintLinter.php', - 'ArcanistCoffeeLintLinterTestCase' => 'lint/linter/__tests__/ArcanistCoffeeLintLinterTestCase.php', 'ArcanistCommentRemover' => 'parser/ArcanistCommentRemover.php', 'ArcanistCommentRemoverTestCase' => 'parser/__tests__/ArcanistCommentRemoverTestCase.php', 'ArcanistCommentSpacingXHPASTLinterRule' => 'lint/linter/xhpast/rules/ArcanistCommentSpacingXHPASTLinterRule.php', @@ -133,7 +126,6 @@ 'ArcanistCommitUpstreamHardpointLoader' => 'loader/ArcanistCommitUpstreamHardpointLoader.php', 'ArcanistCommitWorkflow' => 'workflow/ArcanistCommitWorkflow.php', 'ArcanistCompilerLintRenderer' => 'lint/renderer/ArcanistCompilerLintRenderer.php', - 'ArcanistComposerLinter' => 'lint/linter/ArcanistComposerLinter.php', 'ArcanistComprehensiveLintEngine' => 'lint/engine/ArcanistComprehensiveLintEngine.php', 'ArcanistConcatenationOperatorXHPASTLinterRule' => 'lint/linter/xhpast/rules/ArcanistConcatenationOperatorXHPASTLinterRule.php', 'ArcanistConcatenationOperatorXHPASTLinterRuleTestCase' => 'lint/linter/xhpast/rules/__tests__/ArcanistConcatenationOperatorXHPASTLinterRuleTestCase.php', @@ -155,10 +147,6 @@ 'ArcanistControlStatementSpacingXHPASTLinterRule' => 'lint/linter/xhpast/rules/ArcanistControlStatementSpacingXHPASTLinterRule.php', 'ArcanistControlStatementSpacingXHPASTLinterRuleTestCase' => 'lint/linter/xhpast/rules/__tests__/ArcanistControlStatementSpacingXHPASTLinterRuleTestCase.php', 'ArcanistCoverWorkflow' => 'workflow/ArcanistCoverWorkflow.php', - 'ArcanistCppcheckLinter' => 'lint/linter/ArcanistCppcheckLinter.php', - 'ArcanistCppcheckLinterTestCase' => 'lint/linter/__tests__/ArcanistCppcheckLinterTestCase.php', - 'ArcanistCpplintLinter' => 'lint/linter/ArcanistCpplintLinter.php', - 'ArcanistCpplintLinterTestCase' => 'lint/linter/__tests__/ArcanistCpplintLinterTestCase.php', 'ArcanistCurlyBraceArrayIndexXHPASTLinterRule' => 'lint/linter/xhpast/rules/ArcanistCurlyBraceArrayIndexXHPASTLinterRule.php', 'ArcanistCurlyBraceArrayIndexXHPASTLinterRuleTestCase' => 'lint/linter/xhpast/rules/__tests__/ArcanistCurlyBraceArrayIndexXHPASTLinterRuleTestCase.php', 'ArcanistDeclarationParenthesesXHPASTLinterRule' => 'lint/linter/xhpast/rules/ArcanistDeclarationParenthesesXHPASTLinterRule.php', @@ -202,8 +190,6 @@ 'ArcanistExitExpressionXHPASTLinterRule' => 'lint/linter/xhpast/rules/ArcanistExitExpressionXHPASTLinterRule.php', 'ArcanistExitExpressionXHPASTLinterRuleTestCase' => 'lint/linter/xhpast/rules/__tests__/ArcanistExitExpressionXHPASTLinterRuleTestCase.php', 'ArcanistExportWorkflow' => 'workflow/ArcanistExportWorkflow.php', - 'ArcanistExternalLinter' => 'lint/linter/ArcanistExternalLinter.php', - 'ArcanistExternalLinterTestCase' => 'lint/linter/__tests__/ArcanistExternalLinterTestCase.php', 'ArcanistExtractUseXHPASTLinterRule' => 'lint/linter/xhpast/rules/ArcanistExtractUseXHPASTLinterRule.php', 'ArcanistExtractUseXHPASTLinterRuleTestCase' => 'lint/linter/xhpast/rules/__tests__/ArcanistExtractUseXHPASTLinterRuleTestCase.php', 'ArcanistFeatureWorkflow' => 'workflow/ArcanistFeatureWorkflow.php', @@ -214,13 +200,10 @@ 'ArcanistFilenameLinterTestCase' => 'lint/linter/__tests__/ArcanistFilenameLinterTestCase.php', 'ArcanistFilesystemConfigurationSource' => 'config/source/ArcanistFilesystemConfigurationSource.php', 'ArcanistFlagWorkflow' => 'workflow/ArcanistFlagWorkflow.php', - 'ArcanistFlake8Linter' => 'lint/linter/ArcanistFlake8Linter.php', - 'ArcanistFlake8LinterTestCase' => 'lint/linter/__tests__/ArcanistFlake8LinterTestCase.php', 'ArcanistFormattedStringXHPASTLinterRule' => 'lint/linter/xhpast/rules/ArcanistFormattedStringXHPASTLinterRule.php', 'ArcanistFormattedStringXHPASTLinterRuleTestCase' => 'lint/linter/xhpast/rules/__tests__/ArcanistFormattedStringXHPASTLinterRuleTestCase.php', 'ArcanistFunctionCallShouldBeTypeCastXHPASTLinterRule' => 'lint/linter/xhpast/rules/ArcanistFunctionCallShouldBeTypeCastXHPASTLinterRule.php', 'ArcanistFunctionCallShouldBeTypeCastXHPASTLinterRuleTestCase' => 'lint/linter/xhpast/rules/__tests__/ArcanistFunctionCallShouldBeTypeCastXHPASTLinterRuleTestCase.php', - 'ArcanistFutureLinter' => 'lint/linter/ArcanistFutureLinter.php', 'ArcanistGeneratedLinter' => 'lint/linter/ArcanistGeneratedLinter.php', 'ArcanistGeneratedLinterTestCase' => 'lint/linter/__tests__/ArcanistGeneratedLinterTestCase.php', 'ArcanistGetConfigWorkflow' => 'toolset/workflow/ArcanistGetConfigWorkflow.php', @@ -233,12 +216,8 @@ 'ArcanistGitWorkingCopy' => 'workingcopy/ArcanistGitWorkingCopy.php', 'ArcanistGlobalVariableXHPASTLinterRule' => 'lint/linter/xhpast/rules/ArcanistGlobalVariableXHPASTLinterRule.php', 'ArcanistGlobalVariableXHPASTLinterRuleTestCase' => 'lint/linter/xhpast/rules/__tests__/ArcanistGlobalVariableXHPASTLinterRuleTestCase.php', - 'ArcanistGoLintLinter' => 'lint/linter/ArcanistGoLintLinter.php', - 'ArcanistGoLintLinterTestCase' => 'lint/linter/__tests__/ArcanistGoLintLinterTestCase.php', 'ArcanistGoTestResultParser' => 'unit/parser/ArcanistGoTestResultParser.php', 'ArcanistGoTestResultParserTestCase' => 'unit/parser/__tests__/ArcanistGoTestResultParserTestCase.php', - 'ArcanistHLintLinter' => 'lint/linter/ArcanistHLintLinter.php', - 'ArcanistHLintLinterTestCase' => 'lint/linter/__tests__/ArcanistHLintLinterTestCase.php', 'ArcanistHardpointLoader' => 'loader/ArcanistHardpointLoader.php', 'ArcanistHelpWorkflow' => 'toolset/workflow/ArcanistHelpWorkflow.php', 'ArcanistHexadecimalNumericScalarCasingXHPASTLinterRule' => 'lint/linter/xhpast/rules/ArcanistHexadecimalNumericScalarCasingXHPASTLinterRule.php', @@ -253,7 +232,7 @@ 'ArcanistImplicitFallthroughXHPASTLinterRuleTestCase' => 'lint/linter/xhpast/rules/__tests__/ArcanistImplicitFallthroughXHPASTLinterRuleTestCase.php', 'ArcanistImplicitVisibilityXHPASTLinterRule' => 'lint/linter/xhpast/rules/ArcanistImplicitVisibilityXHPASTLinterRule.php', 'ArcanistImplicitVisibilityXHPASTLinterRuleTestCase' => 'lint/linter/xhpast/rules/__tests__/ArcanistImplicitVisibilityXHPASTLinterRuleTestCase.php', - 'ArcanistInlineHTMLXHPASTLinterRule' => 'lint/linter/ArcanistInlineHTMLXHPASTLinterRule.php', + 'ArcanistInlineHTMLXHPASTLinterRule' => 'lint/linter/xhpast/rules/ArcanistInlineHTMLXHPASTLinterRule.php', 'ArcanistInlineHTMLXHPASTLinterRuleTestCase' => 'lint/linter/xhpast/rules/__tests__/ArcanistInlineHTMLXHPASTLinterRuleTestCase.php', 'ArcanistInnerFunctionXHPASTLinterRule' => 'lint/linter/xhpast/rules/ArcanistInnerFunctionXHPASTLinterRule.php', 'ArcanistInnerFunctionXHPASTLinterRuleTestCase' => 'lint/linter/xhpast/rules/__tests__/ArcanistInnerFunctionXHPASTLinterRuleTestCase.php', @@ -272,16 +251,10 @@ 'ArcanistInvalidOctalNumericScalarXHPASTLinterRuleTestCase' => 'lint/linter/xhpast/rules/__tests__/ArcanistInvalidOctalNumericScalarXHPASTLinterRuleTestCase.php', 'ArcanistIsAShouldBeInstanceOfXHPASTLinterRule' => 'lint/linter/xhpast/rules/ArcanistIsAShouldBeInstanceOfXHPASTLinterRule.php', 'ArcanistIsAShouldBeInstanceOfXHPASTLinterRuleTestCase' => 'lint/linter/xhpast/rules/__tests__/ArcanistIsAShouldBeInstanceOfXHPASTLinterRuleTestCase.php', - 'ArcanistJSHintLinter' => 'lint/linter/ArcanistJSHintLinter.php', - 'ArcanistJSHintLinterTestCase' => 'lint/linter/__tests__/ArcanistJSHintLinterTestCase.php', - 'ArcanistJSONLintLinter' => 'lint/linter/ArcanistJSONLintLinter.php', - 'ArcanistJSONLintLinterTestCase' => 'lint/linter/__tests__/ArcanistJSONLintLinterTestCase.php', 'ArcanistJSONLintRenderer' => 'lint/renderer/ArcanistJSONLintRenderer.php', 'ArcanistJSONLinter' => 'lint/linter/ArcanistJSONLinter.php', 'ArcanistJSONLinterTestCase' => 'lint/linter/__tests__/ArcanistJSONLinterTestCase.php', 'ArcanistJSONUnitSink' => 'unit/sink/ArcanistJSONUnitSink.php', - 'ArcanistJscsLinter' => 'lint/linter/ArcanistJscsLinter.php', - 'ArcanistJscsLinterTestCase' => 'lint/linter/__tests__/ArcanistJscsLinterTestCase.php', 'ArcanistKeywordCasingXHPASTLinterRule' => 'lint/linter/xhpast/rules/ArcanistKeywordCasingXHPASTLinterRule.php', 'ArcanistKeywordCasingXHPASTLinterRuleTestCase' => 'lint/linter/xhpast/rules/__tests__/ArcanistKeywordCasingXHPASTLinterRuleTestCase.php', 'ArcanistLambdaFuncFunctionXHPASTLinterRule' => 'lint/linter/xhpast/rules/ArcanistLambdaFuncFunctionXHPASTLinterRule.php', @@ -290,8 +263,6 @@ 'ArcanistLandWorkflow' => 'workflow/ArcanistLandWorkflow.php', 'ArcanistLanguageConstructParenthesesXHPASTLinterRule' => 'lint/linter/xhpast/rules/ArcanistLanguageConstructParenthesesXHPASTLinterRule.php', 'ArcanistLanguageConstructParenthesesXHPASTLinterRuleTestCase' => 'lint/linter/xhpast/rules/__tests__/ArcanistLanguageConstructParenthesesXHPASTLinterRuleTestCase.php', - 'ArcanistLesscLinter' => 'lint/linter/ArcanistLesscLinter.php', - 'ArcanistLesscLinterTestCase' => 'lint/linter/__tests__/ArcanistLesscLinterTestCase.php', 'ArcanistLiberateWorkflow' => 'workflow/ArcanistLiberateWorkflow.php', 'ArcanistLintEngine' => 'lint/engine/ArcanistLintEngine.php', 'ArcanistLintMessage' => 'lint/ArcanistLintMessage.php', @@ -348,8 +319,6 @@ 'ArcanistNoneLintRenderer' => 'lint/renderer/ArcanistNoneLintRenderer.php', 'ArcanistObjectOperatorSpacingXHPASTLinterRule' => 'lint/linter/xhpast/rules/ArcanistObjectOperatorSpacingXHPASTLinterRule.php', 'ArcanistObjectOperatorSpacingXHPASTLinterRuleTestCase' => 'lint/linter/xhpast/rules/__tests__/ArcanistObjectOperatorSpacingXHPASTLinterRuleTestCase.php', - 'ArcanistPEP8Linter' => 'lint/linter/ArcanistPEP8Linter.php', - 'ArcanistPEP8LinterTestCase' => 'lint/linter/__tests__/ArcanistPEP8LinterTestCase.php', 'ArcanistPHPCloseTagXHPASTLinterRule' => 'lint/linter/xhpast/rules/ArcanistPHPCloseTagXHPASTLinterRule.php', 'ArcanistPHPCloseTagXHPASTLinterRuleTestCase' => 'lint/linter/xhpast/rules/__tests__/ArcanistPHPCloseTagXHPASTLinterRuleTestCase.php', 'ArcanistPHPCompatibilityXHPASTLinterRule' => 'lint/linter/xhpast/rules/ArcanistPHPCompatibilityXHPASTLinterRule.php', @@ -371,10 +340,6 @@ 'ArcanistPasteWorkflow' => 'workflow/ArcanistPasteWorkflow.php', 'ArcanistPatchWorkflow' => 'workflow/ArcanistPatchWorkflow.php', 'ArcanistPhageToolset' => 'toolset/ArcanistPhageToolset.php', - 'ArcanistPhpLinter' => 'lint/linter/ArcanistPhpLinter.php', - 'ArcanistPhpLinterTestCase' => 'lint/linter/__tests__/ArcanistPhpLinterTestCase.php', - 'ArcanistPhpcsLinter' => 'lint/linter/ArcanistPhpcsLinter.php', - 'ArcanistPhpcsLinterTestCase' => 'lint/linter/__tests__/ArcanistPhpcsLinterTestCase.php', 'ArcanistPhpunitTestResultParser' => 'unit/parser/ArcanistPhpunitTestResultParser.php', 'ArcanistPhrequentWorkflow' => 'workflow/ArcanistPhrequentWorkflow.php', 'ArcanistPhutilLibraryLinter' => 'lint/linter/ArcanistPhutilLibraryLinter.php', @@ -389,12 +354,6 @@ 'ArcanistPromptsWorkflow' => 'toolset/workflow/ArcanistPromptsWorkflow.php', 'ArcanistPublicPropertyXHPASTLinterRule' => 'lint/linter/xhpast/rules/ArcanistPublicPropertyXHPASTLinterRule.php', 'ArcanistPublicPropertyXHPASTLinterRuleTestCase' => 'lint/linter/xhpast/rules/__tests__/ArcanistPublicPropertyXHPASTLinterRuleTestCase.php', - 'ArcanistPuppetLintLinter' => 'lint/linter/ArcanistPuppetLintLinter.php', - 'ArcanistPuppetLintLinterTestCase' => 'lint/linter/__tests__/ArcanistPuppetLintLinterTestCase.php', - 'ArcanistPyFlakesLinter' => 'lint/linter/ArcanistPyFlakesLinter.php', - 'ArcanistPyFlakesLinterTestCase' => 'lint/linter/__tests__/ArcanistPyFlakesLinterTestCase.php', - 'ArcanistPyLintLinter' => 'lint/linter/ArcanistPyLintLinter.php', - 'ArcanistPyLintLinterTestCase' => 'lint/linter/__tests__/ArcanistPyLintLinterTestCase.php', 'ArcanistRaggedClassTreeEdgeXHPASTLinterRule' => 'lint/linter/xhpast/rules/ArcanistRaggedClassTreeEdgeXHPASTLinterRule.php', 'ArcanistRaggedClassTreeEdgeXHPASTLinterRuleTestCase' => 'lint/linter/xhpast/rules/__tests__/ArcanistRaggedClassTreeEdgeXHPASTLinterRuleTestCase.php', 'ArcanistRef' => 'ref/ArcanistRef.php', @@ -412,13 +371,8 @@ 'ArcanistRevertWorkflow' => 'workflow/ArcanistRevertWorkflow.php', 'ArcanistRevisionRef' => 'ref/ArcanistRevisionRef.php', 'ArcanistRevisionRefSource' => 'ref/ArcanistRevisionRefSource.php', - 'ArcanistRuboCopLinter' => 'lint/linter/ArcanistRuboCopLinter.php', - 'ArcanistRuboCopLinterTestCase' => 'lint/linter/__tests__/ArcanistRuboCopLinterTestCase.php', - 'ArcanistRubyLinter' => 'lint/linter/ArcanistRubyLinter.php', - 'ArcanistRubyLinterTestCase' => 'lint/linter/__tests__/ArcanistRubyLinterTestCase.php', 'ArcanistRuntimeConfigurationSource' => 'config/source/ArcanistRuntimeConfigurationSource.php', 'ArcanistScalarConfigOption' => 'config/option/ArcanistScalarConfigOption.php', - 'ArcanistScriptAndRegexLinter' => 'lint/linter/ArcanistScriptAndRegexLinter.php', 'ArcanistSelfClassReferenceXHPASTLinterRule' => 'lint/linter/xhpast/rules/ArcanistSelfClassReferenceXHPASTLinterRule.php', 'ArcanistSelfClassReferenceXHPASTLinterRuleTestCase' => 'lint/linter/xhpast/rules/__tests__/ArcanistSelfClassReferenceXHPASTLinterRuleTestCase.php', 'ArcanistSelfMemberReferenceXHPASTLinterRule' => 'lint/linter/xhpast/rules/ArcanistSelfMemberReferenceXHPASTLinterRule.php', @@ -516,8 +470,6 @@ 'ArcanistXHPASTLinterRule' => 'lint/linter/xhpast/ArcanistXHPASTLinterRule.php', 'ArcanistXHPASTLinterRuleTestCase' => 'lint/linter/xhpast/rules/__tests__/ArcanistXHPASTLinterRuleTestCase.php', 'ArcanistXHPASTLinterTestCase' => 'lint/linter/__tests__/ArcanistXHPASTLinterTestCase.php', - 'ArcanistXMLLinter' => 'lint/linter/ArcanistXMLLinter.php', - 'ArcanistXMLLinterTestCase' => 'lint/linter/__tests__/ArcanistXMLLinterTestCase.php', 'ArcanistXUnitTestResultParser' => 'unit/parser/ArcanistXUnitTestResultParser.php', 'BaseHTTPFuture' => 'future/http/BaseHTTPFuture.php', 'CaseInsensitiveArray' => 'utils/CaseInsensitiveArray.php', @@ -1201,9 +1153,6 @@ 'ArcanistBuildRef' => 'Phobject', 'ArcanistBundle' => 'Phobject', 'ArcanistBundleTestCase' => 'PhutilTestCase', - 'ArcanistCSSLintLinter' => 'ArcanistExternalLinter', - 'ArcanistCSSLintLinterTestCase' => 'ArcanistExternalLinterTestCase', - 'ArcanistCSharpLinter' => 'ArcanistLinter', 'ArcanistCallConduitWorkflow' => 'ArcanistWorkflow', 'ArcanistCallParenthesesXHPASTLinterRule' => 'ArcanistXHPASTLinterRule', 'ArcanistCallParenthesesXHPASTLinterRuleTestCase' => 'ArcanistXHPASTLinterRuleTestCase', @@ -1224,10 +1173,6 @@ 'ArcanistClassNameLiteralXHPASTLinterRuleTestCase' => 'ArcanistXHPASTLinterRuleTestCase', 'ArcanistCloseRevisionWorkflow' => 'ArcanistWorkflow', 'ArcanistCloseWorkflow' => 'ArcanistWorkflow', - 'ArcanistClosureLinter' => 'ArcanistExternalLinter', - 'ArcanistClosureLinterTestCase' => 'ArcanistExternalLinterTestCase', - 'ArcanistCoffeeLintLinter' => 'ArcanistExternalLinter', - 'ArcanistCoffeeLintLinterTestCase' => 'ArcanistExternalLinterTestCase', 'ArcanistCommentRemover' => 'Phobject', 'ArcanistCommentRemoverTestCase' => 'PhutilTestCase', 'ArcanistCommentSpacingXHPASTLinterRule' => 'ArcanistXHPASTLinterRule', @@ -1237,7 +1182,6 @@ 'ArcanistCommitUpstreamHardpointLoader' => 'ArcanistHardpointLoader', 'ArcanistCommitWorkflow' => 'ArcanistWorkflow', 'ArcanistCompilerLintRenderer' => 'ArcanistLintRenderer', - 'ArcanistComposerLinter' => 'ArcanistLinter', 'ArcanistComprehensiveLintEngine' => 'ArcanistLintEngine', 'ArcanistConcatenationOperatorXHPASTLinterRule' => 'ArcanistXHPASTLinterRule', 'ArcanistConcatenationOperatorXHPASTLinterRuleTestCase' => 'ArcanistXHPASTLinterRuleTestCase', @@ -1259,10 +1203,6 @@ 'ArcanistControlStatementSpacingXHPASTLinterRule' => 'ArcanistXHPASTLinterRule', 'ArcanistControlStatementSpacingXHPASTLinterRuleTestCase' => 'ArcanistXHPASTLinterRuleTestCase', 'ArcanistCoverWorkflow' => 'ArcanistWorkflow', - 'ArcanistCppcheckLinter' => 'ArcanistExternalLinter', - 'ArcanistCppcheckLinterTestCase' => 'ArcanistExternalLinterTestCase', - 'ArcanistCpplintLinter' => 'ArcanistExternalLinter', - 'ArcanistCpplintLinterTestCase' => 'ArcanistExternalLinterTestCase', 'ArcanistCurlyBraceArrayIndexXHPASTLinterRule' => 'ArcanistXHPASTLinterRule', 'ArcanistCurlyBraceArrayIndexXHPASTLinterRuleTestCase' => 'ArcanistXHPASTLinterRuleTestCase', 'ArcanistDeclarationParenthesesXHPASTLinterRule' => 'ArcanistXHPASTLinterRule', @@ -1306,8 +1246,6 @@ 'ArcanistExitExpressionXHPASTLinterRule' => 'ArcanistXHPASTLinterRule', 'ArcanistExitExpressionXHPASTLinterRuleTestCase' => 'ArcanistXHPASTLinterRuleTestCase', 'ArcanistExportWorkflow' => 'ArcanistWorkflow', - 'ArcanistExternalLinter' => 'ArcanistFutureLinter', - 'ArcanistExternalLinterTestCase' => 'ArcanistLinterTestCase', 'ArcanistExtractUseXHPASTLinterRule' => 'ArcanistXHPASTLinterRule', 'ArcanistExtractUseXHPASTLinterRuleTestCase' => 'ArcanistXHPASTLinterRuleTestCase', 'ArcanistFeatureWorkflow' => 'ArcanistWorkflow', @@ -1318,13 +1256,10 @@ 'ArcanistFilenameLinterTestCase' => 'ArcanistLinterTestCase', 'ArcanistFilesystemConfigurationSource' => 'ArcanistDictionaryConfigurationSource', 'ArcanistFlagWorkflow' => 'ArcanistWorkflow', - 'ArcanistFlake8Linter' => 'ArcanistExternalLinter', - 'ArcanistFlake8LinterTestCase' => 'ArcanistExternalLinterTestCase', 'ArcanistFormattedStringXHPASTLinterRule' => 'ArcanistXHPASTLinterRule', 'ArcanistFormattedStringXHPASTLinterRuleTestCase' => 'ArcanistXHPASTLinterRuleTestCase', 'ArcanistFunctionCallShouldBeTypeCastXHPASTLinterRule' => 'ArcanistXHPASTLinterRule', 'ArcanistFunctionCallShouldBeTypeCastXHPASTLinterRuleTestCase' => 'ArcanistXHPASTLinterRuleTestCase', - 'ArcanistFutureLinter' => 'ArcanistLinter', 'ArcanistGeneratedLinter' => 'ArcanistLinter', 'ArcanistGeneratedLinterTestCase' => 'ArcanistLinterTestCase', 'ArcanistGetConfigWorkflow' => 'ArcanistWorkflow', @@ -1337,12 +1272,8 @@ 'ArcanistGitWorkingCopy' => 'ArcanistWorkingCopy', 'ArcanistGlobalVariableXHPASTLinterRule' => 'ArcanistXHPASTLinterRule', 'ArcanistGlobalVariableXHPASTLinterRuleTestCase' => 'ArcanistXHPASTLinterRuleTestCase', - 'ArcanistGoLintLinter' => 'ArcanistExternalLinter', - 'ArcanistGoLintLinterTestCase' => 'ArcanistExternalLinterTestCase', 'ArcanistGoTestResultParser' => 'ArcanistTestResultParser', 'ArcanistGoTestResultParserTestCase' => 'PhutilTestCase', - 'ArcanistHLintLinter' => 'ArcanistExternalLinter', - 'ArcanistHLintLinterTestCase' => 'ArcanistExternalLinterTestCase', 'ArcanistHardpointLoader' => 'Phobject', 'ArcanistHelpWorkflow' => 'ArcanistWorkflow', 'ArcanistHexadecimalNumericScalarCasingXHPASTLinterRule' => 'ArcanistXHPASTLinterRule', @@ -1376,16 +1307,10 @@ 'ArcanistInvalidOctalNumericScalarXHPASTLinterRuleTestCase' => 'ArcanistXHPASTLinterRuleTestCase', 'ArcanistIsAShouldBeInstanceOfXHPASTLinterRule' => 'ArcanistXHPASTLinterRule', 'ArcanistIsAShouldBeInstanceOfXHPASTLinterRuleTestCase' => 'ArcanistXHPASTLinterRuleTestCase', - 'ArcanistJSHintLinter' => 'ArcanistExternalLinter', - 'ArcanistJSHintLinterTestCase' => 'ArcanistExternalLinterTestCase', - 'ArcanistJSONLintLinter' => 'ArcanistExternalLinter', - 'ArcanistJSONLintLinterTestCase' => 'ArcanistExternalLinterTestCase', 'ArcanistJSONLintRenderer' => 'ArcanistLintRenderer', 'ArcanistJSONLinter' => 'ArcanistLinter', 'ArcanistJSONLinterTestCase' => 'ArcanistLinterTestCase', 'ArcanistJSONUnitSink' => 'ArcanistUnitSink', - 'ArcanistJscsLinter' => 'ArcanistExternalLinter', - 'ArcanistJscsLinterTestCase' => 'ArcanistExternalLinterTestCase', 'ArcanistKeywordCasingXHPASTLinterRule' => 'ArcanistXHPASTLinterRule', 'ArcanistKeywordCasingXHPASTLinterRuleTestCase' => 'ArcanistXHPASTLinterRuleTestCase', 'ArcanistLambdaFuncFunctionXHPASTLinterRule' => 'ArcanistXHPASTLinterRule', @@ -1394,8 +1319,6 @@ 'ArcanistLandWorkflow' => 'ArcanistWorkflow', 'ArcanistLanguageConstructParenthesesXHPASTLinterRule' => 'ArcanistXHPASTLinterRule', 'ArcanistLanguageConstructParenthesesXHPASTLinterRuleTestCase' => 'ArcanistXHPASTLinterRuleTestCase', - 'ArcanistLesscLinter' => 'ArcanistExternalLinter', - 'ArcanistLesscLinterTestCase' => 'ArcanistExternalLinterTestCase', 'ArcanistLiberateWorkflow' => 'ArcanistWorkflow', 'ArcanistLintEngine' => 'Phobject', 'ArcanistLintMessage' => 'Phobject', @@ -1452,8 +1375,6 @@ 'ArcanistNoneLintRenderer' => 'ArcanistLintRenderer', 'ArcanistObjectOperatorSpacingXHPASTLinterRule' => 'ArcanistXHPASTLinterRule', 'ArcanistObjectOperatorSpacingXHPASTLinterRuleTestCase' => 'ArcanistXHPASTLinterRuleTestCase', - 'ArcanistPEP8Linter' => 'ArcanistExternalLinter', - 'ArcanistPEP8LinterTestCase' => 'ArcanistExternalLinterTestCase', 'ArcanistPHPCloseTagXHPASTLinterRule' => 'ArcanistXHPASTLinterRule', 'ArcanistPHPCloseTagXHPASTLinterRuleTestCase' => 'ArcanistXHPASTLinterRuleTestCase', 'ArcanistPHPCompatibilityXHPASTLinterRule' => 'ArcanistXHPASTLinterRule', @@ -1475,10 +1396,6 @@ 'ArcanistPasteWorkflow' => 'ArcanistWorkflow', 'ArcanistPatchWorkflow' => 'ArcanistWorkflow', 'ArcanistPhageToolset' => 'ArcanistToolset', - 'ArcanistPhpLinter' => 'ArcanistExternalLinter', - 'ArcanistPhpLinterTestCase' => 'ArcanistExternalLinterTestCase', - 'ArcanistPhpcsLinter' => 'ArcanistExternalLinter', - 'ArcanistPhpcsLinterTestCase' => 'ArcanistExternalLinterTestCase', 'ArcanistPhpunitTestResultParser' => 'ArcanistTestResultParser', 'ArcanistPhrequentWorkflow' => 'ArcanistWorkflow', 'ArcanistPhutilLibraryLinter' => 'ArcanistLinter', @@ -1493,12 +1410,6 @@ 'ArcanistPromptsWorkflow' => 'ArcanistWorkflow', 'ArcanistPublicPropertyXHPASTLinterRule' => 'ArcanistXHPASTLinterRule', 'ArcanistPublicPropertyXHPASTLinterRuleTestCase' => 'ArcanistXHPASTLinterRuleTestCase', - 'ArcanistPuppetLintLinter' => 'ArcanistExternalLinter', - 'ArcanistPuppetLintLinterTestCase' => 'ArcanistExternalLinterTestCase', - 'ArcanistPyFlakesLinter' => 'ArcanistExternalLinter', - 'ArcanistPyFlakesLinterTestCase' => 'ArcanistExternalLinterTestCase', - 'ArcanistPyLintLinter' => 'ArcanistExternalLinter', - 'ArcanistPyLintLinterTestCase' => 'ArcanistExternalLinterTestCase', 'ArcanistRaggedClassTreeEdgeXHPASTLinterRule' => 'ArcanistXHPASTLinterRule', 'ArcanistRaggedClassTreeEdgeXHPASTLinterRuleTestCase' => 'ArcanistXHPASTLinterRuleTestCase', 'ArcanistRef' => 'Phobject', @@ -1516,13 +1427,8 @@ 'ArcanistRevertWorkflow' => 'ArcanistWorkflow', 'ArcanistRevisionRef' => 'ArcanistRef', 'ArcanistRevisionRefSource' => 'Phobject', - 'ArcanistRuboCopLinter' => 'ArcanistExternalLinter', - 'ArcanistRuboCopLinterTestCase' => 'ArcanistExternalLinterTestCase', - 'ArcanistRubyLinter' => 'ArcanistExternalLinter', - 'ArcanistRubyLinterTestCase' => 'ArcanistExternalLinterTestCase', 'ArcanistRuntimeConfigurationSource' => 'ArcanistDictionaryConfigurationSource', 'ArcanistScalarConfigOption' => 'ArcanistConfigOption', - 'ArcanistScriptAndRegexLinter' => 'ArcanistLinter', 'ArcanistSelfClassReferenceXHPASTLinterRule' => 'ArcanistXHPASTLinterRule', 'ArcanistSelfClassReferenceXHPASTLinterRuleTestCase' => 'ArcanistXHPASTLinterRuleTestCase', 'ArcanistSelfMemberReferenceXHPASTLinterRule' => 'ArcanistXHPASTLinterRule', @@ -1620,8 +1526,6 @@ 'ArcanistXHPASTLinterRule' => 'Phobject', 'ArcanistXHPASTLinterRuleTestCase' => 'ArcanistLinterTestCase', 'ArcanistXHPASTLinterTestCase' => 'ArcanistLinterTestCase', - 'ArcanistXMLLinter' => 'ArcanistLinter', - 'ArcanistXMLLinterTestCase' => 'ArcanistLinterTestCase', 'ArcanistXUnitTestResultParser' => 'Phobject', 'BaseHTTPFuture' => 'Future', 'CaseInsensitiveArray' => 'PhutilArray', diff --git a/src/lint/linter/ArcanistCSSLintLinter.php b/src/lint/linter/ArcanistCSSLintLinter.php deleted file mode 100644 --- a/src/lint/linter/ArcanistCSSLintLinter.php +++ /dev/null @@ -1,127 +0,0 @@ -getExecutableCommand()); - - $matches = array(); - if (preg_match('/^v(?P\d+\.\d+\.\d+)$/', $stdout, $matches)) { - return $matches['version']; - } else { - return false; - } - } - - public function getInstallInstructions() { - return pht( - 'Install %s using `%s`.', 'CSSLint', - 'npm install -g csslint'); - } - - protected function parseLinterOutput($path, $err, $stdout, $stderr) { - $report_dom = new DOMDocument(); - $ok = @$report_dom->loadXML($stdout); - - if (!$ok) { - return false; - } - - $files = $report_dom->getElementsByTagName('file'); - $messages = array(); - - foreach ($files as $file) { - foreach ($file->childNodes as $child) { - $line = $child->getAttribute('line'); - $char = $child->getAttribute('char'); - $original_text = $child->getAttribute('evidence'); - - if ($line === '') { - $line = null; - } - - if ($char === '') { - $char = null; - } else { - $original_text = substr($original_text, $char - 1); - } - - $message = id(new ArcanistLintMessage()) - ->setPath($path) - ->setLine($line) - ->setChar($char) - ->setCode($this->getLinterName()) - ->setName($this->getLinterName()) - ->setDescription($child->getAttribute('reason')) - ->setOriginalText($original_text); - - switch ($child->getAttribute('severity')) { - case 'error': - $message->setSeverity(ArcanistLintSeverity::SEVERITY_ERROR); - break; - - case 'warning': - $message->setSeverity(ArcanistLintSeverity::SEVERITY_WARNING); - break; - - default: - $message->setSeverity(ArcanistLintSeverity::SEVERITY_ERROR); - break; - } - - $messages[] = $message; - } - } - - return $messages; - } - - protected function getLintCodeFromLinterConfigurationKey($code) { - // NOTE: We can't figure out which rule generated each message, so we - // can not customize severities. I opened a pull request to add this - // ability; see: - // - // https://github.com/stubbornella/csslint/pull/409 - throw new Exception( - pht( - "%s does not currently support custom severity levels, because ". - "rules can't be identified from messages in output.", - 'CSSLint')); - } - -} diff --git a/src/lint/linter/ArcanistCSharpLinter.php b/src/lint/linter/ArcanistCSharpLinter.php deleted file mode 100644 --- a/src/lint/linter/ArcanistCSharpLinter.php +++ /dev/null @@ -1,261 +0,0 @@ - 'map>', - 'help' => pht('Provide a discovery map.'), - ); - - - // TODO: This should probably be replaced with "bin" when this moves - // to extend ExternalLinter. - - $options['binary'] = array( - 'type' => 'string', - 'help' => pht('Override default binary.'), - ); - - return $options; - } - - public function setLinterConfigurationValue($key, $value) { - switch ($key) { - case 'discovery': - $this->discoveryMap = $value; - return; - case 'binary': - $this->cslintHintPath = $value; - return; - } - parent::setLinterConfigurationValue($key, $value); - } - - protected function getLintCodeFromLinterConfigurationKey($code) { - return $code; - } - - public function setCustomSeverityMap(array $map) { - foreach ($map as $code => $severity) { - if (substr($code, 0, 2) === 'SA' && $severity == 'disabled') { - throw new Exception( - pht( - "In order to keep StyleCop integration with IDEs and other tools ". - "consistent with Arcanist results, you aren't permitted to ". - "disable StyleCop rules within '%s'. Instead configure the ". - "severity using the StyleCop settings dialog (usually accessible ". - "from within your IDE). StyleCop settings for your project will ". - "be used when linting for Arcanist.", - '.arclint')); - } - } - return parent::setCustomSeverityMap($map); - } - - /** - * Determines what executables and lint paths to use. Between platforms - * this also changes whether the lint engine is run under .NET or Mono. It - * also ensures that all of the required binaries are available for the lint - * to run successfully. - * - * @return void - */ - private function loadEnvironment() { - if ($this->loaded) { - return; - } - - // Determine runtime engine (.NET or Mono). - if (phutil_is_windows()) { - $this->runtimeEngine = ''; - } else if (Filesystem::binaryExists('mono')) { - $this->runtimeEngine = 'mono '; - } else { - throw new Exception( - pht('Unable to find Mono and you are not on Windows!')); - } - - // Determine cslint path. - $cslint = $this->cslintHintPath; - if ($cslint !== null && file_exists($cslint)) { - $this->cslintEngine = Filesystem::resolvePath($cslint); - } else if (Filesystem::binaryExists('cslint.exe')) { - $this->cslintEngine = 'cslint.exe'; - } else { - throw new Exception(pht('Unable to locate %s.', 'cslint')); - } - - // Determine cslint version. - $ver_future = new ExecFuture( - '%C -v', - $this->runtimeEngine.$this->cslintEngine); - list($err, $stdout, $stderr) = $ver_future->resolve(); - if ($err !== 0) { - throw new Exception( - pht( - 'You are running an old version of %s. Please '. - 'upgrade to version %s.', - 'cslint', - self::SUPPORTED_VERSION)); - } - $ver = (int)$stdout; - if ($ver < self::SUPPORTED_VERSION) { - throw new Exception( - pht( - 'You are running an old version of %s. Please '. - 'upgrade to version %s.', - 'cslint', - self::SUPPORTED_VERSION)); - } else if ($ver > self::SUPPORTED_VERSION) { - throw new Exception( - pht( - 'Arcanist does not support this version of %s (it is newer). '. - 'You can try upgrading Arcanist with `%s`.', - 'cslint', - 'arc upgrade')); - } - - $this->loaded = true; - } - - public function lintPath($path) {} - - public function willLintPaths(array $paths) { - $this->loadEnvironment(); - - $futures = array(); - - // Bulk linting up into futures, where the number of files - // is based on how long the command is. - $current_paths = array(); - foreach ($paths as $path) { - // If the current paths for the command, plus the next path - // is greater than 6000 characters (less than the Windows - // command line limit), then finalize this future and add it. - $total = 0; - foreach ($current_paths as $current_path) { - $total += strlen($current_path) + 3; // Quotes and space. - } - if ($total + strlen($path) > 6000) { - // %s won't pass through the JSON correctly - // under Windows. This is probably because not only - // does the JSON have quotation marks in the content, - // but because there'll be a lot of escaping and - // double escaping because the JSON also contains - // regular expressions. cslint supports passing the - // settings JSON through base64-encoded to mitigate - // this issue. - $futures[] = new ExecFuture( - '%C --settings-base64=%s -r=. %Ls', - $this->runtimeEngine.$this->cslintEngine, - base64_encode(json_encode($this->discoveryMap)), - $current_paths); - $current_paths = array(); - } - - // Append the path to the current paths array. - $current_paths[] = $this->getEngine()->getFilePathOnDisk($path); - } - - // If we still have paths left in current paths, then we need to create - // a future for those too. - if (count($current_paths) > 0) { - $futures[] = new ExecFuture( - '%C --settings-base64=%s -r=. %Ls', - $this->runtimeEngine.$this->cslintEngine, - base64_encode(json_encode($this->discoveryMap)), - $current_paths); - $current_paths = array(); - } - - $this->futures = $futures; - } - - public function didLintPaths(array $paths) { - if ($this->futures) { - $futures = id(new FutureIterator($this->futures)) - ->limit(8); - foreach ($futures as $future) { - $this->resolveFuture($future); - } - $this->futures = array(); - } - } - - protected function resolveFuture(Future $future) { - list($stdout) = $future->resolvex(); - $all_results = json_decode($stdout); - foreach ($all_results as $results) { - if ($results === null || $results->Issues === null) { - return; - } - foreach ($results->Issues as $issue) { - $message = new ArcanistLintMessage(); - $message->setPath($results->FileName); - $message->setLine($issue->LineNumber); - $message->setCode($issue->Index->Code); - $message->setName($issue->Index->Name); - $message->setChar($issue->Column); - $message->setOriginalText($issue->OriginalText); - $message->setReplacementText($issue->ReplacementText); - $desc = @vsprintf($issue->Index->Message, $issue->Parameters); - if ($desc === false) { - $desc = $issue->Index->Message; - } - $message->setDescription($desc); - $severity = ArcanistLintSeverity::SEVERITY_ADVICE; - switch ($issue->Index->Severity) { - case 0: - $severity = ArcanistLintSeverity::SEVERITY_ADVICE; - break; - case 1: - $severity = ArcanistLintSeverity::SEVERITY_AUTOFIX; - break; - case 2: - $severity = ArcanistLintSeverity::SEVERITY_WARNING; - break; - case 3: - $severity = ArcanistLintSeverity::SEVERITY_ERROR; - break; - case 4: - $severity = ArcanistLintSeverity::SEVERITY_DISABLED; - break; - } - $severity_override = $this->getLintMessageSeverity($issue->Index->Code); - if ($severity_override !== null) { - $severity = $severity_override; - } - $message->setSeverity($severity); - $this->addLintMessage($message); - } - } - } - - protected function getDefaultMessageSeverity($code) { - return null; - } - -} diff --git a/src/lint/linter/ArcanistClosureLinter.php b/src/lint/linter/ArcanistClosureLinter.php deleted file mode 100644 --- a/src/lint/linter/ArcanistClosureLinter.php +++ /dev/null @@ -1,62 +0,0 @@ -setPath($path) - ->setLine($matches[1]) - ->setName('GJSLINT'.$matches[2]) - ->setSeverity(ArcanistLintSeverity::SEVERITY_ERROR) - ->setCode($this->getLinterName().$matches[2]) - ->setDescription($matches[3]); - $messages[] = $message; - } - - return $messages; - } - -} diff --git a/src/lint/linter/ArcanistCoffeeLintLinter.php b/src/lint/linter/ArcanistCoffeeLintLinter.php deleted file mode 100644 --- a/src/lint/linter/ArcanistCoffeeLintLinter.php +++ /dev/null @@ -1,135 +0,0 @@ -getExecutableCommand()); - - $matches = array(); - if (preg_match('/^(?P\d+\.\d+\.\d+)$/', $stdout, $matches)) { - return $matches['version']; - } else { - return false; - } - } - - public function getInstallInstructions() { - return pht( - 'Install CoffeeLint using `%s`.', - 'npm install -g coffeelint'); - } - - protected function getMandatoryFlags() { - $options = array( - '--reporter=raw', - ); - - if ($this->config) { - $options[] = '--file='.$this->config; - } - - return $options; - } - - public function getLinterConfigurationOptions() { - $options = array( - 'coffeelint.config' => array( - 'type' => 'optional string', - 'help' => pht('A custom configuration file.'), - ), - ); - - return $options + parent::getLinterConfigurationOptions(); - } - - public function setLinterConfigurationValue($key, $value) { - switch ($key) { - case 'coffeelint.config': - $this->config = $value; - return; - } - - return parent::setLinterConfigurationValue($key, $value); - } - - protected function parseLinterOutput($path, $err, $stdout, $stderr) { - $messages = array(); - $output = phutil_json_decode($stdout); - - // We are only linting a single file. - if (count($output) != 1) { - return false; - } - - foreach ($output as $reports) { - foreach ($reports as $report) { - // Column number is not provided in the output. - // See https://github.com/clutchski/coffeelint/issues/87 - - $message = id(new ArcanistLintMessage()) - ->setPath($path) - ->setLine($report['lineNumber']) - ->setCode($this->getLinterName()) - ->setName(ucwords(str_replace('_', ' ', $report['name']))) - ->setDescription($report['message']) - ->setOriginalText(idx($report, 'line')); - - switch ($report['level']) { - case 'warn': - $message->setSeverity(ArcanistLintSeverity::SEVERITY_WARNING); - break; - - case 'error': - $message->setSeverity(ArcanistLintSeverity::SEVERITY_ERROR); - break; - - default: - $message->setSeverity(ArcanistLintSeverity::SEVERITY_ADVICE); - break; - } - - $messages[] = $message; - } - } - - return $messages; - } - - protected function getLintCodeFromLinterConfigurationKey($code) { - // NOTE: We can't figure out which rule generated each message, so we - // can not customize severities. - throw new Exception( - pht( - "CoffeeLint does not currently support custom severity levels, ". - "because rules can't be identified from messages in output.")); - } - -} diff --git a/src/lint/linter/ArcanistComposerLinter.php b/src/lint/linter/ArcanistComposerLinter.php deleted file mode 100644 --- a/src/lint/linter/ArcanistComposerLinter.php +++ /dev/null @@ -1,55 +0,0 @@ - pht('Lock file out-of-date'), - ); - } - - public function lintPath($path) { - switch (basename($path)) { - case 'composer.json': - $this->lintComposerJson($path); - break; - case 'composer.lock': - break; - } - } - - private function lintComposerJson($path) { - $composer_hash = md5(Filesystem::readFile(dirname($path).'/composer.json')); - $composer_lock = phutil_json_decode( - Filesystem::readFile(dirname($path).'/composer.lock')); - - if ($composer_hash !== $composer_lock['hash']) { - $this->raiseLintAtPath( - self::LINT_OUT_OF_DATE, - pht( - "The '%s' file seems to be out-of-date. ". - "You probably need to run `%s`.", - 'composer.lock', - 'composer update')); - } - } - -} diff --git a/src/lint/linter/ArcanistCppcheckLinter.php b/src/lint/linter/ArcanistCppcheckLinter.php deleted file mode 100644 --- a/src/lint/linter/ArcanistCppcheckLinter.php +++ /dev/null @@ -1,112 +0,0 @@ -getExecutableCommand()); - - $matches = array(); - $regex = '/^Cppcheck (?P\d+\.\d+)$/'; - if (preg_match($regex, $stdout, $matches)) { - return $matches['version']; - } else { - return false; - } - } - - public function getInstallInstructions() { - return pht( - 'Install Cppcheck using `%s` or similar.', - 'apt-get install cppcheck'); - } - - protected function getDefaultFlags() { - return array( - '-j2', - '--enable=performance,style,portability,information', - ); - } - - protected function getMandatoryFlags() { - return array( - '--quiet', - '--inline-suppr', - '--xml', - '--xml-version=2', - ); - } - - public function shouldExpectCommandErrors() { - return false; - } - - protected function parseLinterOutput($path, $err, $stdout, $stderr) { - $dom = new DOMDocument(); - $ok = @$dom->loadXML($stderr); - - if (!$ok) { - return false; - } - - $errors = $dom->getElementsByTagName('error'); - $messages = array(); - foreach ($errors as $error) { - foreach ($error->getElementsByTagName('location') as $location) { - $message = new ArcanistLintMessage(); - $message->setPath($location->getAttribute('file')); - $message->setLine($location->getAttribute('line')); - $message->setCode('Cppcheck'); - $message->setName($error->getAttribute('id')); - $message->setDescription($error->getAttribute('msg')); - - switch ($error->getAttribute('severity')) { - case 'error': - $message->setSeverity(ArcanistLintSeverity::SEVERITY_ERROR); - break; - - default: - if ($error->getAttribute('inconclusive')) { - $message->setSeverity(ArcanistLintSeverity::SEVERITY_ADVICE); - } else { - $message->setSeverity(ArcanistLintSeverity::SEVERITY_WARNING); - } - break; - } - - $messages[] = $message; - } - } - - return $messages; - } - -} diff --git a/src/lint/linter/ArcanistCpplintLinter.php b/src/lint/linter/ArcanistCpplintLinter.php deleted file mode 100644 --- a/src/lint/linter/ArcanistCpplintLinter.php +++ /dev/null @@ -1,77 +0,0 @@ - $match) { - $matches[$key] = trim($match); - } - - $severity = $this->getLintMessageSeverity($matches[3]); - - $message = new ArcanistLintMessage(); - $message->setPath($path); - $message->setLine($matches[1]); - $message->setCode($matches[3]); - $message->setName($matches[3]); - $message->setDescription($matches[2]); - $message->setSeverity($severity); - - $messages[] = $message; - } - - return $messages; - } - - protected function getLintCodeFromLinterConfigurationKey($code) { - if (!preg_match('@^[a-z_]+/[a-z0-9_+]+$@', $code)) { - throw new Exception( - pht( - 'Unrecognized lint message code "%s". Expected a valid cpplint '. - 'lint code like "%s" or "%s".', - $code, - 'build/include_order', - 'whitespace/braces')); - } - - return $code; - } - -} diff --git a/src/lint/linter/ArcanistExternalLinter.php b/src/lint/linter/ArcanistExternalLinter.php deleted file mode 100644 --- a/src/lint/linter/ArcanistExternalLinter.php +++ /dev/null @@ -1,570 +0,0 @@ - Mandatory flags, like `"--format=xml"`. - * @task bin - */ - protected function getMandatoryFlags() { - return array(); - } - - /** - * Provide default, overridable flags to the linter. Generally these are - * configuration flags which affect behavior but aren't critical. Flags - * which are required should be provided in @{method:getMandatoryFlags} - * instead. - * - * Default flags can be overridden with @{method:setFlags}. - * - * @return list Overridable default flags. - * @task bin - */ - protected function getDefaultFlags() { - return array(); - } - - /** - * Override default flags with custom flags. If not overridden, flags provided - * by @{method:getDefaultFlags} are used. - * - * @param list New flags. - * @return this - * @task bin - */ - final public function setFlags(array $flags) { - $this->flags = $flags; - return $this; - } - - /** - * Set the binary's version requirement. - * - * @param string Version requirement. - * @return this - * @task bin - */ - final public function setVersionRequirement($version) { - $this->versionRequirement = trim($version); - return $this; - } - - /** - * Return the binary or script to execute. This method synthesizes defaults - * and configuration. You can override the binary with @{method:setBinary}. - * - * @return string Binary to execute. - * @task bin - */ - final public function getBinary() { - return coalesce($this->bin, $this->getDefaultBinary()); - } - - /** - * Override the default binary with a new one. - * - * @param string New binary. - * @return this - * @task bin - */ - final public function setBinary($bin) { - $this->bin = $bin; - return $this; - } - - /** - * Return true if this linter should use an interpreter (like "python" or - * "node") in addition to the script. - * - * After overriding this method to return `true`, override - * @{method:getDefaultInterpreter} to set a default. - * - * @return bool True to use an interpreter. - * @task bin - */ - public function shouldUseInterpreter() { - return false; - } - - /** - * Return the default interpreter, like "python" or "node". This method is - * only invoked if @{method:shouldUseInterpreter} has been overridden to - * return `true`. - * - * @return string Default interpreter. - * @task bin - */ - public function getDefaultInterpreter() { - throw new PhutilMethodNotImplementedException(); - } - - /** - * Get the effective interpreter. This method synthesizes configuration and - * defaults. - * - * @return string Effective interpreter. - * @task bin - */ - final public function getInterpreter() { - return coalesce($this->interpreter, $this->getDefaultInterpreter()); - } - - /** - * Set the interpreter, overriding any default. - * - * @param string New interpreter. - * @return this - * @task bin - */ - final public function setInterpreter($interpreter) { - $this->interpreter = $interpreter; - return $this; - } - - -/* -( Parsing Linter Output )---------------------------------------------- */ - - /** - * Parse the output of the external lint program into objects of class - * @{class:ArcanistLintMessage} which `arc` can consume. Generally, this - * means examining the output and converting each warning or error into a - * message. - * - * If parsing fails, returning `false` will cause the caller to throw an - * appropriate exception. (You can also throw a more specific exception if - * you're able to detect a more specific condition.) Otherwise, return a list - * of messages. - * - * @param string Path to the file being linted. - * @param int Exit code of the linter. - * @param string Stdout of the linter. - * @param string Stderr of the linter. - * @return list|false List of lint messages, or false - * to indicate parser failure. - * @task parse - */ - abstract protected function parseLinterOutput($path, $err, $stdout, $stderr); - - -/* -( Executing the Linter )----------------------------------------------- */ - - /** - * Check that the binary and interpreter (if applicable) exist, and throw - * an exception with a message about how to install them if they do not. - * - * @return void - */ - final public function checkBinaryConfiguration() { - $interpreter = null; - if ($this->shouldUseInterpreter()) { - $interpreter = $this->getInterpreter(); - } - - $binary = $this->getBinary(); - - // NOTE: If we have an interpreter, we don't require the script to be - // executable (so we just check that the path exists). Otherwise, the - // binary must be executable. - - if ($interpreter) { - if (!Filesystem::binaryExists($interpreter)) { - throw new ArcanistMissingLinterException( - pht( - 'Unable to locate interpreter "%s" to run linter %s. You may need '. - 'to install the interpreter, or adjust your linter configuration.', - $interpreter, - get_class($this))); - } - if (!Filesystem::pathExists($binary)) { - throw new ArcanistMissingLinterException( - sprintf( - "%s\n%s", - pht( - 'Unable to locate script "%s" to run linter %s. You may need '. - 'to install the script, or adjust your linter configuration.', - $binary, - get_class($this)), - pht( - 'TO INSTALL: %s', - $this->getInstallInstructions()))); - } - } else { - if (!Filesystem::binaryExists($binary)) { - throw new ArcanistMissingLinterException( - sprintf( - "%s\n%s", - pht( - 'Unable to locate binary "%s" to run linter %s. You may need '. - 'to install the binary, or adjust your linter configuration.', - $binary, - get_class($this)), - pht( - 'TO INSTALL: %s', - $this->getInstallInstructions()))); - } - } - } - - /** - * If a binary version requirement has been specified, compare the version - * of the configured binary to the required version, and if the binary's - * version is not supported, throw an exception. - * - * @param string Version string to check. - * @return void - */ - final protected function checkBinaryVersion($version) { - if (!$this->versionRequirement) { - return; - } - - if (!$version) { - $message = pht( - 'Linter %s requires %s version %s. Unable to determine the version '. - 'that you have installed.', - get_class($this), - $this->getBinary(), - $this->versionRequirement); - - $instructions = $this->getUpgradeInstructions(); - if ($instructions) { - $message .= "\n".pht('TO UPGRADE: %s', $instructions); - } - - throw new ArcanistMissingLinterException($message); - } - - $operator = '=='; - $compare_to = $this->versionRequirement; - - $matches = null; - if (preg_match('/^([<>]=?|=)\s*(.*)$/', $compare_to, $matches)) { - $operator = $matches[1]; - $compare_to = $matches[2]; - if ($operator === '=') { - $operator = '=='; - } - } - - if (!version_compare($version, $compare_to, $operator)) { - $message = pht( - 'Linter %s requires %s version %s. You have version %s.', - get_class($this), - $this->getBinary(), - $this->versionRequirement, - $version); - - $instructions = $this->getUpgradeInstructions(); - if ($instructions) { - $message .= "\n".pht('TO UPGRADE: %s', $instructions); - } - - throw new ArcanistMissingLinterException($message); - } - } - - /** - * Get the composed executable command, including the interpreter and binary - * but without flags or paths. This can be used to execute `--version` - * commands. - * - * @return string Command to execute the raw linter. - * @task exec - */ - final protected function getExecutableCommand() { - $this->checkBinaryConfiguration(); - - $interpreter = null; - if ($this->shouldUseInterpreter()) { - $interpreter = $this->getInterpreter(); - } - - $binary = $this->getBinary(); - - if ($interpreter) { - $bin = csprintf('%s %s', $interpreter, $binary); - } else { - $bin = csprintf('%s', $binary); - } - - return $bin; - } - - /** - * Get the composed flags for the executable, including both mandatory and - * configured flags. - * - * @return list Composed flags. - * @task exec - */ - final protected function getCommandFlags() { - return array_merge( - $this->getMandatoryFlags(), - nonempty($this->flags, $this->getDefaultFlags())); - } - - public function getCacheVersion() { - try { - $this->checkBinaryConfiguration(); - } catch (ArcanistMissingLinterException $e) { - return null; - } - - $version = $this->getVersion(); - - if ($version) { - $this->checkBinaryVersion($version); - return $version.'-'.json_encode($this->getCommandFlags()); - } else { - // Either we failed to parse the version number or the `getVersion` - // function hasn't been implemented. - return json_encode($this->getCommandFlags()); - } - } - - /** - * Prepare the path to be added to the command string. - * - * This method is expected to return an already escaped string. - * - * @param string Path to the file being linted - * @return string The command-ready file argument - */ - protected function getPathArgumentForLinterFuture($path) { - return csprintf('%s', $path); - } - - final protected function buildFutures(array $paths) { - $executable = $this->getExecutableCommand(); - - $bin = csprintf('%C %Ls', $executable, $this->getCommandFlags()); - - $futures = array(); - foreach ($paths as $path) { - $disk_path = $this->getEngine()->getFilePathOnDisk($path); - $path_argument = $this->getPathArgumentForLinterFuture($disk_path); - $future = new ExecFuture('%C %C', $bin, $path_argument); - - $future->setCWD($this->getProjectRoot()); - $futures[$path] = $future; - } - - return $futures; - } - - final protected function resolveFuture($path, Future $future) { - list($err, $stdout, $stderr) = $future->resolve(); - if ($err && !$this->shouldExpectCommandErrors()) { - $future->resolvex(); - } - - $messages = $this->parseLinterOutput($path, $err, $stdout, $stderr); - - if ($err && $this->shouldExpectCommandErrors() && !$messages) { - // We assume that if the future exits with a non-zero status and we - // failed to parse any linter messages, then something must've gone wrong - // during parsing. - $messages = false; - } - - if ($messages === false) { - if ($err) { - $future->resolvex(); - } else { - throw new Exception( - sprintf( - "%s\n\nSTDOUT\n%s\n\nSTDERR\n%s", - pht('Linter failed to parse output!'), - $stdout, - $stderr)); - } - } - - foreach ($messages as $message) { - $this->addLintMessage($message); - } - } - - public function getLinterConfigurationOptions() { - $options = array( - 'bin' => array( - 'type' => 'optional string | list', - 'help' => pht( - 'Specify a string (or list of strings) identifying the binary '. - 'which should be invoked to execute this linter. This overrides '. - 'the default binary. If you provide a list of possible binaries, '. - 'the first one which exists will be used.'), - ), - 'flags' => array( - 'type' => 'optional list', - 'help' => pht( - 'Provide a list of additional flags to pass to the linter on the '. - 'command line.'), - ), - 'version' => array( - 'type' => 'optional string', - 'help' => pht( - 'Specify a version requirement for the binary. The version number '. - 'may be prefixed with <, <=, >, >=, or = to specify the version '. - 'comparison operator (default: =).'), - ), - ); - - if ($this->shouldUseInterpreter()) { - $options['interpreter'] = array( - 'type' => 'optional string | list', - 'help' => pht( - 'Specify a string (or list of strings) identifying the interpreter '. - 'which should be used to invoke the linter binary. If you provide '. - 'a list of possible interpreters, the first one that exists '. - 'will be used.'), - ); - } - - return $options + parent::getLinterConfigurationOptions(); - } - - public function setLinterConfigurationValue($key, $value) { - switch ($key) { - case 'interpreter': - $root = $this->getProjectRoot(); - - foreach ((array)$value as $path) { - if (Filesystem::binaryExists($path)) { - $this->setInterpreter($path); - return; - } - - $path = Filesystem::resolvePath($path, $root); - - if (Filesystem::binaryExists($path)) { - $this->setInterpreter($path); - return; - } - } - - throw new Exception( - pht('None of the configured interpreters can be located.')); - case 'bin': - $is_script = $this->shouldUseInterpreter(); - - $root = $this->getProjectRoot(); - - foreach ((array)$value as $path) { - if (!$is_script && Filesystem::binaryExists($path)) { - $this->setBinary($path); - return; - } - - $path = Filesystem::resolvePath($path, $root); - if ((!$is_script && Filesystem::binaryExists($path)) || - ($is_script && Filesystem::pathExists($path))) { - $this->setBinary($path); - return; - } - } - - throw new Exception( - pht('None of the configured binaries can be located.')); - case 'flags': - $this->setFlags($value); - return; - case 'version': - $this->setVersionRequirement($value); - return; - } - - return parent::setLinterConfigurationValue($key, $value); - } - - /** - * Map a configuration lint code to an `arc` lint code. Primarily, this is - * intended for validation, but can also be used to normalize case or - * otherwise be more permissive in accepted inputs. - * - * If the code is not recognized, you should throw an exception. - * - * @param string Code specified in configuration. - * @return string Normalized code to use in severity map. - */ - protected function getLintCodeFromLinterConfigurationKey($code) { - return $code; - } - -} diff --git a/src/lint/linter/ArcanistFlake8Linter.php b/src/lint/linter/ArcanistFlake8Linter.php deleted file mode 100644 --- a/src/lint/linter/ArcanistFlake8Linter.php +++ /dev/null @@ -1,117 +0,0 @@ -getExecutableCommand()); - - $matches = array(); - if (preg_match('/^(?P\d+\.\d+(?:\.\d+)?)\b/', $stdout, $matches)) { - return $matches['version']; - } else { - return false; - } - } - - public function getInstallInstructions() { - return pht('Install flake8 using `%s`.', 'pip install flake8'); - } - - protected function parseLinterOutput($path, $err, $stdout, $stderr) { - $lines = phutil_split_lines($stdout, false); - - // stdin:2: W802 undefined name 'foo' # pyflakes - // stdin:3:1: E302 expected 2 blank lines, found 1 # pep8 - $regexp = - '/^(?:.*?):(?P\d+):(?:(?P\d+):)? (?P\S+) (?P.*)$/'; - - $messages = array(); - foreach ($lines as $line) { - $matches = null; - if (!preg_match($regexp, $line, $matches)) { - continue; - } - foreach ($matches as $key => $match) { - $matches[$key] = trim($match); - } - - $message = new ArcanistLintMessage(); - $message->setPath($path); - $message->setLine($matches['line']); - if (!empty($matches['char'])) { - $message->setChar($matches['char']); - } - $message->setCode($matches['code']); - $message->setName($this->getLinterName().' '.$matches['code']); - $message->setDescription($matches['msg']); - $message->setSeverity($this->getLintMessageSeverity($matches['code'])); - - $messages[] = $message; - } - - return $messages; - } - - protected function getDefaultMessageSeverity($code) { - if (preg_match('/^C/', $code)) { - // "C": Cyclomatic complexity - return ArcanistLintSeverity::SEVERITY_ADVICE; - } else if (preg_match('/^W/', $code)) { - // "W": PEP8 Warning - return ArcanistLintSeverity::SEVERITY_WARNING; - } else { - // "E": PEP8 Error - // "F": PyFlakes Error - // or: Flake8 Extension Message - return ArcanistLintSeverity::SEVERITY_ERROR; - } - } - - protected function getLintCodeFromLinterConfigurationKey($code) { - if (!preg_match('/^[A-Z]\d+$/', $code)) { - throw new Exception( - pht( - 'Unrecognized lint message code "%s". Expected a valid flake8 '. - 'lint code like "%s", or "%s", or "%s", or "%s".', - $code, - 'E225', - 'W291', - 'F811', - 'C901')); - } - - return $code; - } - -} diff --git a/src/lint/linter/ArcanistFutureLinter.php b/src/lint/linter/ArcanistFutureLinter.php deleted file mode 100644 --- a/src/lint/linter/ArcanistFutureLinter.php +++ /dev/null @@ -1,56 +0,0 @@ -getFuturesLimit(); - $this->futures = id(new FutureIterator(array()))->limit($limit); - foreach ($this->buildFutures($paths) as $path => $future) { - $this->futures->addFuture($future, $path); - } - } - - final public function lintPath($path) { - return; - } - - final public function didLintPaths(array $paths) { - if (!$this->futures) { - return; - } - - $map = array(); - foreach ($this->futures as $path => $future) { - $this->setActivePath($path); - $this->resolveFuture($path, $future); - $map[$path] = $future; - } - $this->futures = array(); - - $this->didResolveLinterFutures($map); - } - - - /** - * Hook for cleaning up resources. - * - * This is invoked after a block of futures resolve, and allows linters to - * discard or clean up any shared resources they no longer need. - * - * @param map Map of paths to resolved futures. - * @return void - */ - protected function didResolveLinterFutures(array $futures) { - return; - } - -} diff --git a/src/lint/linter/ArcanistGoLintLinter.php b/src/lint/linter/ArcanistGoLintLinter.php deleted file mode 100644 --- a/src/lint/linter/ArcanistGoLintLinter.php +++ /dev/null @@ -1,67 +0,0 @@ -setPath($path); - $message->setLine($matches[1]); - $message->setChar($matches[2]); - $message->setCode($this->getLinterName()); - $message->setName($this->getLinterName()); - $message->setDescription(ucfirst(trim($matches[3]))); - $message->setSeverity(ArcanistLintSeverity::SEVERITY_ADVICE); - - $messages[] = $message; - } - } - - return $messages; - } - -} diff --git a/src/lint/linter/ArcanistHLintLinter.php b/src/lint/linter/ArcanistHLintLinter.php deleted file mode 100644 --- a/src/lint/linter/ArcanistHLintLinter.php +++ /dev/null @@ -1,102 +0,0 @@ -getExecutableCommand()); - - $matches = null; - if (preg_match('@HLint v(.*),@', $stdout, $matches)) { - return $matches[1]; - } - - return null; - } - - protected function parseLinterOutput($path, $err, $stdout, $stderr) { - $json = phutil_json_decode($stdout); - $messages = array(); - foreach ($json as $fix) { - if ($fix === null) { - return; - } - - $message = new ArcanistLintMessage(); - $message->setCode($this->getLinterName()); - $message->setPath($path); - $message->setLine($fix['startLine']); - $message->setChar($fix['startColumn']); - $message->setName($fix['hint']); - $message->setOriginalText($fix['from']); - $message->setReplacementText($fix['to']); - - /* Some improvements may slightly change semantics, so attach - all necessary notes too. */ - $notes = ''; - foreach ($fix['note'] as $note) { - $notes .= phutil_console_format( - ' **%s**: %s.', - pht('NOTE'), - trim($note, '"')); - } - - $message->setDescription( - pht( - 'In module `%s`, declaration `%s`.', - $fix['module'], - $fix['decl']).$notes); - - switch ($fix['severity']) { - case 'Error': - $message->setSeverity(ArcanistLintSeverity::SEVERITY_ERROR); - break; - case 'Warning': - $message->setSeverity(ArcanistLintSeverity::SEVERITY_WARNING); - break; - default: - $message->setSeverity(ArcanistLintSeverity::SEVERITY_ADVICE); - break; - } - - $messages[] = $message; - } - - return $messages; - } -} diff --git a/src/lint/linter/ArcanistJSHintLinter.php b/src/lint/linter/ArcanistJSHintLinter.php deleted file mode 100644 --- a/src/lint/linter/ArcanistJSHintLinter.php +++ /dev/null @@ -1,158 +0,0 @@ -getExecutableCommand()); - - $matches = array(); - $regex = '/^jshint v(?P\d+\.\d+\.\d+)$/'; - if (preg_match($regex, $stderr, $matches)) { - return $matches['version']; - } else { - return false; - } - } - - public function getInstallInstructions() { - return pht('Install JSHint using `%s`.', 'npm install -g jshint'); - } - - protected function getMandatoryFlags() { - $options = array(); - - $options[] = '--reporter='.dirname(realpath(__FILE__)).'/reporter.js'; - - if ($this->jshintrc) { - $options[] = '--config='.$this->jshintrc; - } - - if ($this->jshintignore) { - $options[] = '--exclude-path='.$this->jshintignore; - } - - return $options; - } - - public function getLinterConfigurationOptions() { - $options = array( - 'jshint.jshintignore' => array( - 'type' => 'optional string', - 'help' => pht('Pass in a custom jshintignore file path.'), - ), - 'jshint.jshintrc' => array( - 'type' => 'optional string', - 'help' => pht('Custom configuration file.'), - ), - ); - - return $options + parent::getLinterConfigurationOptions(); - } - - public function setLinterConfigurationValue($key, $value) { - switch ($key) { - case 'jshint.jshintignore': - $this->jshintignore = $value; - return; - - case 'jshint.jshintrc': - $this->jshintrc = $value; - return; - } - - return parent::setLinterConfigurationValue($key, $value); - } - - protected function parseLinterOutput($path, $err, $stdout, $stderr) { - $errors = null; - try { - $errors = phutil_json_decode($stdout); - } catch (PhutilJSONParserException $ex) { - // Something went wrong and we can't decode the output. Exit abnormally. - throw new PhutilProxyException( - pht('JSHint returned unparseable output.'), - $ex); - } - - $messages = array(); - foreach ($errors as $err) { - $message = new ArcanistLintMessage(); - $message->setPath($path); - $message->setLine(idx($err, 'line')); - $message->setChar(idx($err, 'col')); - $message->setCode(idx($err, 'code')); - $message->setName('JSHint'.idx($err, 'code')); - $message->setDescription(idx($err, 'reason')); - $message->setSeverity($this->getLintMessageSeverity(idx($err, 'code'))); - - $messages[] = $message; - } - - return $messages; - } - - protected function getLintCodeFromLinterConfigurationKey($code) { - if (!preg_match('/^(E|W)\d+$/', $code)) { - throw new Exception( - pht( - 'Unrecognized lint message code "%s". Expected a valid JSHint '. - 'lint code like "%s" or "%s".', - $code, - 'E033', - 'W093')); - } - - return $code; - } - -} diff --git a/src/lint/linter/ArcanistJSONLintLinter.php b/src/lint/linter/ArcanistJSONLintLinter.php deleted file mode 100644 --- a/src/lint/linter/ArcanistJSONLintLinter.php +++ /dev/null @@ -1,86 +0,0 @@ -getExecutableCommand()); - - $matches = array(); - if (preg_match('/^(?P\d+\.\d+\.\d+)$/', $stdout, $matches)) { - return $matches['version']; - } else { - return false; - } - } - - public function getInstallInstructions() { - return pht('Install jsonlint using `%s`.', 'npm install -g jsonlint'); - } - - protected function getMandatoryFlags() { - return array( - '--compact', - ); - } - - protected function parseLinterOutput($path, $err, $stdout, $stderr) { - $lines = phutil_split_lines($stderr, false); - - $messages = array(); - foreach ($lines as $line) { - $matches = null; - $match = preg_match( - '/^(?:(?.+): )?'. - 'line (?\d+), col (?\d+), '. - '(?.*)$/', - $line, - $matches); - - if ($match) { - $message = new ArcanistLintMessage(); - $message->setPath($path); - $message->setLine($matches['line']); - $message->setChar($matches['column']); - $message->setCode($this->getLinterName()); - $message->setName($this->getLinterName()); - $message->setDescription(ucfirst($matches['description'])); - $message->setSeverity(ArcanistLintSeverity::SEVERITY_ERROR); - - $messages[] = $message; - } - } - - return $messages; - } - -} diff --git a/src/lint/linter/ArcanistJscsLinter.php b/src/lint/linter/ArcanistJscsLinter.php deleted file mode 100644 --- a/src/lint/linter/ArcanistJscsLinter.php +++ /dev/null @@ -1,149 +0,0 @@ -getExecutableCommand()); - - $matches = array(); - $regex = '/^(?P\d+\.\d+\.\d+)$/'; - if (preg_match($regex, $stdout, $matches)) { - return $matches['version']; - } else { - return false; - } - } - - public function getInstallInstructions() { - return pht('Install JSCS using `%s`.', 'npm install -g jscs'); - } - - protected function getMandatoryFlags() { - $options = array(); - - $options[] = '--reporter=checkstyle'; - $options[] = '--no-colors'; - - if ($this->config) { - $options[] = '--config='.$this->config; - } - - if ($this->preset) { - $options[] = '--preset='.$this->preset; - } - - return $options; - } - - public function getLinterConfigurationOptions() { - $options = array( - 'jscs.config' => array( - 'type' => 'optional string', - 'help' => pht('Pass in a custom %s file path.', 'jscsrc'), - ), - 'jscs.preset' => array( - 'type' => 'optional string', - 'help' => pht('Custom preset.'), - ), - ); - - return $options + parent::getLinterConfigurationOptions(); - } - - public function setLinterConfigurationValue($key, $value) { - switch ($key) { - case 'jscs.config': - $this->config = $value; - return; - - case 'jscs.preset': - $this->preset = $value; - return; - } - - return parent::setLinterConfigurationValue($key, $value); - } - - protected function parseLinterOutput($path, $err, $stdout, $stderr) { - $report_dom = new DOMDocument(); - $ok = @$report_dom->loadXML($stdout); - - if (!$ok) { - return false; - } - - $messages = array(); - foreach ($report_dom->getElementsByTagName('file') as $file) { - foreach ($file->getElementsByTagName('error') as $error) { - $message = new ArcanistLintMessage(); - $message->setPath($path); - $message->setLine($error->getAttribute('line')); - $message->setChar($error->getAttribute('column')); - $message->setCode('JSCS'); - $message->setName('JSCS'); - $message->setDescription($error->getAttribute('message')); - - switch ($error->getAttribute('severity')) { - case 'error': - $message->setSeverity(ArcanistLintSeverity::SEVERITY_ERROR); - break; - - case 'warning': - $message->setSeverity(ArcanistLintSeverity::SEVERITY_WARNING); - break; - - default: - $message->setSeverity(ArcanistLintSeverity::SEVERITY_ADVICE); - break; - } - - $messages[] = $message; - } - } - - return $messages; - } - - protected function getLintCodeFromLinterConfigurationKey($code) { - - // NOTE: We can't figure out which rule generated each message, so we - // can not customize severities. - // - // See https://github.com/mdevils/node-jscs/issues/224 - - throw new Exception( - pht( - "JSCS does not currently support custom severity levels, because ". - "rules can't be identified from messages in output.")); - } - -} diff --git a/src/lint/linter/ArcanistLesscLinter.php b/src/lint/linter/ArcanistLesscLinter.php deleted file mode 100644 --- a/src/lint/linter/ArcanistLesscLinter.php +++ /dev/null @@ -1,183 +0,0 @@ - array( - 'type' => 'optional bool', - 'help' => pht( - 'Enable strict math, which only processes mathematical expressions '. - 'inside extraneous parentheses.'), - ), - 'lessc.strict-units' => array( - 'type' => 'optional bool', - 'help' => pht('Enable strict handling of units in expressions.'), - ), - ); - } - - public function setLinterConfigurationValue($key, $value) { - switch ($key) { - case 'lessc.strict-math': - $this->strictMath = $value; - return; - case 'lessc.strict-units': - $this->strictUnits = $value; - return; - } - - return parent::setLinterConfigurationValue($key, $value); - } - - public function getLintNameMap() { - return array( - self::LINT_RUNTIME_ERROR => pht('Runtime Error'), - self::LINT_ARGUMENT_ERROR => pht('Argument Error'), - self::LINT_FILE_ERROR => pht('File Error'), - self::LINT_NAME_ERROR => pht('Name Error'), - self::LINT_OPERATION_ERROR => pht('Operation Error'), - self::LINT_PARSE_ERROR => pht('Parse Error'), - self::LINT_SYNTAX_ERROR => pht('Syntax Error'), - ); - } - - public function getDefaultBinary() { - return 'lessc'; - } - - public function getVersion() { - list($stdout) = execx('%C --version', $this->getExecutableCommand()); - - $matches = array(); - $regex = '/^lessc (?P\d+\.\d+\.\d+)\b/'; - if (preg_match($regex, $stdout, $matches)) { - $version = $matches['version']; - } else { - return false; - } - } - - public function getInstallInstructions() { - return pht('Install lessc using `%s`.', 'npm install -g less'); - } - - protected function getMandatoryFlags() { - return array( - '--lint', - '--no-color', - '--strict-math='.($this->strictMath ? 'on' : 'off'), - '--strict-units='.($this->strictUnits ? 'on' : 'off'), - ); - } - - protected function parseLinterOutput($path, $err, $stdout, $stderr) { - $lines = phutil_split_lines($stderr, false); - - $messages = array(); - foreach ($lines as $line) { - $matches = null; - $match = preg_match( - '/^(?P\w+): (?P.+) '. - 'in (?P.+|-) '. - 'on line (?P\d+), column (?P\d+):$/', - $line, - $matches); - - if ($match) { - switch ($matches['name']) { - case 'RuntimeError': - $code = self::LINT_RUNTIME_ERROR; - break; - - case 'ArgumentError': - $code = self::LINT_ARGUMENT_ERROR; - break; - - case 'FileError': - $code = self::LINT_FILE_ERROR; - break; - - case 'NameError': - $code = self::LINT_NAME_ERROR; - break; - - case 'OperationError': - $code = self::LINT_OPERATION_ERROR; - break; - - case 'ParseError': - $code = self::LINT_PARSE_ERROR; - break; - - case 'SyntaxError': - $code = self::LINT_SYNTAX_ERROR; - break; - - default: - throw new RuntimeException( - pht( - 'Unrecognized lint message code "%s".', - $code)); - } - - $code = $this->getLintCodeFromLinterConfigurationKey($matches['name']); - - $message = new ArcanistLintMessage(); - $message->setPath($path); - $message->setLine($matches['line']); - $message->setChar($matches['column']); - $message->setCode($this->getLintMessageFullCode($code)); - $message->setSeverity($this->getLintMessageSeverity($code)); - $message->setName($this->getLintMessageName($code)); - $message->setDescription(ucfirst($matches['description'])); - - $messages[] = $message; - } - } - - return $messages; - } - -} diff --git a/src/lint/linter/ArcanistPEP8Linter.php b/src/lint/linter/ArcanistPEP8Linter.php deleted file mode 100644 --- a/src/lint/linter/ArcanistPEP8Linter.php +++ /dev/null @@ -1,98 +0,0 @@ -getExecutableCommand()); - - $matches = array(); - if (preg_match('/^(?P\d+\.\d+(?:\.\d+)?)\b/', $stdout, $matches)) { - return $matches['version']; - } else { - return false; - } - } - - public function getInstallInstructions() { - return pht('Install PEP8 using `%s`.', 'pip install pep8'); - } - - protected function parseLinterOutput($path, $err, $stdout, $stderr) { - $lines = phutil_split_lines($stdout, false); - - $messages = array(); - foreach ($lines as $line) { - $matches = null; - if (!preg_match('/^(.*?):(\d+):(\d+): (\S+) (.*)$/', $line, $matches)) { - continue; - } - foreach ($matches as $key => $match) { - $matches[$key] = trim($match); - } - $message = new ArcanistLintMessage(); - $message->setPath($path); - $message->setLine($matches[2]); - $message->setChar($matches[3]); - $message->setCode($matches[4]); - $message->setName('PEP8 '.$matches[4]); - $message->setDescription($matches[5]); - $message->setSeverity($this->getLintMessageSeverity($matches[4])); - - $messages[] = $message; - } - - return $messages; - } - - protected function getDefaultMessageSeverity($code) { - if (preg_match('/^W/', $code)) { - return ArcanistLintSeverity::SEVERITY_WARNING; - } else { - return ArcanistLintSeverity::SEVERITY_ERROR; - } - } - - protected function getLintCodeFromLinterConfigurationKey($code) { - if (!preg_match('/^(E|W)\d+$/', $code)) { - throw new Exception( - pht( - 'Unrecognized lint message code "%s". Expected a valid PEP8 '. - 'lint code like "%s" or "%s".', - $code, - 'E101', - 'W291')); - } - - return $code; - } - -} diff --git a/src/lint/linter/ArcanistPhpLinter.php b/src/lint/linter/ArcanistPhpLinter.php deleted file mode 100644 --- a/src/lint/linter/ArcanistPhpLinter.php +++ /dev/null @@ -1,101 +0,0 @@ - pht('Parse Error'), - self::LINT_FATAL_ERROR => pht('Fatal Error'), - ); - } - - protected function getMandatoryFlags() { - return array('-l'); - } - - public function getInstallInstructions() { - return pht('Install PHP.'); - } - - public function getDefaultBinary() { - return 'php'; - } - - public function getVersion() { - list($stdout) = execx( - '%C --run %s', - $this->getExecutableCommand(), - 'echo phpversion();'); - return $stdout; - } - - protected function canCustomizeLintSeverities() { - return false; - } - - protected function parseLinterOutput($path, $err, $stdout, $stderr) { - // Older versions of PHP had both on stdout, newer ones split it. - // Combine stdout and stderr for consistency. - $stdout = $stderr."\n".$stdout; - $matches = array(); - - $regex = '/^(PHP )?(?.+) error: +(?.+) in (?.+) '. - 'on line (?\d+)$/m'; - if (preg_match($regex, $stdout, $matches)) { - $code = $this->getLintCodeFromLinterConfigurationKey($matches['type']); - - $message = id(new ArcanistLintMessage()) - ->setPath($path) - ->setLine($matches['line']) - ->setCode($this->getLinterName().$code) - ->setName($this->getLintMessageName($code)) - ->setSeverity(ArcanistLintSeverity::SEVERITY_ERROR) - ->setDescription($matches['error']); - - // `php -l` only returns the first error. - return array($message); - } - - return array(); - } - - protected function getLintCodeFromLinterConfigurationKey($code) { - switch (phutil_utf8_strtolower($code)) { - case 'parse': - return self::LINT_PARSE_ERROR; - - case 'fatal': - return self::LINT_FATAL_ERROR; - - default: - throw new Exception(pht('Unrecognized lint message code: "%s"', $code)); - } - } - -} diff --git a/src/lint/linter/ArcanistPhpcsLinter.php b/src/lint/linter/ArcanistPhpcsLinter.php deleted file mode 100644 --- a/src/lint/linter/ArcanistPhpcsLinter.php +++ /dev/null @@ -1,150 +0,0 @@ - array( - 'type' => 'optional string', - 'help' => pht('The name or path of the coding standard to use.'), - ), - ); - - return $options + parent::getLinterConfigurationOptions(); - } - - public function setLinterConfigurationValue($key, $value) { - switch ($key) { - case 'phpcs.standard': - $this->standard = $value; - return; - - default: - return parent::setLinterConfigurationValue($key, $value); - } - } - - protected function getMandatoryFlags() { - $options = array('--report=xml'); - - if ($this->standard) { - $options[] = '--standard='.$this->standard; - } - - return $options; - } - - public function getDefaultBinary() { - return 'phpcs'; - } - - public function getVersion() { - list($stdout) = execx('%C --version', $this->getExecutableCommand()); - - $matches = array(); - $regex = '/^PHP_CodeSniffer version (?P\d+\.\d+\.\d+)\b/'; - if (preg_match($regex, $stdout, $matches)) { - return $matches['version']; - } else { - return false; - } - } - - protected function parseLinterOutput($path, $err, $stdout, $stderr) { - // NOTE: Some version of PHPCS after 1.4.6 stopped printing a valid, empty - // XML document to stdout in the case of no errors. If PHPCS exits with - // error 0, just ignore output. - if (!$err) { - return array(); - } - - $report_dom = new DOMDocument(); - $ok = @$report_dom->loadXML($stdout); - if (!$ok) { - return false; - } - - $files = $report_dom->getElementsByTagName('file'); - $messages = array(); - foreach ($files as $file) { - foreach ($file->childNodes as $child) { - if (!($child instanceof DOMElement)) { - continue; - } - - if ($child->tagName == 'error') { - $prefix = 'E'; - } else { - $prefix = 'W'; - } - - $source = $child->getAttribute('source'); - $code = 'PHPCS.'.$prefix.'.'.$source; - - $message = id(new ArcanistLintMessage()) - ->setPath($path) - ->setName($source) - ->setLine($child->getAttribute('line')) - ->setChar($child->getAttribute('column')) - ->setCode($code) - ->setDescription($child->nodeValue) - ->setSeverity($this->getLintMessageSeverity($code)); - - $messages[] = $message; - } - } - - return $messages; - } - - protected function getDefaultMessageSeverity($code) { - if (preg_match('/^PHPCS\\.W\\./', $code)) { - return ArcanistLintSeverity::SEVERITY_WARNING; - } else { - return ArcanistLintSeverity::SEVERITY_ERROR; - } - } - - protected function getLintCodeFromLinterConfigurationKey($code) { - if (!preg_match('/^PHPCS\\.(E|W)\\./', $code)) { - throw new Exception( - pht( - "Invalid severity code '%s', should begin with '%s.'.", - $code, - 'PHPCS')); - } - return $code; - } - -} diff --git a/src/lint/linter/ArcanistPuppetLintLinter.php b/src/lint/linter/ArcanistPuppetLintLinter.php deleted file mode 100644 --- a/src/lint/linter/ArcanistPuppetLintLinter.php +++ /dev/null @@ -1,139 +0,0 @@ -getExecutableCommand()); - - $matches = array(); - $regex = '/^puppet-lint (?P\d+\.\d+\.\d+)$/'; - if (preg_match($regex, $stdout, $matches)) { - return $matches['version']; - } else { - return false; - } - } - - public function getInstallInstructions() { - return pht( - 'Install puppet-lint using `%s`.', - 'gem install puppet-lint'); - } - - protected function getMandatoryFlags() { - return array( - '--error-level=all', - sprintf('--log-format=%s', implode('|', array( - '%{linenumber}', - '%{column}', - '%{kind}', - '%{check}', - '%{message}', - ))), - ); - } - - public function getLinterConfigurationOptions() { - $options = array( - 'puppet-lint.config' => array( - 'type' => 'optional string', - 'help' => pht('Pass in a custom configuration file path.'), - ), - ); - - return $options + parent::getLinterConfigurationOptions(); - } - - public function setLinterConfigurationValue($key, $value) { - switch ($key) { - case 'puppet-lint.config': - $this->config = $value; - return; - - default: - return parent::setLinterConfigurationValue($key, $value); - } - } - - protected function getDefaultFlags() { - $options = array(); - - if ($this->config) { - $options[] = '--config='.$this->config; - } - - return $options; - } - - protected function parseLinterOutput($path, $err, $stdout, $stderr) { - $lines = phutil_split_lines($stdout, false); - $messages = array(); - - foreach ($lines as $line) { - $matches = explode('|', $line, 5); - - if (count($matches) < 5) { - continue; - } - - $message = id(new ArcanistLintMessage()) - ->setPath($path) - ->setLine($matches[0]) - ->setChar($matches[1]) - ->setCode($this->getLinterName()) - ->setName(ucwords(str_replace('_', ' ', $matches[3]))) - ->setDescription(ucfirst($matches[4])); - - switch ($matches[2]) { - case 'warning': - $message->setSeverity(ArcanistLintSeverity::SEVERITY_WARNING); - break; - - case 'error': - $message->setSeverity(ArcanistLintSeverity::SEVERITY_ERROR); - break; - - default: - $message->setSeverity(ArcanistLintSeverity::SEVERITY_ADVICE); - break; - } - - $messages[] = $message; - } - - return $messages; - } - -} diff --git a/src/lint/linter/ArcanistPyFlakesLinter.php b/src/lint/linter/ArcanistPyFlakesLinter.php deleted file mode 100644 --- a/src/lint/linter/ArcanistPyFlakesLinter.php +++ /dev/null @@ -1,88 +0,0 @@ -getExecutableCommand()); - - $matches = array(); - if (preg_match('/^(?P\d+\.\d+\.\d+)$/', $stdout, $matches)) { - return $matches['version']; - } else { - return false; - } - } - - public function getInstallInstructions() { - return pht('Install pyflakes with `%s`.', 'pip install pyflakes'); - } - - protected function parseLinterOutput($path, $err, $stdout, $stderr) { - $lines = phutil_split_lines($stdout, false); - - $messages = array(); - foreach ($lines as $line) { - $matches = null; - if (!preg_match('/^(.*?):(\d+): (.*)$/', $line, $matches)) { - continue; - } - foreach ($matches as $key => $match) { - $matches[$key] = trim($match); - } - - $severity = ArcanistLintSeverity::SEVERITY_WARNING; - $description = $matches[3]; - - $error_regexp = '/(^undefined|^duplicate|before assignment$)/'; - if (preg_match($error_regexp, $description)) { - $severity = ArcanistLintSeverity::SEVERITY_ERROR; - } - - $message = new ArcanistLintMessage(); - $message->setPath($path); - $message->setLine($matches[2]); - $message->setCode($this->getLinterName()); - $message->setName($this->getLinterName()); - $message->setDescription($description); - $message->setSeverity($severity); - - $messages[] = $message; - } - - return $messages; - } - - protected function canCustomizeLintSeverities() { - return false; - } - -} diff --git a/src/lint/linter/ArcanistPyLintLinter.php b/src/lint/linter/ArcanistPyLintLinter.php deleted file mode 100644 --- a/src/lint/linter/ArcanistPyLintLinter.php +++ /dev/null @@ -1,183 +0,0 @@ -getExecutableCommand()); - - $matches = array(); - $regex = '/^pylint (?P\d+\.\d+\.\d+),/'; - if (preg_match($regex, $stdout, $matches)) { - return $matches['version']; - } else { - return false; - } - } - - public function getInstallInstructions() { - return pht( - 'Install PyLint using `%s`.', - 'pip install pylint'); - } - - public function shouldExpectCommandErrors() { - return true; - } - - public function getLinterConfigurationOptions() { - $options = array( - 'pylint.config' => array( - 'type' => 'optional string', - 'help' => pht('Pass in a custom configuration file path.'), - ), - ); - - return $options + parent::getLinterConfigurationOptions(); - } - - public function setLinterConfigurationValue($key, $value) { - switch ($key) { - case 'pylint.config': - $this->config = $value; - return; - - default: - return parent::setLinterConfigurationValue($key, $value); - } - } - - protected function getMandatoryFlags() { - $options = array(); - - $options[] = '--reports=no'; - $options[] = '--msg-template={line}|{column}|{msg_id}|{symbol}|{msg}'; - - // Specify an `--rcfile`, either absolute or relative to the project root. - // Stupidly, the command line args above are overridden by rcfile, so be - // careful. - $config = $this->config; - if ($config !== null) { - $options[] = '--rcfile='.$config; - } - - return $options; - } - - protected function getDefaultFlags() { - $options = array(); - - $installed_version = $this->getVersion(); - $minimum_version = '1.0.0'; - if (version_compare($installed_version, $minimum_version, '<')) { - throw new ArcanistMissingLinterException( - pht( - '%s is not compatible with the installed version of pylint. '. - 'Minimum version: %s; installed version: %s.', - __CLASS__, - $minimum_version, - $installed_version)); - } - - return $options; - } - - protected function parseLinterOutput($path, $err, $stdout, $stderr) { - if ($err === 32) { - // According to `man pylint` the exit status of 32 means there was a - // usage error. That's bad, so actually exit abnormally. - return false; - } - - $lines = phutil_split_lines($stdout, false); - $messages = array(); - - foreach ($lines as $line) { - $matches = explode('|', $line, 5); - - if (count($matches) < 5) { - continue; - } - - // NOTE: PyLint sometimes returns -1 as the character offset for a - // message. If it does, treat it as 0. See T9257. - $char = (int)$matches[1]; - $char = max(0, $char); - - $message = id(new ArcanistLintMessage()) - ->setPath($path) - ->setLine($matches[0]) - ->setChar($char) - ->setCode($matches[2]) - ->setSeverity($this->getLintMessageSeverity($matches[2])) - ->setName(ucwords(str_replace('-', ' ', $matches[3]))) - ->setDescription($matches[4]); - - $messages[] = $message; - } - - return $messages; - } - - protected function getDefaultMessageSeverity($code) { - switch (substr($code, 0, 1)) { - case 'R': - case 'C': - return ArcanistLintSeverity::SEVERITY_ADVICE; - case 'W': - return ArcanistLintSeverity::SEVERITY_WARNING; - case 'E': - case 'F': - return ArcanistLintSeverity::SEVERITY_ERROR; - default: - return ArcanistLintSeverity::SEVERITY_DISABLED; - } - } - - protected function getLintCodeFromLinterConfigurationKey($code) { - if (!preg_match('/^(R|C|W|E|F)\d{4}$/', $code)) { - throw new Exception( - pht( - 'Unrecognized lint message code "%s". Expected a valid Pylint '. - 'lint code like "%s", or "%s", or "%s".', - $code, - 'C0111', - 'E0602', - 'W0611')); - } - - return $code; - } - -} diff --git a/src/lint/linter/ArcanistRuboCopLinter.php b/src/lint/linter/ArcanistRuboCopLinter.php deleted file mode 100644 --- a/src/lint/linter/ArcanistRuboCopLinter.php +++ /dev/null @@ -1,120 +0,0 @@ -getExecutableCommand()); - - $matches = array(); - if (preg_match('/^(?P\d+\.\d+\.\d+)$/', $stdout, $matches)) { - return $matches['version']; - } else { - return false; - } - } - - public function getInstallInstructions() { - return pht('Install RuboCop using `%s`.', 'gem install rubocop'); - } - - protected function getMandatoryFlags() { - $options = array( - '--format=json', - ); - - if ($this->config) { - $options[] = '--config='.$this->config; - } - - return $options; - } - - public function getLinterConfigurationOptions() { - $options = array( - 'rubocop.config' => array( - 'type' => 'optional string', - 'help' => pht('A custom configuration file.'), - ), - ); - - return $options + parent::getLinterConfigurationOptions(); - } - - public function setLinterConfigurationValue($key, $value) { - switch ($key) { - case 'rubocop.config': - $this->config = $value; - return; - } - - return parent::setLinterConfigurationValue($key, $value); - } - - protected function parseLinterOutput($path, $err, $stdout, $stderr) { - $results = phutil_json_decode($stdout); - $messages = array(); - - foreach ($results['files'] as $file) { - foreach ($file['offenses'] as $offense) { - $message = id(new ArcanistLintMessage()) - ->setPath($file['path']) - ->setDescription($offense['message']) - ->setLine($offense['location']['line']) - ->setChar($offense['location']['column']) - ->setSeverity($this->getLintMessageSeverity($offense['severity'])) - ->setName($this->getLinterName()) - ->setCode($offense['cop_name']); - $messages[] = $message; - } - } - - return $messages; - } - - /** - * Take the string from RuboCop's severity terminology and return an - * @{class:ArcanistLintSeverity}. - */ - protected function getDefaultMessageSeverity($code) { - switch ($code) { - case 'convention': - case 'refactor': - case 'warning': - return ArcanistLintSeverity::SEVERITY_WARNING; - case 'error': - case 'fatal': - return ArcanistLintSeverity::SEVERITY_ERROR; - default: - return ArcanistLintSeverity::SEVERITY_ADVICE; - } - } - -} diff --git a/src/lint/linter/ArcanistRubyLinter.php b/src/lint/linter/ArcanistRubyLinter.php deleted file mode 100644 --- a/src/lint/linter/ArcanistRubyLinter.php +++ /dev/null @@ -1,87 +0,0 @@ -getExecutableCommand()); - - $matches = array(); - $regex = '/^ruby (?P\d+\.\d+\.\d+)+/'; - if (preg_match($regex, $stdout, $matches)) { - return $matches['version']; - } else { - return false; - } - } - - public function getInstallInstructions() { - return pht('Install `%s` from <%s>.', 'ruby', 'http://www.ruby-lang.org/'); - } - - protected function getMandatoryFlags() { - // -w: turn on warnings - // -c: check syntax - return array('-w', '-c'); - } - - protected function parseLinterOutput($path, $err, $stdout, $stderr) { - $lines = phutil_split_lines($stderr, false); - - $messages = array(); - foreach ($lines as $line) { - $matches = null; - - if (!preg_match('/(.*?):(\d+): (.*?)$/', $line, $matches)) { - continue; - } - - foreach ($matches as $key => $match) { - $matches[$key] = trim($match); - } - - $code = head(explode(',', $matches[3])); - - $message = new ArcanistLintMessage(); - $message->setPath($path); - $message->setLine($matches[2]); - $message->setCode($this->getLinterName()); - $message->setName(pht('Syntax Error')); - $message->setDescription($matches[3]); - $message->setSeverity($this->getLintMessageSeverity($code)); - - $messages[] = $message; - } - - return $messages; - } - -} diff --git a/src/lint/linter/ArcanistScriptAndRegexLinter.php b/src/lint/linter/ArcanistScriptAndRegexLinter.php deleted file mode 100644 --- a/src/lint/linter/ArcanistScriptAndRegexLinter.php +++ /dev/null @@ -1,392 +0,0 @@ -&1' - * - * The return code of the script must be 0, or an exception will be raised - * reporting that the linter failed. If you have a script which exits nonzero - * under normal circumstances, you can force it to always exit 0 by using a - * configuration like this: - * - * sh -c '/opt/lint/lint.sh "$0" || true' - * - * Multiple instances of the script will be run in parallel if there are - * multiple files to be linted, so they should not use any unique resources. - * For instance, this configuration would not work properly, because several - * processes may attempt to write to the file at the same time: - * - * COUNTEREXAMPLE - * sh -c '/opt/lint/lint.sh --output /tmp/lint.out "$0" && cat /tmp/lint.out' - * - * There are necessary limits to how gracefully this linter can deal with - * edge cases, because it is just a script and a regex. If you need to do - * things that this linter can't handle, you can write a phutil linter and move - * the logic to handle those cases into PHP. PHP is a better general-purpose - * programming language than regular expressions are, if only by a small margin. - * - * == ...and Regex == - * - * The regex must be a valid PHP PCRE regex, including delimiters and flags. - * - * The regex will be matched against the entire output of the script, so it - * should generally be in this form if messages are one-per-line: - * - * /^...$/m - * - * The regex should capture these named patterns with `(?P...)`: - * - * - `message` (required) Text describing the lint message. For example, - * "This is a syntax error.". - * - `name` (optional) Text summarizing the lint message. For example, - * "Syntax Error". - * - `severity` (optional) The word "error", "warning", "autofix", "advice", - * or "disabled", in any combination of upper and lower case. Instead, you - * may match groups called `error`, `warning`, `advice`, `autofix`, or - * `disabled`. These allow you to match output formats like "E123" and - * "W123" to indicate errors and warnings, even though the word "error" is - * not present in the output. If no severity capturing group is present, - * messages are raised with "error" severity. If multiple severity capturing - * groups are present, messages are raised with the highest captured - * severity. Capturing groups like `error` supersede the `severity` - * capturing group. - * - `error` (optional) Match some nonempty substring to indicate that this - * message has "error" severity. - * - `warning` (optional) Match some nonempty substring to indicate that this - * message has "warning" severity. - * - `advice` (optional) Match some nonempty substring to indicate that this - * message has "advice" severity. - * - `autofix` (optional) Match some nonempty substring to indicate that this - * message has "autofix" severity. - * - `disabled` (optional) Match some nonempty substring to indicate that this - * message has "disabled" severity. - * - `file` (optional) The name of the file to raise the lint message in. If - * not specified, defaults to the linted file. It is generally not necessary - * to capture this unless the linter can raise messages in files other than - * the one it is linting. - * - `line` (optional) The line number of the message. If no text is - * captured, the message is assumed to affect the entire file. - * - `char` (optional) The character offset of the message. - * - `offset` (optional) The byte offset of the message. If captured, this - * supersedes `line` and `char`. - * - `original` (optional) The text the message affects. - * - `replacement` (optional) The text that the range captured by `original` - * should be automatically replaced by to resolve the message. - * - `code` (optional) A short error type identifier which can be used - * elsewhere to configure handling of specific types of messages. For - * example, "EXAMPLE1", "EXAMPLE2", etc., where each code identifies a - * class of message like "syntax error", "missing whitespace", etc. This - * allows configuration to later change the severity of all whitespace - * messages, for example. - * - `ignore` (optional) Match some nonempty substring to ignore the match. - * You can use this if your linter sometimes emits text like "No lint - * errors". - * - `stop` (optional) Match some nonempty substring to stop processing input. - * Remaining matches for this file will be discarded, but linting will - * continue with other linters and other files. - * - `halt` (optional) Match some nonempty substring to halt all linting of - * this file by any linter. Linting will continue with other files. - * - `throw` (optional) Match some nonempty substring to throw an error, which - * will stop `arc` completely. You can use this to fail abruptly if you - * encounter unexpected output. All processing will abort. - * - * Numbered capturing groups are ignored. - * - * For example, if your lint script's output looks like this: - * - * error:13 Too many goats! - * warning:22 Not enough boats. - * - * ...you could use this regex to parse it: - * - * /^(?Pwarning|error):(?P\d+) (?P.*)$/m - * - * The simplest valid regex for line-oriented output is something like this: - * - * /^(?P.*)$/m - * - * @task lint Linting - * @task linterinfo Linter Information - * @task parse Parsing Output - * @task config Validating Configuration - */ -final class ArcanistScriptAndRegexLinter extends ArcanistLinter { - - private $script = null; - private $regex = null; - private $output = array(); - - public function getInfoName() { - return pht('Script and Regex'); - } - - public function getInfoDescription() { - return pht( - 'Run an external script, then parse its output with a regular '. - 'expression. This is a generic binding that can be used to '. - 'run custom lint scripts.'); - } - -/* -( Linting )------------------------------------------------------------ */ - - - /** - * Run the script on each file to be linted. - * - * @task lint - */ - public function willLintPaths(array $paths) { - $root = $this->getProjectRoot(); - - $futures = array(); - foreach ($paths as $path) { - $future = new ExecFuture('%C %s', $this->script, $path); - $future->setCWD($root); - $futures[$path] = $future; - } - - $futures = id(new FutureIterator($futures)) - ->limit(4); - foreach ($futures as $path => $future) { - list($stdout) = $future->resolvex(); - $this->output[$path] = $stdout; - } - } - - /** - * Run the regex on the output of the script. - * - * @task lint - */ - public function lintPath($path) { - $output = idx($this->output, $path); - if (!strlen($output)) { - // No output, but it exited 0, so just move on. - return; - } - - $matches = null; - if (!preg_match_all($this->regex, $output, $matches, PREG_SET_ORDER)) { - // Output with no matches. This might be a configuration error, but more - // likely it's something like "No lint errors." and the user just hasn't - // written a sufficiently powerful/ridiculous regexp to capture it into an - // 'ignore' group. Don't make them figure this out; advanced users can - // capture 'throw' to handle this case. - return; - } - - foreach ($matches as $match) { - if (!empty($match['throw'])) { - $throw = $match['throw']; - throw new ArcanistUsageException( - pht( - "%s: configuration captured a '%s' named capturing group, ". - "'%s'. Script output:\n%s", - __CLASS__, - 'throw', - $throw, - $output)); - } - - if (!empty($match['halt'])) { - $this->stopAllLinters(); - break; - } - - if (!empty($match['stop'])) { - break; - } - - if (!empty($match['ignore'])) { - continue; - } - - list($line, $char) = $this->getMatchLineAndChar($match, $path); - - $dict = array( - 'path' => idx($match, 'file', $path), - 'line' => $line, - 'char' => $char, - 'code' => idx($match, 'code', $this->getLinterName()), - 'severity' => $this->getMatchSeverity($match), - 'name' => idx($match, 'name', 'Lint'), - 'description' => idx($match, 'message', pht('Undefined Lint Message')), - ); - - $original = idx($match, 'original'); - if ($original !== null) { - $dict['original'] = $original; - } - - $replacement = idx($match, 'replacement'); - if ($replacement !== null) { - $dict['replacement'] = $replacement; - } - - $lint = ArcanistLintMessage::newFromDictionary($dict); - $this->addLintMessage($lint); - } - } - - -/* -( Linter Information )------------------------------------------------- */ - - /** - * Return the short name of the linter. - * - * @return string Short linter identifier. - * - * @task linterinfo - */ - public function getLinterName() { - return 'S&RX'; - } - - public function getLinterConfigurationName() { - return 'script-and-regex'; - } - - public function getLinterConfigurationOptions() { - // These fields are optional only to avoid breaking things. - $options = array( - 'script-and-regex.script' => array( - 'type' => 'string', - 'help' => pht('Script to execute.'), - ), - 'script-and-regex.regex' => array( - 'type' => 'regex', - 'help' => pht('The regex to process output with.'), - ), - ); - - return $options + parent::getLinterConfigurationOptions(); - } - - public function setLinterConfigurationValue($key, $value) { - switch ($key) { - case 'script-and-regex.script': - $this->script = $value; - return; - case 'script-and-regex.regex': - $this->regex = $value; - return; - } - - return parent::setLinterConfigurationValue($key, $value); - } - -/* -( Parsing Output )----------------------------------------------------- */ - - /** - * Get the line and character of the message from the regex match. - * - * @param dict Captured groups from regex. - * @return pair Line and character of the message. - * - * @task parse - */ - private function getMatchLineAndChar(array $match, $path) { - if (!empty($match['offset'])) { - list($line, $char) = $this->getEngine()->getLineAndCharFromOffset( - idx($match, 'file', $path), - $match['offset']); - return array($line + 1, $char + 1); - } - - $line = idx($match, 'line'); - if (strlen($line)) { - $line = (int)$line; - if (!$line) { - $line = 1; - } - } else { - $line = null; - } - - $char = idx($match, 'char'); - if ($char) { - $char = (int)$char; - } else { - $char = null; - } - - return array($line, $char); - } - - /** - * Map the regex matching groups to a message severity. We look for either - * a nonempty severity name group like 'error', or a group called 'severity' - * with a valid name. - * - * @param dict Captured groups from regex. - * @return const @{class:ArcanistLintSeverity} constant. - * - * @task parse - */ - private function getMatchSeverity(array $match) { - $map = array( - 'error' => ArcanistLintSeverity::SEVERITY_ERROR, - 'warning' => ArcanistLintSeverity::SEVERITY_WARNING, - 'autofix' => ArcanistLintSeverity::SEVERITY_AUTOFIX, - 'advice' => ArcanistLintSeverity::SEVERITY_ADVICE, - 'disabled' => ArcanistLintSeverity::SEVERITY_DISABLED, - ); - - $severity_name = strtolower(idx($match, 'severity')); - - foreach ($map as $name => $severity) { - if (!empty($match[$name])) { - return $severity; - } else if ($severity_name == $name) { - return $severity; - } - } - - return ArcanistLintSeverity::SEVERITY_ERROR; - } - -} diff --git a/src/lint/linter/ArcanistXMLLinter.php b/src/lint/linter/ArcanistXMLLinter.php deleted file mode 100644 --- a/src/lint/linter/ArcanistXMLLinter.php +++ /dev/null @@ -1,74 +0,0 @@ -getData($path))) { - // XML appears to be valid. - return; - } - - foreach (libxml_get_errors() as $error) { - $message = id(new ArcanistLintMessage()) - ->setPath($path) - ->setLine($error->line) - ->setChar($error->column ? $error->column : null) - ->setCode($this->getLintMessageFullCode($error->code)) - ->setName(pht('LibXML Error')) - ->setDescription(trim($error->message)); - - switch ($error->level) { - case LIBXML_ERR_NONE: - $message->setSeverity(ArcanistLintSeverity::SEVERITY_DISABLED); - break; - - case LIBXML_ERR_WARNING: - $message->setSeverity(ArcanistLintSeverity::SEVERITY_WARNING); - break; - - case LIBXML_ERR_ERROR: - case LIBXML_ERR_FATAL: - $message->setSeverity(ArcanistLintSeverity::SEVERITY_ERROR); - break; - - default: - $message->setSeverity(ArcanistLintSeverity::SEVERITY_ADVICE); - break; - } - - $this->addLintMessage($message); - } - } - -} diff --git a/src/lint/linter/__tests__/ArcanistCSSLintLinterTestCase.php b/src/lint/linter/__tests__/ArcanistCSSLintLinterTestCase.php deleted file mode 100644 --- a/src/lint/linter/__tests__/ArcanistCSSLintLinterTestCase.php +++ /dev/null @@ -1,10 +0,0 @@ -executeTestsInDirectory(dirname(__FILE__).'/csslint/'); - } - -} diff --git a/src/lint/linter/__tests__/ArcanistClosureLinterTestCase.php b/src/lint/linter/__tests__/ArcanistClosureLinterTestCase.php deleted file mode 100644 --- a/src/lint/linter/__tests__/ArcanistClosureLinterTestCase.php +++ /dev/null @@ -1,16 +0,0 @@ -setFlags(array('--additional_extensions=lint-test')); - return $linter; - } - - public function testLinter() { - $this->executeTestsInDirectory(dirname(__FILE__).'/gjslint/'); - } - -} diff --git a/src/lint/linter/__tests__/ArcanistCoffeeLintLinterTestCase.php b/src/lint/linter/__tests__/ArcanistCoffeeLintLinterTestCase.php deleted file mode 100644 --- a/src/lint/linter/__tests__/ArcanistCoffeeLintLinterTestCase.php +++ /dev/null @@ -1,10 +0,0 @@ -executeTestsInDirectory(dirname(__FILE__).'/coffeelint/'); - } - -} diff --git a/src/lint/linter/__tests__/ArcanistCppcheckLinterTestCase.php b/src/lint/linter/__tests__/ArcanistCppcheckLinterTestCase.php deleted file mode 100644 --- a/src/lint/linter/__tests__/ArcanistCppcheckLinterTestCase.php +++ /dev/null @@ -1,10 +0,0 @@ -executeTestsInDirectory(dirname(__FILE__).'/cppcheck/'); - } - -} diff --git a/src/lint/linter/__tests__/ArcanistCpplintLinterTestCase.php b/src/lint/linter/__tests__/ArcanistCpplintLinterTestCase.php deleted file mode 100644 --- a/src/lint/linter/__tests__/ArcanistCpplintLinterTestCase.php +++ /dev/null @@ -1,10 +0,0 @@ -executeTestsInDirectory(dirname(__FILE__).'/cpplint/'); - } - -} diff --git a/src/lint/linter/__tests__/ArcanistExternalLinterTestCase.php b/src/lint/linter/__tests__/ArcanistExternalLinterTestCase.php deleted file mode 100644 --- a/src/lint/linter/__tests__/ArcanistExternalLinterTestCase.php +++ /dev/null @@ -1,16 +0,0 @@ -getLinter()->getVersion(); - $this->assertTrue( - $version !== false, - pht('Failed to parse version from command.')); - } catch (ArcanistMissingLinterException $ex) { - $this->assertSkipped($ex->getMessage()); - } - } - -} diff --git a/src/lint/linter/__tests__/ArcanistFlake8LinterTestCase.php b/src/lint/linter/__tests__/ArcanistFlake8LinterTestCase.php deleted file mode 100644 --- a/src/lint/linter/__tests__/ArcanistFlake8LinterTestCase.php +++ /dev/null @@ -1,10 +0,0 @@ -executeTestsInDirectory(dirname(__FILE__).'/flake8/'); - } - -} diff --git a/src/lint/linter/__tests__/ArcanistGoLintLinterTestCase.php b/src/lint/linter/__tests__/ArcanistGoLintLinterTestCase.php deleted file mode 100644 --- a/src/lint/linter/__tests__/ArcanistGoLintLinterTestCase.php +++ /dev/null @@ -1,10 +0,0 @@ -executeTestsInDirectory(dirname(__FILE__).'/golint/'); - } - -} diff --git a/src/lint/linter/__tests__/ArcanistHLintLinterTestCase.php b/src/lint/linter/__tests__/ArcanistHLintLinterTestCase.php deleted file mode 100644 --- a/src/lint/linter/__tests__/ArcanistHLintLinterTestCase.php +++ /dev/null @@ -1,9 +0,0 @@ -executeTestsInDirectory(dirname(__FILE__).'/hlint/'); - } - -} diff --git a/src/lint/linter/__tests__/ArcanistJSHintLinterTestCase.php b/src/lint/linter/__tests__/ArcanistJSHintLinterTestCase.php deleted file mode 100644 --- a/src/lint/linter/__tests__/ArcanistJSHintLinterTestCase.php +++ /dev/null @@ -1,10 +0,0 @@ -executeTestsInDirectory(dirname(__FILE__).'/jshint/'); - } - -} diff --git a/src/lint/linter/__tests__/ArcanistJSONLintLinterTestCase.php b/src/lint/linter/__tests__/ArcanistJSONLintLinterTestCase.php deleted file mode 100644 --- a/src/lint/linter/__tests__/ArcanistJSONLintLinterTestCase.php +++ /dev/null @@ -1,10 +0,0 @@ -executeTestsInDirectory(dirname(__FILE__).'/jsonlint/'); - } - -} diff --git a/src/lint/linter/__tests__/ArcanistJSONLinterTestCase.php b/src/lint/linter/__tests__/ArcanistJSONLinterTestCase.php --- a/src/lint/linter/__tests__/ArcanistJSONLinterTestCase.php +++ b/src/lint/linter/__tests__/ArcanistJSONLinterTestCase.php @@ -3,7 +3,7 @@ final class ArcanistJSONLinterTestCase extends ArcanistLinterTestCase { public function testLinter() { - $this->executeTestsInDirectory(dirname(__FILE__).'/jsonlint/'); + $this->executeTestsInDirectory(dirname(__FILE__).'/json/'); } } diff --git a/src/lint/linter/__tests__/ArcanistJscsLinterTestCase.php b/src/lint/linter/__tests__/ArcanistJscsLinterTestCase.php deleted file mode 100644 --- a/src/lint/linter/__tests__/ArcanistJscsLinterTestCase.php +++ /dev/null @@ -1,9 +0,0 @@ -executeTestsInDirectory(dirname(__FILE__).'/jscs/'); - } - -} diff --git a/src/lint/linter/__tests__/ArcanistLesscLinterTestCase.php b/src/lint/linter/__tests__/ArcanistLesscLinterTestCase.php deleted file mode 100644 --- a/src/lint/linter/__tests__/ArcanistLesscLinterTestCase.php +++ /dev/null @@ -1,9 +0,0 @@ -executeTestsInDirectory(dirname(__FILE__).'/lessc/'); - } - -} diff --git a/src/lint/linter/__tests__/ArcanistPEP8LinterTestCase.php b/src/lint/linter/__tests__/ArcanistPEP8LinterTestCase.php deleted file mode 100644 --- a/src/lint/linter/__tests__/ArcanistPEP8LinterTestCase.php +++ /dev/null @@ -1,9 +0,0 @@ -executeTestsInDirectory(dirname(__FILE__).'/pep8/'); - } - -} diff --git a/src/lint/linter/__tests__/ArcanistPhpLinterTestCase.php b/src/lint/linter/__tests__/ArcanistPhpLinterTestCase.php deleted file mode 100644 --- a/src/lint/linter/__tests__/ArcanistPhpLinterTestCase.php +++ /dev/null @@ -1,9 +0,0 @@ -executeTestsInDirectory(dirname(__FILE__).'/php/'); - } - -} diff --git a/src/lint/linter/__tests__/ArcanistPhpcsLinterTestCase.php b/src/lint/linter/__tests__/ArcanistPhpcsLinterTestCase.php deleted file mode 100644 --- a/src/lint/linter/__tests__/ArcanistPhpcsLinterTestCase.php +++ /dev/null @@ -1,9 +0,0 @@ -executeTestsInDirectory(dirname(__FILE__).'/phpcs/'); - } - -} diff --git a/src/lint/linter/__tests__/ArcanistPuppetLintLinterTestCase.php b/src/lint/linter/__tests__/ArcanistPuppetLintLinterTestCase.php deleted file mode 100644 --- a/src/lint/linter/__tests__/ArcanistPuppetLintLinterTestCase.php +++ /dev/null @@ -1,10 +0,0 @@ -executeTestsInDirectory(dirname(__FILE__).'/puppet-lint/'); - } - -} diff --git a/src/lint/linter/__tests__/ArcanistPyFlakesLinterTestCase.php b/src/lint/linter/__tests__/ArcanistPyFlakesLinterTestCase.php deleted file mode 100644 --- a/src/lint/linter/__tests__/ArcanistPyFlakesLinterTestCase.php +++ /dev/null @@ -1,10 +0,0 @@ -executeTestsInDirectory(dirname(__FILE__).'/pyflakes/'); - } - -} diff --git a/src/lint/linter/__tests__/ArcanistPyLintLinterTestCase.php b/src/lint/linter/__tests__/ArcanistPyLintLinterTestCase.php deleted file mode 100644 --- a/src/lint/linter/__tests__/ArcanistPyLintLinterTestCase.php +++ /dev/null @@ -1,10 +0,0 @@ -executeTestsInDirectory(dirname(__FILE__).'/pylint/'); - } - -} diff --git a/src/lint/linter/__tests__/ArcanistRuboCopLinterTestCase.php b/src/lint/linter/__tests__/ArcanistRuboCopLinterTestCase.php deleted file mode 100644 --- a/src/lint/linter/__tests__/ArcanistRuboCopLinterTestCase.php +++ /dev/null @@ -1,10 +0,0 @@ -executeTestsInDirectory(dirname(__FILE__).'/rubocop/'); - } - -} diff --git a/src/lint/linter/__tests__/ArcanistRubyLinterTestCase.php b/src/lint/linter/__tests__/ArcanistRubyLinterTestCase.php deleted file mode 100644 --- a/src/lint/linter/__tests__/ArcanistRubyLinterTestCase.php +++ /dev/null @@ -1,9 +0,0 @@ -executeTestsInDirectory(dirname(__FILE__).'/ruby/'); - } - -} diff --git a/src/lint/linter/__tests__/ArcanistXMLLinterTestCase.php b/src/lint/linter/__tests__/ArcanistXMLLinterTestCase.php deleted file mode 100644 --- a/src/lint/linter/__tests__/ArcanistXMLLinterTestCase.php +++ /dev/null @@ -1,13 +0,0 @@ -executeTestsInDirectory(dirname(__FILE__).'/xml/'); - } - -} diff --git a/src/lint/linter/__tests__/coffeelint/camel_case_classes.lint-test b/src/lint/linter/__tests__/coffeelint/camel_case_classes.lint-test deleted file mode 100644 --- a/src/lint/linter/__tests__/coffeelint/camel_case_classes.lint-test +++ /dev/null @@ -1,3 +0,0 @@ -class boaConstrictor -~~~~~~~~~~ -error:1: diff --git a/src/lint/linter/__tests__/coffeelint/duplicate_key.lint-test b/src/lint/linter/__tests__/coffeelint/duplicate_key.lint-test deleted file mode 100644 --- a/src/lint/linter/__tests__/coffeelint/duplicate_key.lint-test +++ /dev/null @@ -1,18 +0,0 @@ -class SomeThing - getConfig: -> - one = 1 - one = 5 - @config = - keyA: one - keyB: one - keyA: 2 - getConfig: -> - @config = - foo: 1 - - @getConfig: -> - config = - foo: 1 -~~~~~~~~~~ -error:8: -error:9: diff --git a/src/lint/linter/__tests__/coffeelint/indentation.lint-test b/src/lint/linter/__tests__/coffeelint/indentation.lint-test deleted file mode 100644 --- a/src/lint/linter/__tests__/coffeelint/indentation.lint-test +++ /dev/null @@ -1,7 +0,0 @@ -twoSpaces = () -> - fourSpaces = () -> - eightSpaces = () -> - 'this is valid CoffeeScript' -~~~~~~~~~~ -error:3: -error:4: diff --git a/src/lint/linter/__tests__/coffeelint/max_line_length.lint-test b/src/lint/linter/__tests__/coffeelint/max_line_length.lint-test deleted file mode 100644 --- a/src/lint/linter/__tests__/coffeelint/max_line_length.lint-test +++ /dev/null @@ -1,3 +0,0 @@ -#-------------------------------------------------------------------------------- -~~~~~~~~~~ -error:1: diff --git a/src/lint/linter/__tests__/coffeelint/no_backticks.lint-test b/src/lint/linter/__tests__/coffeelint/no_backticks.lint-test deleted file mode 100644 --- a/src/lint/linter/__tests__/coffeelint/no_backticks.lint-test +++ /dev/null @@ -1,3 +0,0 @@ -`with(document) alert(height);` -~~~~~~~~~~ -error:1: diff --git a/src/lint/linter/__tests__/coffeelint/no_debugger.lint-test b/src/lint/linter/__tests__/coffeelint/no_debugger.lint-test deleted file mode 100644 --- a/src/lint/linter/__tests__/coffeelint/no_debugger.lint-test +++ /dev/null @@ -1,3 +0,0 @@ -debugger -~~~~~~~~~~ -warning:1: diff --git a/src/lint/linter/__tests__/coffeelint/no_tabs.lint-test b/src/lint/linter/__tests__/coffeelint/no_tabs.lint-test deleted file mode 100644 --- a/src/lint/linter/__tests__/coffeelint/no_tabs.lint-test +++ /dev/null @@ -1,6 +0,0 @@ -x = () -> - y = () -> - return 1234 -~~~~~~~~~~ -error:2: -error:3: diff --git a/src/lint/linter/__tests__/coffeelint/no_throwing_strings.lint-test b/src/lint/linter/__tests__/coffeelint/no_throwing_strings.lint-test deleted file mode 100644 --- a/src/lint/linter/__tests__/coffeelint/no_throwing_strings.lint-test +++ /dev/null @@ -1,3 +0,0 @@ -throw "i made a boo boo" -~~~~~~~~~~ -error:1: diff --git a/src/lint/linter/__tests__/coffeelint/no_trailing_semicolons.lint-test b/src/lint/linter/__tests__/coffeelint/no_trailing_semicolons.lint-test deleted file mode 100644 --- a/src/lint/linter/__tests__/coffeelint/no_trailing_semicolons.lint-test +++ /dev/null @@ -1,3 +0,0 @@ -alert('end of line'); -~~~~~~~~~~ -error:1: diff --git a/src/lint/linter/__tests__/coffeelint/no_trailing_whitespace.lint-test b/src/lint/linter/__tests__/coffeelint/no_trailing_whitespace.lint-test deleted file mode 100644 --- a/src/lint/linter/__tests__/coffeelint/no_trailing_whitespace.lint-test +++ /dev/null @@ -1,4 +0,0 @@ -x = 1234 -y = 1 -~~~~~~~~~~ -error:1: diff --git a/src/lint/linter/__tests__/cppcheck/file1.lint-test b/src/lint/linter/__tests__/cppcheck/file1.lint-test deleted file mode 100644 --- a/src/lint/linter/__tests__/cppcheck/file1.lint-test +++ /dev/null @@ -1,9 +0,0 @@ -int main() -{ - char a[10]; - a[10] = 0; - return 0; -} -~~~~~~~~~~ -error:4: -warning:4: diff --git a/src/lint/linter/__tests__/cppcheck/inline-suppr.lint-test b/src/lint/linter/__tests__/cppcheck/inline-suppr.lint-test deleted file mode 100644 --- a/src/lint/linter/__tests__/cppcheck/inline-suppr.lint-test +++ /dev/null @@ -1,7 +0,0 @@ -void f() { - char arr[5]; - // cppcheck-suppress arrayIndexOutOfBounds - // cppcheck-suppress unreadVariable - arr[10] = 0; -} -~~~~~~~~~~ diff --git a/src/lint/linter/__tests__/cppcheck/ok.lint-test b/src/lint/linter/__tests__/cppcheck/ok.lint-test deleted file mode 100644 --- a/src/lint/linter/__tests__/cppcheck/ok.lint-test +++ /dev/null @@ -1,5 +0,0 @@ -int main() -{ - return 0; -} -~~~~~~~~~~ diff --git a/src/lint/linter/__tests__/cppcheck/zblair.lint-test b/src/lint/linter/__tests__/cppcheck/zblair.lint-test deleted file mode 100644 --- a/src/lint/linter/__tests__/cppcheck/zblair.lint-test +++ /dev/null @@ -1,19 +0,0 @@ -/** - * Taken from http://www.slideshare.net/zblair/cppcheck-10316379 - */ -void foo(char* str) { - char* buf = new char[8]; - strcpy(buf, str); - - FILE* file = fopen("out.txt", "w"); - if (!file) - return; - - for (char* c = buf; *c; ++c) - fputc((int)*c, file); - - delete buf; -} -~~~~~~~~~~ -error:10: -error:16: diff --git a/src/lint/linter/__tests__/cpplint/googlestyle.lint-test b/src/lint/linter/__tests__/cpplint/googlestyle.lint-test deleted file mode 100644 --- a/src/lint/linter/__tests__/cpplint/googlestyle.lint-test +++ /dev/null @@ -1,10 +0,0 @@ -#include "library.cpp" -#include - -void main() -{ -} -~~~~~~~~~~ -warning:0: -warning:2: -warning:5: diff --git a/src/lint/linter/__tests__/csslint/duplicate-properties.lint-test b/src/lint/linter/__tests__/csslint/duplicate-properties.lint-test deleted file mode 100644 --- a/src/lint/linter/__tests__/csslint/duplicate-properties.lint-test +++ /dev/null @@ -1,10 +0,0 @@ -.rule { - font-weight: bold; - font-weight: bold; - font-weight: bold; - font-weight: bold; -} -~~~~~~~~~~ -warning:3:3 -warning:4:3 -warning:5:3 diff --git a/src/lint/linter/__tests__/csslint/empty-rule.lint-test b/src/lint/linter/__tests__/csslint/empty-rule.lint-test deleted file mode 100644 --- a/src/lint/linter/__tests__/csslint/empty-rule.lint-test +++ /dev/null @@ -1,3 +0,0 @@ -.rule { } -~~~~~~~~~~ -warning:1:1 diff --git a/src/lint/linter/__tests__/csslint/no-line-related-issue.lint-test b/src/lint/linter/__tests__/csslint/no-line-related-issue.lint-test deleted file mode 100644 --- a/src/lint/linter/__tests__/csslint/no-line-related-issue.lint-test +++ /dev/null @@ -1,9 +0,0 @@ -h1 { - font-weight: bold; -} -h1 { - font-weight: bold; -} -~~~~~~~~~~ -warning:: -warning:4:1 diff --git a/src/lint/linter/__tests__/csslint/parse-error.lint-test b/src/lint/linter/__tests__/csslint/parse-error.lint-test deleted file mode 100644 --- a/src/lint/linter/__tests__/csslint/parse-error.lint-test +++ /dev/null @@ -1,6 +0,0 @@ -li { - float: left; - float left; -} -~~~~~~~~~~ -error:3:9 diff --git a/src/lint/linter/__tests__/flake8/undefined.lint-test b/src/lint/linter/__tests__/flake8/undefined.lint-test deleted file mode 100644 --- a/src/lint/linter/__tests__/flake8/undefined.lint-test +++ /dev/null @@ -1,7 +0,0 @@ -x = 'y' - -def hello(): - return foo -~~~~~~~~~~ -error:3:1 -error:4:12 diff --git a/src/lint/linter/__tests__/gjslint/gjslint.lint-test b/src/lint/linter/__tests__/gjslint/gjslint.lint-test deleted file mode 100644 --- a/src/lint/linter/__tests__/gjslint/gjslint.lint-test +++ /dev/null @@ -1,20 +0,0 @@ -var x = 'some really really really really really really really long string'; -var y = 'some really really really really really really really really really long string', - z = 14; -var obj = {name : 'vm'}; -var x -var result = true - || false; -/** - * @param x - * @return {string} - */ -function foo(x) { - return 'bar'; -} -~~~~~~~~~~ -error:2: -error:4: -error:5: -error:7: -error:9: diff --git a/src/lint/linter/__tests__/golint/1.lint-test b/src/lint/linter/__tests__/golint/1.lint-test deleted file mode 100644 --- a/src/lint/linter/__tests__/golint/1.lint-test +++ /dev/null @@ -1,18 +0,0 @@ -package main - -import ( - "rand" -) - -type Exported string - -func main() { - if rand.Intn(10) > 5 { - return true - } else { - return false - } -} -~~~~~~~~~~ -advice:7:6 -advice:12:12 diff --git a/src/lint/linter/__tests__/hlint/01_warn_null.lint-test b/src/lint/linter/__tests__/hlint/01_warn_null.lint-test deleted file mode 100644 --- a/src/lint/linter/__tests__/hlint/01_warn_null.lint-test +++ /dev/null @@ -1,3 +0,0 @@ -f xs = length xs == 0 -~~~~~~~~~~ -warning:1:8 diff --git a/src/lint/linter/__tests__/hlint/02_err_eta.lint-test b/src/lint/linter/__tests__/hlint/02_err_eta.lint-test deleted file mode 100644 --- a/src/lint/linter/__tests__/hlint/02_err_eta.lint-test +++ /dev/null @@ -1,5 +0,0 @@ -f x = x - -test x = f x -~~~~~~~~~~ -error:3:1 diff --git a/src/lint/linter/__tests__/hlint/03_no_err.lint-test b/src/lint/linter/__tests__/hlint/03_no_err.lint-test deleted file mode 100644 --- a/src/lint/linter/__tests__/hlint/03_no_err.lint-test +++ /dev/null @@ -1,2 +0,0 @@ -main = map (f . g) xs -~~~~~~~~~~ diff --git a/src/lint/linter/__tests__/jscs/curly-brace.lint-test b/src/lint/linter/__tests__/jscs/curly-brace.lint-test deleted file mode 100644 --- a/src/lint/linter/__tests__/jscs/curly-brace.lint-test +++ /dev/null @@ -1,13 +0,0 @@ -function foo() { - if (true) return "foo"; else return "bar"; -} -~~~~~~~~~~ -error:2:3 -error:2:27 -~~~~~~~~~~ -~~~~~~~~~~ -{ - "config": { - "jscs.preset": "jquery" - } -} diff --git a/src/lint/linter/__tests__/jshint/dot-notation.lint-test b/src/lint/linter/__tests__/jshint/dot-notation.lint-test deleted file mode 100644 --- a/src/lint/linter/__tests__/jshint/dot-notation.lint-test +++ /dev/null @@ -1,6 +0,0 @@ -var args = {}; -args['foo'] = 'bar'; -args['bar'] = 'baz'; -~~~~~~~~~~ -warning:2:5 -warning:3:5 diff --git a/src/lint/linter/__tests__/jshint/expected-conditional.lint-test b/src/lint/linter/__tests__/jshint/expected-conditional.lint-test deleted file mode 100644 --- a/src/lint/linter/__tests__/jshint/expected-conditional.lint-test +++ /dev/null @@ -1,6 +0,0 @@ -var foo; -if (foo = 'bar') { - return true; -} -~~~~~~~~~~ -warning:2:16 diff --git a/src/lint/linter/__tests__/jshint/jshint.lint-test b/src/lint/linter/__tests__/jshint/jshint.lint-test deleted file mode 100644 --- a/src/lint/linter/__tests__/jshint/jshint.lint-test +++ /dev/null @@ -1,12 +0,0 @@ -function f() { - for (ii = 0; ii < 3; ii++) { - g() - } -} - -{ - -~~~~~~~~~~ -warning:3:8 -error:7:1 -error:9: diff --git a/src/lint/linter/__tests__/jshint/missing-semicolon.lint-test b/src/lint/linter/__tests__/jshint/missing-semicolon.lint-test deleted file mode 100644 --- a/src/lint/linter/__tests__/jshint/missing-semicolon.lint-test +++ /dev/null @@ -1,3 +0,0 @@ -console.log('foobar') -~~~~~~~~~~ -warning:1:22 diff --git a/src/lint/linter/__tests__/jshint/too-many-errors.lint-test b/src/lint/linter/__tests__/jshint/too-many-errors.lint-test deleted file mode 100644 --- a/src/lint/linter/__tests__/jshint/too-many-errors.lint-test +++ /dev/null @@ -1,5 +0,0 @@ -/* jshint maxerr: 1 */ -console.log('foobar') -~~~~~~~~~~ -disabled:2:22 -warning:2:22 diff --git a/src/lint/linter/__tests__/jshint/unnecessary-semicolon.lint-test b/src/lint/linter/__tests__/jshint/unnecessary-semicolon.lint-test deleted file mode 100644 --- a/src/lint/linter/__tests__/jshint/unnecessary-semicolon.lint-test +++ /dev/null @@ -1,5 +0,0 @@ -function main() { - return 'Hello, World!'; -}; -~~~~~~~~~~ -warning:3:2 diff --git a/src/lint/linter/__tests__/jsonlint/1.lint-test b/src/lint/linter/__tests__/json/1.lint-test rename from src/lint/linter/__tests__/jsonlint/1.lint-test rename to src/lint/linter/__tests__/json/1.lint-test diff --git a/src/lint/linter/__tests__/jsonlint/10.lint-test b/src/lint/linter/__tests__/json/10.lint-test rename from src/lint/linter/__tests__/jsonlint/10.lint-test rename to src/lint/linter/__tests__/json/10.lint-test diff --git a/src/lint/linter/__tests__/jsonlint/11.lint-test b/src/lint/linter/__tests__/json/11.lint-test rename from src/lint/linter/__tests__/jsonlint/11.lint-test rename to src/lint/linter/__tests__/json/11.lint-test diff --git a/src/lint/linter/__tests__/jsonlint/12.lint-test b/src/lint/linter/__tests__/json/12.lint-test rename from src/lint/linter/__tests__/jsonlint/12.lint-test rename to src/lint/linter/__tests__/json/12.lint-test diff --git a/src/lint/linter/__tests__/jsonlint/13.lint-test b/src/lint/linter/__tests__/json/13.lint-test rename from src/lint/linter/__tests__/jsonlint/13.lint-test rename to src/lint/linter/__tests__/json/13.lint-test diff --git a/src/lint/linter/__tests__/jsonlint/14.lint-test b/src/lint/linter/__tests__/json/14.lint-test rename from src/lint/linter/__tests__/jsonlint/14.lint-test rename to src/lint/linter/__tests__/json/14.lint-test diff --git a/src/lint/linter/__tests__/jsonlint/15.lint-test b/src/lint/linter/__tests__/json/15.lint-test rename from src/lint/linter/__tests__/jsonlint/15.lint-test rename to src/lint/linter/__tests__/json/15.lint-test diff --git a/src/lint/linter/__tests__/jsonlint/16.lint-test b/src/lint/linter/__tests__/json/16.lint-test rename from src/lint/linter/__tests__/jsonlint/16.lint-test rename to src/lint/linter/__tests__/json/16.lint-test diff --git a/src/lint/linter/__tests__/jsonlint/17.lint-test b/src/lint/linter/__tests__/json/17.lint-test rename from src/lint/linter/__tests__/jsonlint/17.lint-test rename to src/lint/linter/__tests__/json/17.lint-test diff --git a/src/lint/linter/__tests__/jsonlint/19.lint-test b/src/lint/linter/__tests__/json/19.lint-test rename from src/lint/linter/__tests__/jsonlint/19.lint-test rename to src/lint/linter/__tests__/json/19.lint-test diff --git a/src/lint/linter/__tests__/jsonlint/2.lint-test b/src/lint/linter/__tests__/json/2.lint-test rename from src/lint/linter/__tests__/jsonlint/2.lint-test rename to src/lint/linter/__tests__/json/2.lint-test diff --git a/src/lint/linter/__tests__/jsonlint/20.lint-test b/src/lint/linter/__tests__/json/20.lint-test rename from src/lint/linter/__tests__/jsonlint/20.lint-test rename to src/lint/linter/__tests__/json/20.lint-test diff --git a/src/lint/linter/__tests__/jsonlint/21.lint-test b/src/lint/linter/__tests__/json/21.lint-test rename from src/lint/linter/__tests__/jsonlint/21.lint-test rename to src/lint/linter/__tests__/json/21.lint-test diff --git a/src/lint/linter/__tests__/jsonlint/22.lint-test b/src/lint/linter/__tests__/json/22.lint-test rename from src/lint/linter/__tests__/jsonlint/22.lint-test rename to src/lint/linter/__tests__/json/22.lint-test diff --git a/src/lint/linter/__tests__/jsonlint/23.lint-test b/src/lint/linter/__tests__/json/23.lint-test rename from src/lint/linter/__tests__/jsonlint/23.lint-test rename to src/lint/linter/__tests__/json/23.lint-test diff --git a/src/lint/linter/__tests__/jsonlint/24.lint-test b/src/lint/linter/__tests__/json/24.lint-test rename from src/lint/linter/__tests__/jsonlint/24.lint-test rename to src/lint/linter/__tests__/json/24.lint-test diff --git a/src/lint/linter/__tests__/jsonlint/25.lint-test b/src/lint/linter/__tests__/json/25.lint-test rename from src/lint/linter/__tests__/jsonlint/25.lint-test rename to src/lint/linter/__tests__/json/25.lint-test diff --git a/src/lint/linter/__tests__/jsonlint/26.lint-test b/src/lint/linter/__tests__/json/26.lint-test rename from src/lint/linter/__tests__/jsonlint/26.lint-test rename to src/lint/linter/__tests__/json/26.lint-test diff --git a/src/lint/linter/__tests__/jsonlint/27.lint-test b/src/lint/linter/__tests__/json/27.lint-test rename from src/lint/linter/__tests__/jsonlint/27.lint-test rename to src/lint/linter/__tests__/json/27.lint-test diff --git a/src/lint/linter/__tests__/jsonlint/28.lint-test b/src/lint/linter/__tests__/json/28.lint-test rename from src/lint/linter/__tests__/jsonlint/28.lint-test rename to src/lint/linter/__tests__/json/28.lint-test diff --git a/src/lint/linter/__tests__/jsonlint/29.lint-test b/src/lint/linter/__tests__/json/29.lint-test rename from src/lint/linter/__tests__/jsonlint/29.lint-test rename to src/lint/linter/__tests__/json/29.lint-test diff --git a/src/lint/linter/__tests__/jsonlint/3.lint-test b/src/lint/linter/__tests__/json/3.lint-test rename from src/lint/linter/__tests__/jsonlint/3.lint-test rename to src/lint/linter/__tests__/json/3.lint-test diff --git a/src/lint/linter/__tests__/jsonlint/30.lint-test b/src/lint/linter/__tests__/json/30.lint-test rename from src/lint/linter/__tests__/jsonlint/30.lint-test rename to src/lint/linter/__tests__/json/30.lint-test diff --git a/src/lint/linter/__tests__/jsonlint/31.lint-test b/src/lint/linter/__tests__/json/31.lint-test rename from src/lint/linter/__tests__/jsonlint/31.lint-test rename to src/lint/linter/__tests__/json/31.lint-test diff --git a/src/lint/linter/__tests__/jsonlint/32.lint-test b/src/lint/linter/__tests__/json/32.lint-test rename from src/lint/linter/__tests__/jsonlint/32.lint-test rename to src/lint/linter/__tests__/json/32.lint-test diff --git a/src/lint/linter/__tests__/jsonlint/33.lint-test b/src/lint/linter/__tests__/json/33.lint-test rename from src/lint/linter/__tests__/jsonlint/33.lint-test rename to src/lint/linter/__tests__/json/33.lint-test diff --git a/src/lint/linter/__tests__/jsonlint/34.lint-test b/src/lint/linter/__tests__/json/34.lint-test rename from src/lint/linter/__tests__/jsonlint/34.lint-test rename to src/lint/linter/__tests__/json/34.lint-test diff --git a/src/lint/linter/__tests__/jsonlint/4.lint-test b/src/lint/linter/__tests__/json/4.lint-test rename from src/lint/linter/__tests__/jsonlint/4.lint-test rename to src/lint/linter/__tests__/json/4.lint-test diff --git a/src/lint/linter/__tests__/jsonlint/5.lint-test b/src/lint/linter/__tests__/json/5.lint-test rename from src/lint/linter/__tests__/jsonlint/5.lint-test rename to src/lint/linter/__tests__/json/5.lint-test diff --git a/src/lint/linter/__tests__/jsonlint/6.lint-test b/src/lint/linter/__tests__/json/6.lint-test rename from src/lint/linter/__tests__/jsonlint/6.lint-test rename to src/lint/linter/__tests__/json/6.lint-test diff --git a/src/lint/linter/__tests__/jsonlint/7.lint-test b/src/lint/linter/__tests__/json/7.lint-test rename from src/lint/linter/__tests__/jsonlint/7.lint-test rename to src/lint/linter/__tests__/json/7.lint-test diff --git a/src/lint/linter/__tests__/jsonlint/8.lint-test b/src/lint/linter/__tests__/json/8.lint-test rename from src/lint/linter/__tests__/jsonlint/8.lint-test rename to src/lint/linter/__tests__/json/8.lint-test diff --git a/src/lint/linter/__tests__/jsonlint/9.lint-test b/src/lint/linter/__tests__/json/9.lint-test rename from src/lint/linter/__tests__/jsonlint/9.lint-test rename to src/lint/linter/__tests__/json/9.lint-test diff --git a/src/lint/linter/__tests__/lessc/css.lint-test b/src/lint/linter/__tests__/lessc/css.lint-test deleted file mode 100644 --- a/src/lint/linter/__tests__/lessc/css.lint-test +++ /dev/null @@ -1,109 +0,0 @@ -@charset "utf-8"; -div { color: black; } -div { width: 99%; } - -* { - min-width: 45em; -} - -h1, h2 > a > p, h3 { - color: none; -} - -div.class { - color: blue; -} - -div#id { - color: green; -} - -.class#id { - color: purple; -} - -.one.two.three { - color: grey; -} - -@media print { - * { - font-size: 3em; - } -} - -@media screen { - * { - font-size: 10px; - } -} - -@font-face { - font-family: 'Garamond Pro'; -} - -a:hover, a:link { - color: #999; -} - -p, p:first-child { - text-transform: none; -} - -q:lang(no) { - quotes: none; -} - -p + h1 { - font-size: +2.2em; -} - -#shorthands { - border: 1px solid #000; - font: 12px/16px Arial; - font: 100%/16px Arial; - margin: 1px 0; - padding: 0 auto; -} - -#more-shorthands { - margin: 0; - padding: 1px 0 2px 0; - font: normal small/20px 'Trebuchet MS', Verdana, sans-serif; - font: 0/0 a; - border-radius: 5px / 10px; -} - -.misc { - -moz-border-radius: 2px; - display: -moz-inline-stack; - width: .1em; - background-color: #009998; - background: -webkit-gradient(linear, left top, left bottom, from(red), to(blue)); - margin: ; - .nested-multiple { - multiple-semi-colons: yes;;;;;; - }; - filter: alpha(opacity=100); - width: auto\9; -} - -#important { - color: red !important; - width: 100%!important; - height: 20px ! important; -} - -.def-font(@name) { - @font-face { - font-family: @name - } -} - -.def-font(font-a); -.def-font(font-b); - -.æøå { - margin: 0; -} -~~~~~~~~~~ diff --git a/src/lint/linter/__tests__/lessc/empty.lint-test b/src/lint/linter/__tests__/lessc/empty.lint-test deleted file mode 100644 --- a/src/lint/linter/__tests__/lessc/empty.lint-test +++ /dev/null @@ -1 +0,0 @@ -~~~~~~~~~~ diff --git a/src/lint/linter/__tests__/lessc/errors/add-mixed-units.lint-test b/src/lint/linter/__tests__/lessc/errors/add-mixed-units.lint-test deleted file mode 100644 --- a/src/lint/linter/__tests__/lessc/errors/add-mixed-units.lint-test +++ /dev/null @@ -1,8 +0,0 @@ -.a { - error: (1px + 3em); -} -~~~~~~~~~~ -error:2:3 -~~~~~~~~~~ -~~~~~~~~~~ -{"config":{"lessc.strict-units":true}} diff --git a/src/lint/linter/__tests__/lessc/errors/color-func-invalid-color.lint-test b/src/lint/linter/__tests__/lessc/errors/color-func-invalid-color.lint-test deleted file mode 100644 --- a/src/lint/linter/__tests__/lessc/errors/color-func-invalid-color.lint-test +++ /dev/null @@ -1,5 +0,0 @@ -.test { - color: color("NOT A COLOR"); -} -~~~~~~~~~~ -error:2:10 diff --git a/src/lint/linter/__tests__/lessc/errors/divide-mixed-units.lint-test b/src/lint/linter/__tests__/lessc/errors/divide-mixed-units.lint-test deleted file mode 100644 --- a/src/lint/linter/__tests__/lessc/errors/divide-mixed-units.lint-test +++ /dev/null @@ -1,8 +0,0 @@ -.a { - error: (1px / 3em); -} -~~~~~~~~~~ -error:2:3 -~~~~~~~~~~ -~~~~~~~~~~ -{"config":{"lessc.strict-units":true}} diff --git a/src/lint/linter/__tests__/lessc/errors/import-missing.lint-test b/src/lint/linter/__tests__/lessc/errors/import-missing.lint-test deleted file mode 100644 --- a/src/lint/linter/__tests__/lessc/errors/import-missing.lint-test +++ /dev/null @@ -1,8 +0,0 @@ -.a { - color: green; - // tests line number for import reference is correct -} - -@import "file-does-not-exist.less"; -~~~~~~~~~~ -error:6:1 diff --git a/src/lint/linter/__tests__/lessc/errors/javascript-error.lint-test b/src/lint/linter/__tests__/lessc/errors/javascript-error.lint-test deleted file mode 100644 --- a/src/lint/linter/__tests__/lessc/errors/javascript-error.lint-test +++ /dev/null @@ -1,5 +0,0 @@ -.scope { - var: `this.foo.toJS()`; -} -~~~~~~~~~~ -error:2:10 diff --git a/src/lint/linter/__tests__/lessc/errors/javascript-undefined-var.lint-test b/src/lint/linter/__tests__/lessc/errors/javascript-undefined-var.lint-test deleted file mode 100644 --- a/src/lint/linter/__tests__/lessc/errors/javascript-undefined-var.lint-test +++ /dev/null @@ -1,5 +0,0 @@ -.scope { - @a: `@{b}`; -} -~~~~~~~~~~ -error:2:9 diff --git a/src/lint/linter/__tests__/lessc/errors/mixin-not-visible-in-scope-1.lint-test b/src/lint/linter/__tests__/lessc/errors/mixin-not-visible-in-scope-1.lint-test deleted file mode 100644 --- a/src/lint/linter/__tests__/lessc/errors/mixin-not-visible-in-scope-1.lint-test +++ /dev/null @@ -1,11 +0,0 @@ -.something { - & { - .a {value: a} - } - - & { - .b {.a} // was Err. before 1.6.2 - } -} -~~~~~~~~~~ -error:7:13 diff --git a/src/lint/linter/__tests__/lessc/errors/multiply-mixed-units.lint-test b/src/lint/linter/__tests__/lessc/errors/multiply-mixed-units.lint-test deleted file mode 100644 --- a/src/lint/linter/__tests__/lessc/errors/multiply-mixed-units.lint-test +++ /dev/null @@ -1,12 +0,0 @@ -/* Test */ -#blah { - // blah -} -.a { - error: (1px * 1em); -} -~~~~~~~~~~ -error:6:3 -~~~~~~~~~~ -~~~~~~~~~~ -{"config":{"lessc.strict-units":true}} diff --git a/src/lint/linter/__tests__/lessc/errors/parens-error-1.lint-test b/src/lint/linter/__tests__/lessc/errors/parens-error-1.lint-test deleted file mode 100644 --- a/src/lint/linter/__tests__/lessc/errors/parens-error-1.lint-test +++ /dev/null @@ -1,5 +0,0 @@ -.a { - something: (12 (13 + 5 -23) + 5); -} -~~~~~~~~~~ -error:2:18 diff --git a/src/lint/linter/__tests__/lessc/errors/parse-error-curly-bracket.lint-test b/src/lint/linter/__tests__/lessc/errors/parse-error-curly-bracket.lint-test deleted file mode 100644 --- a/src/lint/linter/__tests__/lessc/errors/parse-error-curly-bracket.lint-test +++ /dev/null @@ -1,6 +0,0 @@ -body { - background-color: #fff; - } -} -~~~~~~~~~~ -error:4:1 diff --git a/src/lint/linter/__tests__/lessc/errors/parse-error-missing-bracket.lint-test b/src/lint/linter/__tests__/lessc/errors/parse-error-missing-bracket.lint-test deleted file mode 100644 --- a/src/lint/linter/__tests__/lessc/errors/parse-error-missing-bracket.lint-test +++ /dev/null @@ -1,4 +0,0 @@ -body { - background-color: #fff; -~~~~~~~~~~ -error:3:1 diff --git a/src/lint/linter/__tests__/lessc/errors/recursive-variable.lint-test b/src/lint/linter/__tests__/lessc/errors/recursive-variable.lint-test deleted file mode 100644 --- a/src/lint/linter/__tests__/lessc/errors/recursive-variable.lint-test +++ /dev/null @@ -1,3 +0,0 @@ -@bodyColor: darken(@bodyColor, 30%); -~~~~~~~~~~ -error:1:20 diff --git a/src/lint/linter/__tests__/lessc/errors/unit-function.lint-test b/src/lint/linter/__tests__/lessc/errors/unit-function.lint-test deleted file mode 100644 --- a/src/lint/linter/__tests__/lessc/errors/unit-function.lint-test +++ /dev/null @@ -1,8 +0,0 @@ -.a { - font-size: unit(80/16,rem); -} -~~~~~~~~~~ -error:2:14 -~~~~~~~~~~ -~~~~~~~~~~ -{"config":{"lessc.strict-math":true}} diff --git a/src/lint/linter/__tests__/lessc/extract-and-length.lint-test b/src/lint/linter/__tests__/lessc/extract-and-length.lint-test deleted file mode 100644 --- a/src/lint/linter/__tests__/lessc/extract-and-length.lint-test +++ /dev/null @@ -1,133 +0,0 @@ -// simple array/list: - -.multiunit { - @v: abc "abc" 1 1px 1% #123; - length: length(@v); - extract: extract(@v, 1) extract(@v, 2) extract(@v, 3) extract(@v, 4) extract(@v, 5) extract(@v, 6); -} - -.incorrect-index { - @v1: a b c; - @v2: a, b, c; - v1: extract(@v1, 5); - v2: extract(@v2, -2); -} - -.scalar { - @var: variable; - var-value: extract(@var, 1); - var-length: length(@var); - ill-index: extract(@var, 2); - - name-value: extract(name, 1); - string-value: extract("string", 1); - number-value: extract(12345678, 1); - color-value: extract(blue, 1); - rgba-value: extract(rgba(80, 160, 240, 0.67), 1); - empty-value: extract(~'', 1); - - name-length: length(name); - string-length: length("string"); - number-length: length(12345678); - color-length: length(blue); - rgba-length: length(rgba(80, 160, 240, 0.67)); - empty-length: length(~''); -} - -.mixin-arguments { - .mixin-args(a b c d); - .mixin-args(a, b, c, d); - .mixin-args(1; 2; 3; 4); -} - -.mixin-args(@value) { - &-1 { - length: length(@value); - extract: extract(@value, 3) ~"|" extract(@value, 2) ~"|" extract(@value, 1); - } -} - -.mixin-args(...) { - &-2 { - length: length(@arguments); - extract: extract(@arguments, 3) ~"|" extract(@arguments, 2) ~"|" extract(@arguments, 1); - } -} - -.mixin-args(@values...) { - &-3 { - length: length(@values); - extract: extract(@values, 3) ~"|" extract(@values, 2) ~"|" extract(@values, 1); - } -} - -.mixin-args(@head, @tail...) { - &-4 { - length: length(@tail); - extract: extract(@tail, 2) ~"|" extract(@tail, 1); - } -} - -// "multidimensional" array/list - -.md-space-comma { - @v: a b c, 1 2 3, "x" "y" "z"; - length-1: length(@v); - extract-1: extract(@v, 2); - length-2: length(extract(@v, 2)); - extract-2: extract(extract(@v, 2), 2); - - &-as-args {.mixin-args(a b c, 1 2 3, "x" "y" "z")} -} - -.md-cat-space-comma { - @a: a b c; - @b: 1 2 3; - @c: "x" "y" "z"; - @v: @a, @b, @c; - length-1: length(@v); - extract-1: extract(@v, 2); - length-2: length(extract(@v, 2)); - extract-2: extract(extract(@v, 2), 2); - - &-as-args {.mixin-args(@a, @b, @c)} -} - -.md-cat-comma-space { - @a: a, b, c; - @b: 1, 2, 3; - @c: "x", "y", "z"; - @v: @a @b @c; - length-1: length(@v); - extract-1: extract(@v, 2); - length-2: length(extract(@v, 2)); - extract-2: extract(extract(@v, 2), 2); - - &-as-args {.mixin-args(@a @b @c)} -} - -.md-3D { - @a: a b c d, 1 2 3 4; - @b: 5 6 7 8, e f g h; - .3D(@a, @b); - - .3D(...) { - - @v1: @arguments; - length-1: length(@v1); - extract-1: extract(@v1, 1); - - @v2: extract(@v1, 2); - length-2: length(@v2); - extract-2: extract(@v2, 1); - - @v3: extract(@v2, 1); - length-3: length(@v3); - extract-3: extract(@v3, 3); - - @v4: extract(@v3, 4); - length-4: length(@v4); - extract-4: extract(@v4, 1); - } -} -~~~~~~~~~~ diff --git a/src/lint/linter/__tests__/lessc/functions.lint-test b/src/lint/linter/__tests__/lessc/functions.lint-test deleted file mode 100644 --- a/src/lint/linter/__tests__/lessc/functions.lint-test +++ /dev/null @@ -1,169 +0,0 @@ -#functions { - @var: 10; - @colors: #000, #fff; - color: _color("evil red"); // #660000 - width: increment(15); - height: undefined("self"); - border-width: add(2, 3); - variable: increment(@var); - background: linear-gradient(@colors); -} - -#built-in { - @r: 32; - escaped: e("-Some::weird(#thing, y)"); - lighten: lighten(#ff0000, 40%); - darken: darken(#ff0000, 40%); - saturate: saturate(#29332f, 20%); - desaturate: desaturate(#203c31, 20%); - greyscale: greyscale(#203c31); - hsl-clamp: hsl(380, 150%, 150%); - spin-p: spin(hsl(340, 50%, 50%), 40); - spin-n: spin(hsl(30, 50%, 50%), -40); - luma-white: luma(#fff); - luma-black: luma(#000); - luma-black-alpha: luma(rgba(0,0,0,0.5)); - luma-red: luma(#ff0000); - luma-green: luma(#00ff00); - luma-blue: luma(#0000ff); - luma-yellow: luma(#ffff00); - luma-cyan: luma(#00ffff); - luma-white-alpha: luma(rgba(255,255,255,0.5)); - contrast-filter: contrast(30%); - saturate-filter: saturate(5%); - contrast-white: contrast(#fff); - contrast-black: contrast(#000); - contrast-red: contrast(#ff0000); - contrast-green: contrast(#00ff00); - contrast-blue: contrast(#0000ff); - contrast-yellow: contrast(#ffff00); - contrast-cyan: contrast(#00ffff); - contrast-light: contrast(#fff, #111111, #eeeeee); - contrast-dark: contrast(#000, #111111, #eeeeee); - contrast-wrongorder: contrast(#fff, #eeeeee, #111111, 0.5); - contrast-light-thresh: contrast(#fff, #111111, #eeeeee, 0.5); - contrast-dark-thresh: contrast(#000, #111111, #eeeeee, 0.5); - contrast-high-thresh: contrast(#555, #111111, #eeeeee, 0.6); - contrast-low-thresh: contrast(#555, #111111, #eeeeee, 0.1); - contrast-light-thresh-per: contrast(#fff, #111111, #eeeeee, 50%); - contrast-dark-thresh-per: contrast(#000, #111111, #eeeeee, 50%); - contrast-high-thresh-per: contrast(#555, #111111, #eeeeee, 60%); - contrast-low-thresh-per: contrast(#555, #111111, #eeeeee, 10%); - replace: replace("Hello, Mars.", "Mars\.", "World!"); - replace-captured: replace("This is a string.", "(string)\.$", "new $1."); - replace-with-flags: replace("One + one = 4", "one", "2", "gi"); - replace-single-quoted: replace('foo-1', "1", "2"); - replace-escaped-string: replace(~"bar-1", "1", "2"); - replace-keyword: replace(baz-1, "1", "2"); - format: %("rgb(%d, %d, %d)", @r, 128, 64); - format-string: %("hello %s", "world"); - format-multiple: %("hello %s %d", "earth", 2); - format-url-encode: %("red is %A", #ff0000); - format-single-quoted: %('hello %s', "single world"); - format-escaped-string: %(~"hello %s", "escaped world"); - eformat: e(%("rgb(%d, %d, %d)", @r, 128, 64)); - - unitless: unit(12px); - unit: unit((13px + 1px), em); - unitpercentage: unit(100, %); - - get-unit: get-unit(10px); - get-unit-empty: get-unit(10); - - hue: hue(hsl(98, 12%, 95%)); - saturation: saturation(hsl(98, 12%, 95%)); - lightness: lightness(hsl(98, 12%, 95%)); - hsvhue: hsvhue(hsv(98, 12%, 95%)); - hsvsaturation: hsvsaturation(hsv(98, 12%, 95%)); - hsvvalue: hsvvalue(hsv(98, 12%, 95%)); - red: red(#f00); - green: green(#0f0); - blue: blue(#00f); - rounded: round((@r/3)); - rounded-two: round((@r/3), 2); - roundedpx: round((10px / 3)); - roundedpx-three: round((10px / 3), 3); - rounded-percentage: round(10.2%); - ceil: ceil(10.1px); - floor: floor(12.9px); - sqrt: sqrt(25px); - pi: pi(); - mod: mod(13m, 11cm); // could take into account units, doesn't at the moment - abs: abs(-4%); - tan: tan(42deg); - sin: sin(10deg); - cos: cos(12); - atan: atan(tan(0.1rad)); - atan: convert(acos(cos(34deg)), deg); - atan: convert(acos(cos(50grad)), deg); - pow: pow(8px, 2); - pow: pow(4, 3); - pow: pow(3, 3em); - min: min(0); - min: min(6, 5); - min: min(1pt, 3pt); - min: min(1cm, 3mm); - max: max(1, 3); - max: max(3em, 1em, 2em, 5em); - percentage: percentage((10px / 50)); - color: color("#ff0011"); - tint: tint(#777777, 13); - tint-full: tint(#777777, 100); - tint-percent: tint(#777777, 13%); - tint-negative: tint(#777777, -13%); - shade: shade(#777777, 13); - shade-full: shade(#777777, 100); - shade-percent: shade(#777777, 13%); - shade-negative: shade(#777777, -13%); - - fade-out: fadeOut(red, 5%); // support fadeOut and fadeout - fade-in: fadein(fadeout(red, 10%), 5%); - - hsv: hsv(5, 50%, 30%); - hsva: hsva(3, 50%, 30%, 0.2); - - mix: mix(#ff0000, #ffff00, 80); - mix-0: mix(#ff0000, #ffff00, 0); - mix-100: mix(#ff0000, #ffff00, 100); - mix-weightless: mix(#ff0000, #ffff00); - mixt: mix(#ff0000, transparent); - - .is-a { - color: iscolor(#ddd); - color1: iscolor(red); - color2: iscolor(rgb(0, 0, 0)); - color3: iscolor(transparent); - keyword: iskeyword(hello); - number: isnumber(32); - string: isstring("hello"); - pixel: ispixel(32px); - percent: ispercentage(32%); - em: isem(32em); - cat: isunit(32cat, cat); - } -} - -#alpha { - alpha: darken(hsla(25, 50%, 50%, 0.6), 10%); - alpha2: alpha(rgba(3, 4, 5, 0.5)); - alpha3: alpha(transparent); -} - -#blendmodes { - multiply: multiply(#f60000, #f60000); - screen: screen(#f60000, #0000f6); - overlay: overlay(#f60000, #0000f6); - softlight: softlight(#f60000, #ffffff); - hardlight: hardlight(#f60000, #0000f6); - difference: difference(#f60000, #0000f6); - exclusion: exclusion(#f60000, #0000f6); - average: average(#f60000, #0000f6); - negation: negation(#f60000, #313131); -} - -#extract-and-length { - @anon: A B C 1 2 3; - extract: extract(@anon, 6) extract(@anon, 5) extract(@anon, 4) extract(@anon, 3) extract(@anon, 2) extract(@anon, 1); - length: length(@anon); -} -~~~~~~~~~~ diff --git a/src/lint/linter/__tests__/lessc/javascript.lint-test b/src/lint/linter/__tests__/lessc/javascript.lint-test deleted file mode 100644 --- a/src/lint/linter/__tests__/lessc/javascript.lint-test +++ /dev/null @@ -1,30 +0,0 @@ -.eval { - js: `42`; - js: `1 + 1`; - js: `"hello world"`; - js: `[1, 2, 3]`; - title: `typeof process.title`; - ternary: `(1 + 1 == 2 ? true : false)`; - multiline: `(function(){var x = 1 + 1; - return x})()`; -} -.scope { - @foo: 42; - var: `parseInt(this.foo.toJS())`; - escaped: ~`2 + 5 + 'px'`; -} -.vars { - @var: `4 + 4`; - width: @var; -} -.escape-interpol { - @world: "world"; - width: ~`"hello" + " " + @{world}`; -} -.arrays { - @ary: 1, 2, 3; - @ary2: 1 2 3; - ary: `@{ary}.join(', ')`; - ary1: `@{ary2}.join(', ')`; -} -~~~~~~~~~~ diff --git a/src/lint/linter/__tests__/lessc/media.lint-test b/src/lint/linter/__tests__/lessc/media.lint-test deleted file mode 100644 --- a/src/lint/linter/__tests__/lessc/media.lint-test +++ /dev/null @@ -1,234 +0,0 @@ -// For now, variables can't be declared inside @media blocks. - -@var: 42; - -@media print { - .class { - color: blue; - .sub { - width: @var; - } - } - .top, header > h1 { - color: (#222 * 2); - } -} - -@media screen { - @base: 8; - body { max-width: (@base * 60); } -} - -@ratio_large: 16; -@ratio_small: 9; - -@media all and (device-aspect-ratio: @ratio_large / @ratio_small) { - body { max-width: 800px; } -} - -@media all and (orientation:portrait) { - aside { float: none; } -} - -@media handheld and (min-width: @var), screen and (min-width: 20em) { - body { - max-width: 480px; - } -} - -body { - @media print { - padding: 20px; - - header { - background-color: red; - } - - @media (orientation:landscape) { - margin-left: 20px; - } - } -} - -@media screen { - .sidebar { - width: 300px; - @media (orientation: landscape) { - width: 500px; - } - } -} - -@media a { - .first { - @media b { - .second { - .third { - width: 300px; - @media c { - width: 500px; - } - } - .fourth { - width: 3; - } - } - } - } -} - -body { - @media a, b and c { - width: 95%; - - @media x, y { - width: 100%; - } - } -} - -.mediaMixin(@fallback: 200px) { - background: black; - - @media handheld { - background: white; - - @media (max-width: @fallback) { - background: red; - } - } -} - -.a { - .mediaMixin(100px); -} - -.b { - .mediaMixin(); -} -@smartphone: ~"only screen and (max-width: 200px)"; -@media @smartphone { - body { - width: 480px; - } -} - -@media print { - @page :left { - margin: 0.5cm; - } - @page :right { - margin: 0.5cm; - } - @page Test:first { - margin: 1cm; - } - @page :first { - size: 8.5in 11in; - @top-left { - margin: 1cm; - } - @top-left-corner { - margin: 1cm; - } - @top-center { - margin: 1cm; - } - @top-right { - margin: 1cm; - } - @top-right-corner { - margin: 1cm; - } - @bottom-left { - margin: 1cm; - } - @bottom-left-corner { - margin: 1cm; - } - @bottom-center { - margin: 1cm; - } - @bottom-right { - margin: 1cm; - } - @bottom-right-corner { - margin: 1cm; - } - @left-top { - margin: 1cm; - } - @left-middle { - margin: 1cm; - } - @left-bottom { - margin: 1cm; - } - @right-top { - margin: 1cm; - } - @right-middle { - content: "Page " counter(page); - } - @right-bottom { - margin: 1cm; - } - } -} - -@media (-webkit-min-device-pixel-ratio: 2), (min--moz-device-pixel-ratio: 2), (-o-min-device-pixel-ratio: 2/1), (min-resolution: 2dppx), (min-resolution: 128dpcm) { - .b { - background: red; - } -} - -.bg() { - background: red; - - @media (max-width: 500px) { - background: green; - } -} - -body { - .bg(); -} - -@bpMedium: 1000px; -@media (max-width: @bpMedium) { - body { - .bg(); - background: blue; - } -} - -@media (max-width: 1200px) { - /* a comment */ - - @media (max-width: 900px) { - body { font-size: 11px; } - } -} - -.nav-justified { - @media (min-width: 480px) { - > li { - display: table-cell; - } - } -} - -.menu -{ - @media (min-width: 768px) { - .nav-justified(); - } -} -@all: ~"all"; -@tv: ~"tv"; -@media @all and @tv { - .all-and-tv-variables { - var: all-and-tv; - } -} -~~~~~~~~~~ diff --git a/src/lint/linter/__tests__/lessc/mixins.lint-test b/src/lint/linter/__tests__/lessc/mixins.lint-test deleted file mode 100644 --- a/src/lint/linter/__tests__/lessc/mixins.lint-test +++ /dev/null @@ -1,142 +0,0 @@ -.mixin { border: 1px solid black; } -.mixout { border-color: orange; } -.borders { border-style: dashed; } - -#namespace { - .borders { - border-style: dotted; - } - .biohazard { - content: "death"; - .man { - color: transparent; - } - } -} -#theme { - > .mixin { - background-color: grey; - } -} -#container { - color: black; - .mixin; - .mixout; - #theme > .mixin; -} - -#header { - .milk { - color: white; - .mixin; - #theme > .mixin; - } - #cookie { - .chips { - #namespace .borders; - .calories { - #container; - } - } - .borders; - } -} -.secure-zone { #namespace .biohazard .man; } -.direct { - #namespace > .borders; -} - -.bo, .bar { - width: 100%; -} -.bo { - border: 1px; -} -.ar.bo.ca { - color: black; -} -.jo.ki { - background: none; -} -.amp { - &.support { - color: orange; - .higher { - top: 0px; - } - &.deeper { - height: auto; - } - } -} -.extended { - .bo; - .jo.ki; - .amp.support; - .amp.support.higher; - .amp.support.deeper; -} -.do .re .mi .fa { - .sol .la { - .si { - color: cyan; - } - } -} -.mutli-selector-parents { - .do.re.mi.fa.sol.la.si; -} -.foo .bar { - .bar; -} -.has_parents() { - & .underParents { - color: red; - } -} -.has_parents(); -.parent { - .has_parents(); -} -.margin_between(@above, @below) { - * + & { margin-top: @above; } - legend + & { margin-top: 0; } - & + * { margin-top: @below; } -} -h1 { .margin_between(25px, 10px); } -h2 { .margin_between(20px, 8px); } -h3 { .margin_between(15px, 5px); } - -.mixin_def(@url, @position){ - background-image: @url; - background-position: @position; -} -.error{ - @s: "/"; - .mixin_def( "@{s}a.png", center center); -} -.recursion() { - color: black; -} -.test-rec { - .recursion { - .recursion(); - } -} -.paddingFloat(@padding) { padding-left: @padding; } - -.button { - .paddingFloat(((10px + 12) * 2)); - - &.large { .paddingFloat(((10em * 2) * 2)); } -} -.clearfix() { - // ... -} -.clearfix { - .clearfix(); -} -.foo { - .clearfix(); -} -~~~~~~~~~~ diff --git a/src/lint/linter/__tests__/lessc/no-output.lint-test b/src/lint/linter/__tests__/lessc/no-output.lint-test deleted file mode 100644 --- a/src/lint/linter/__tests__/lessc/no-output.lint-test +++ /dev/null @@ -1,3 +0,0 @@ -.mixin() { -} -~~~~~~~~~~ diff --git a/src/lint/linter/__tests__/lessc/operations.lint-test b/src/lint/linter/__tests__/lessc/operations.lint-test deleted file mode 100644 --- a/src/lint/linter/__tests__/lessc/operations.lint-test +++ /dev/null @@ -1,63 +0,0 @@ -#operations { - color: (#110000 + #000011 + #001100); // #111111 - height: (10px / 2px + 6px - 1px * 2); // 9px - width: (2 * 4 - 5em); // 3em - .spacing { - height: (10px / 2px+6px-1px*2); - width: (2 * 4-5em); - } - substraction: (20 - 10 - 5 - 5); // 0 - division: (20 / 5 / 4); // 1 -} - -@x: 4; -@y: 12em; - -.with-variables { - height: (@x + @y); // 16em - width: (12 + @y); // 24em - size: (5cm - @x); // 1cm -} - -.with-functions { - color: (rgb(200, 200, 200) / 2); - color: (2 * hsl(0, 50%, 50%)); - color: (rgb(10, 10, 10) + hsl(0, 50%, 50%)); -} - -@z: -2; - -.negative { - height: (2px + @z); // 0px - width: (2px - @z); // 4px -} - -.shorthands { - padding: -1px 2px 0 -4px; // -} - -.rem-dimensions { - font-size: (20rem / 5 + 1.5rem); // 5.5rem -} - -.colors { - color: #123; // #112233 - border-color: (#234 + #111111); // #334455 - background-color: (#222222 - #fff); // #000000 - .other { - color: (2 * #111); // #222222 - border-color: (#333333 / 3 + #111); // #222222 - } -} - -.negations { - @var: 4px; - variable: (-@var); // 4 - variable1: (-@var + @var); // 0 - variable2: (@var + -@var); // 0 - variable3: (@var - -@var); // 8 - variable4: (-@var - -@var); // 0 - paren: (-(@var)); // -4px - paren2: (-(2 + 2) * -@var); // 16 -} -~~~~~~~~~~ diff --git a/src/lint/linter/__tests__/lessc/parens.lint-test b/src/lint/linter/__tests__/lessc/parens.lint-test deleted file mode 100644 --- a/src/lint/linter/__tests__/lessc/parens.lint-test +++ /dev/null @@ -1,46 +0,0 @@ -.parens { - @var: 1px; - border: (@var * 2) solid black; - margin: (@var * 1) (@var + 2) (4 * 4) 3; - width: (6 * 6); - padding: 2px (6 * 6px); -} - -.more-parens { - @var: (2 * 2); - padding: (2 * @var) 4 4 (@var * 1px); - width-all: ((@var * @var) * 6); - width-first: ((@var * @var)) * 6; - width-keep: (@var * @var) * 6; - height-keep: (7 * 7) + (8 * 8); - height-all: ((7 * 7) + (8 * 8)); - height-parts: ((7 * 7)) + ((8 * 8)); - margin-keep: (4 * (5 + 5) / 2) - (@var * 2); - margin-parts: ((4 * (5 + 5) / 2)) - ((@var * 2)); - margin-all: ((4 * (5 + 5) / 2) + (-(@var * 2))); - border-radius-keep: 4px * (1 + 1) / @var + 3px; - border-radius-parts: ((4px * (1 + 1))) / ((@var + 3px)); - border-radius-all: (4px * (1 + 1) / @var + 3px); - //margin: (6 * 6)px; -} - -.negative { - @var: 1; - neg-var: -@var; // -1 ? - neg-var-paren: -(@var); // -(1) ? -} - -.nested-parens { - width: 2 * (4 * (2 + (1 + 6))) - 1; - height: ((2 + 3) * (2 + 3) / (9 - 4)) + 1; -} - -.mixed-units { - margin: 2px 4em 1 5pc; - padding: (2px + 4px) 1em 2px 2; -} - -.test-false-negatives { - a: ~"("; -} -~~~~~~~~~~ diff --git a/src/lint/linter/__tests__/lessc/selectors.lint-test b/src/lint/linter/__tests__/lessc/selectors.lint-test deleted file mode 100644 --- a/src/lint/linter/__tests__/lessc/selectors.lint-test +++ /dev/null @@ -1,157 +0,0 @@ -h1, h2, h3 { - a, p { - &:hover { - color: red; - } - } -} - -#all { color: blue; } -#the { color: blue; } -#same { color: blue; } - -ul, li, div, q, blockquote, textarea { - margin: 0; -} - -td { - margin: 0; - padding: 0; -} - -td, input { - line-height: 1em; -} - -a { - color: red; - - &:hover { color: blue; } - - div & { color: green; } - - p & span { color: yellow; } -} - -.foo { - .bar, .baz { - & .qux { - display: block; - } - .qux & { - display: inline; - } - .qux& { - display: inline-block; - } - .qux & .biz { - display: none; - } - } -} - -.b { - &.c { - .a& { - color: red; - } - } -} - -.b { - .c & { - &.a { - color: red; - } - } -} - -.p { - .foo &.bar { - color: red; - } -} - -.p { - .foo&.bar { - color: red; - } -} - -.foo { - .foo + & { - background: amber; - } - & + & { - background: amber; - } -} - -.foo, .bar { - & + & { - background: amber; - } -} - -.foo, .bar { - a, b { - & > & { - background: amber; - } - } -} - -.other ::fnord { color: red } -.other::fnord { color: red } -.other { - ::bnord {color: red } - &::bnord {color: red } -} -// selector interpolation -@theme: blood; -@selector: ~".@{theme}"; -@{selector} { - color:red; -} -@{selector}red { - color: green; -} -.red { - #@{theme}.@{theme}&.black { - color:black; - } -} -@num: 3; -:nth-child(@{num}) { - selector: interpolated; -} -.test { - &:nth-child(odd):not(:nth-child(3)) { - color: #ff0000; - } -} -[prop], -[prop=10%], -[prop="value@{num}"], -[prop*="val@{num}"], -[|prop~="val@{num}"], -[*|prop$="val@{num}"], -[ns|prop^="val@{num}"], -[@{num}^="val@{num}"], -[@{num}=@{num}], -[@{num}] { - attributes: yes; -} - -/* -Large comment means chunk will be emitted after } which means chunk will begin with whitespace... -blank blank blank blank blank blank blank blank blank blank blank blank blank blank blank blank -blank blank blank blank blank blank blank blank blank blank blank blank blank blank blank blank -blank blank blank blank blank blank blank blank blank blank blank blank blank blank blank blank -blank blank blank blank blank blank blank blank blank blank blank blank blank blank blank blank -blank blank blank blank blank blank blank blank blank blank blank blank blank blank blank blank -*/ -@{selector} { - color: red; -} -~~~~~~~~~~ diff --git a/src/lint/linter/__tests__/lessc/variables.lint-test b/src/lint/linter/__tests__/lessc/variables.lint-test deleted file mode 100644 --- a/src/lint/linter/__tests__/lessc/variables.lint-test +++ /dev/null @@ -1,84 +0,0 @@ -@a: 2; -@x: (@a * @a); -@y: (@x + 1); -@z: (@x * 2 + @y); -@var: -1; - -.variables { - width: (@z + 1cm); // 14cm -} - -@b: @a * 10; -@c: #888; - -@fonts: "Trebuchet MS", Verdana, sans-serif; -@f: @fonts; - -@quotes: "~" "~"; -@q: @quotes; -@onePixel: 1px; - -.variables { - height: (@b + @x + 0px); // 24px - color: @c; - font-family: @f; - quotes: @q; -} - -.redef { - @var: 0; - .inition { - @var: 4; - @var: 2; - three: @var; - @var: 3; - } - zero: @var; -} - -.values { - minus-one: @var; - @a: 'Trebuchet'; - @multi: 'A', B, C; - font-family: @a, @a, @a; - color: @c !important; - multi: something @multi, @a; -} - -.variable-names { - @var: 'hello'; - @name: 'var'; - name: @@name; -} - -.alpha { - @var: 42; - filter: alpha(opacity=@var); -} - -.polluteMixin() { - @a: 'pollution'; -} -.testPollution { - @a: 'no-pollution'; - a: @a; - .polluteMixin(); - a: @a; -} - -.units { - width: @onePixel; - same-unit-as-previously: (@onePixel / @onePixel); - square-pixel-divided: (@onePixel * @onePixel / @onePixel); - odd-unit: unit((@onePixel * 4em / 2cm)); - percentage: (10 * 50%); - pixels: (50px * 10); - conversion-metric-a: (20mm + 1cm); - conversion-metric-b: (1cm + 20mm); - conversion-imperial: (1in + 72pt + 6pc); - custom-unit: (42octocats * 10); - custom-unit-cancelling: (8cats * 9dogs / 4cats); - mix-units: (1px + 1em); - invalid-units: (1px * 1px); -} -~~~~~~~~~~ diff --git a/src/lint/linter/__tests__/pep8/imports.lint-test b/src/lint/linter/__tests__/pep8/imports.lint-test deleted file mode 100644 --- a/src/lint/linter/__tests__/pep8/imports.lint-test +++ /dev/null @@ -1,3 +0,0 @@ -import os, sys -~~~~~~~~~~ -error:1:10 diff --git a/src/lint/linter/__tests__/php/fatal.lint-test b/src/lint/linter/__tests__/php/fatal.lint-test deleted file mode 100644 --- a/src/lint/linter/__tests__/php/fatal.lint-test +++ /dev/null @@ -1,7 +0,0 @@ - - * @license Imaginary License http://www.example.com/LICENSE - * @version GIT: HEAD - * @link http://www.derp.com/ - */ - -/** - * A function. - * - * @return void - */ -function f() -{ - -} -~~~~~~~~~~ diff --git a/src/lint/linter/__tests__/puppet-lint/arrow_alignment.lint-test b/src/lint/linter/__tests__/puppet-lint/arrow_alignment.lint-test deleted file mode 100644 --- a/src/lint/linter/__tests__/puppet-lint/arrow_alignment.lint-test +++ /dev/null @@ -1,6 +0,0 @@ -exec { 'test': - subscribe => File['/etc/test'], - refreshonly => true, -} -~~~~~~~~~~ -warning:2:13 diff --git a/src/lint/linter/__tests__/puppet-lint/double_quoted_strings.lint-test b/src/lint/linter/__tests__/puppet-lint/double_quoted_strings.lint-test deleted file mode 100644 --- a/src/lint/linter/__tests__/puppet-lint/double_quoted_strings.lint-test +++ /dev/null @@ -1,7 +0,0 @@ -user { 'dave': - ensure => present, - home => '/home/dave', - comment => "This is a double quoted string", -} -~~~~~~~~~~ -warning:4:14 diff --git a/src/lint/linter/__tests__/puppet-lint/duplicate_params.lint-test b/src/lint/linter/__tests__/puppet-lint/duplicate_params.lint-test deleted file mode 100644 --- a/src/lint/linter/__tests__/puppet-lint/duplicate_params.lint-test +++ /dev/null @@ -1,6 +0,0 @@ -service { 'anacron': - ensure => 'absent', - ensure => 'stopped', -} -~~~~~~~~~~ -error:3:3 diff --git a/src/lint/linter/__tests__/puppet-lint/ensure_not_symlink_target.lint-test b/src/lint/linter/__tests__/puppet-lint/ensure_not_symlink_target.lint-test deleted file mode 100644 --- a/src/lint/linter/__tests__/puppet-lint/ensure_not_symlink_target.lint-test +++ /dev/null @@ -1,5 +0,0 @@ -file { '/var/log/syslog': - ensure => '/var/log/messages', -} -~~~~~~~~~~ -warning:2:13 diff --git a/src/lint/linter/__tests__/puppet-lint/file_mode.lint-test b/src/lint/linter/__tests__/puppet-lint/file_mode.lint-test deleted file mode 100644 --- a/src/lint/linter/__tests__/puppet-lint/file_mode.lint-test +++ /dev/null @@ -1,6 +0,0 @@ -file { '/var/log/syslog': - ensure => present, - mode => '644', -} -~~~~~~~~~~ -warning:3:13 diff --git a/src/lint/linter/__tests__/puppet-lint/hard_tabs.lint-test b/src/lint/linter/__tests__/puppet-lint/hard_tabs.lint-test deleted file mode 100644 --- a/src/lint/linter/__tests__/puppet-lint/hard_tabs.lint-test +++ /dev/null @@ -1,7 +0,0 @@ -exec { 'test': - subscribe => File['/etc/test'], - refreshonly => true, -} -~~~~~~~~~~ -error:2:1 -error:3:1 diff --git a/src/lint/linter/__tests__/puppet-lint/names_containing_dash.lint-test b/src/lint/linter/__tests__/puppet-lint/names_containing_dash.lint-test deleted file mode 100644 --- a/src/lint/linter/__tests__/puppet-lint/names_containing_dash.lint-test +++ /dev/null @@ -1,3 +0,0 @@ -$foo-bar123 -~~~~~~~~~~ -warning:1:1 diff --git a/src/lint/linter/__tests__/puppet-lint/quoted_booleans.lint-test b/src/lint/linter/__tests__/puppet-lint/quoted_booleans.lint-test deleted file mode 100644 --- a/src/lint/linter/__tests__/puppet-lint/quoted_booleans.lint-test +++ /dev/null @@ -1,6 +0,0 @@ -service { 'anacron': - ensure => 'stopped', - enable => 'true', -} -~~~~~~~~~~ -warning:3:13 diff --git a/src/lint/linter/__tests__/puppet-lint/right_to_left_relationship.lint-test b/src/lint/linter/__tests__/puppet-lint/right_to_left_relationship.lint-test deleted file mode 100644 --- a/src/lint/linter/__tests__/puppet-lint/right_to_left_relationship.lint-test +++ /dev/null @@ -1,3 +0,0 @@ -Service['httpd'] <- Package['httpd'] -~~~~~~~~~~ -warning:1:18 diff --git a/src/lint/linter/__tests__/puppet-lint/site.lint-test b/src/lint/linter/__tests__/puppet-lint/site.lint-test deleted file mode 100644 --- a/src/lint/linter/__tests__/puppet-lint/site.lint-test +++ /dev/null @@ -1,19 +0,0 @@ -import 'classes/*' -import 'nodes.pp' - -Exec['apt-get-update'] -> Package <| |> - -Exec { - path => '/usr/bin:/usr/sbin:/bin', -} - -exec { 'apt-get-update': - command => '/usr/bin/apt-get update', - require => File['/etc/apt/apt.conf.d/01proxy'], -} - -file { '/etc/apt/apt.conf.d/01proxy': - ensure => 'file', - source => '/tmp/vagrant-puppet/manifests/files/apt-conf', -} -~~~~~~~~~~ diff --git a/src/lint/linter/__tests__/puppet-lint/slash_comments.lint-test b/src/lint/linter/__tests__/puppet-lint/slash_comments.lint-test deleted file mode 100644 --- a/src/lint/linter/__tests__/puppet-lint/slash_comments.lint-test +++ /dev/null @@ -1,3 +0,0 @@ -// This is a comment -~~~~~~~~~~ -warning:1:1 diff --git a/src/lint/linter/__tests__/puppet-lint/star_comments.lint-test b/src/lint/linter/__tests__/puppet-lint/star_comments.lint-test deleted file mode 100644 --- a/src/lint/linter/__tests__/puppet-lint/star_comments.lint-test +++ /dev/null @@ -1,3 +0,0 @@ -/* This is a comment */ -~~~~~~~~~~ -warning:1:1 diff --git a/src/lint/linter/__tests__/puppet-lint/unquoted_file_mode.lint-test b/src/lint/linter/__tests__/puppet-lint/unquoted_file_mode.lint-test deleted file mode 100644 --- a/src/lint/linter/__tests__/puppet-lint/unquoted_file_mode.lint-test +++ /dev/null @@ -1,6 +0,0 @@ -file { '/var/log/syslog': - ensure => present, - mode => 0644, -} -~~~~~~~~~~ -warning:3:13 diff --git a/src/lint/linter/__tests__/pyflakes/pyflakes.lint-test b/src/lint/linter/__tests__/pyflakes/pyflakes.lint-test deleted file mode 100644 --- a/src/lint/linter/__tests__/pyflakes/pyflakes.lint-test +++ /dev/null @@ -1,7 +0,0 @@ -import sys, os - -x += 1 -~~~~~~~~~~ -warning:1: -warning:1: -error:3: diff --git a/src/lint/linter/__tests__/pylint/negativechar.lint-test b/src/lint/linter/__tests__/pylint/negativechar.lint-test deleted file mode 100644 --- a/src/lint/linter/__tests__/pylint/negativechar.lint-test +++ /dev/null @@ -1,6 +0,0 @@ -"""Docstring""" - -""" -Useless string """ -~~~~~~~~~~ -warning:4:0 See T9257. diff --git a/src/lint/linter/__tests__/pylint/pylint.lint-test b/src/lint/linter/__tests__/pylint/pylint.lint-test deleted file mode 100644 --- a/src/lint/linter/__tests__/pylint/pylint.lint-test +++ /dev/null @@ -1,7 +0,0 @@ -import sys, os - -x += 1 -~~~~~~~~~~ -warning:1:0 -advice:1:0 -error:3:0 diff --git a/src/lint/linter/__tests__/rubocop/convention.lint-test b/src/lint/linter/__tests__/rubocop/convention.lint-test deleted file mode 100644 --- a/src/lint/linter/__tests__/rubocop/convention.lint-test +++ /dev/null @@ -1,4 +0,0 @@ -def hello() -end -~~~~~~~~~~ -warning:1:10 diff --git a/src/lint/linter/__tests__/rubocop/error.lint-test b/src/lint/linter/__tests__/rubocop/error.lint-test deleted file mode 100644 --- a/src/lint/linter/__tests__/rubocop/error.lint-test +++ /dev/null @@ -1,4 +0,0 @@ -def hello - puts 'world' -~~~~~~~~~~ -error:3:1 diff --git a/src/lint/linter/__tests__/rubocop/no_errors.lint-test b/src/lint/linter/__tests__/rubocop/no_errors.lint-test deleted file mode 100644 --- a/src/lint/linter/__tests__/rubocop/no_errors.lint-test +++ /dev/null @@ -1,4 +0,0 @@ -def hello - puts 'hello world' -end -~~~~~~~~~~ diff --git a/src/lint/linter/__tests__/rubocop/warning.lint-test b/src/lint/linter/__tests__/rubocop/warning.lint-test deleted file mode 100644 --- a/src/lint/linter/__tests__/rubocop/warning.lint-test +++ /dev/null @@ -1,5 +0,0 @@ -def hello(unused) - puts 'hi' -end -~~~~~~~~~ -warning:1:11 diff --git a/src/lint/linter/__tests__/ruby/hello.lint-test b/src/lint/linter/__tests__/ruby/hello.lint-test deleted file mode 100644 --- a/src/lint/linter/__tests__/ruby/hello.lint-test +++ /dev/null @@ -1,4 +0,0 @@ -def hello() - puts "hello world" -~~~~~~~~~~ -error:2: diff --git a/src/lint/linter/__tests__/ruby/semicolon.lint-test b/src/lint/linter/__tests__/ruby/semicolon.lint-test deleted file mode 100644 --- a/src/lint/linter/__tests__/ruby/semicolon.lint-test +++ /dev/null @@ -1,4 +0,0 @@ -def asdf() - puts "semicolons are ok"; -end -~~~~~~~~~~ diff --git a/src/lint/linter/__tests__/ruby/wvswc.lint-test b/src/lint/linter/__tests__/ruby/wvswc.lint-test deleted file mode 100644 --- a/src/lint/linter/__tests__/ruby/wvswc.lint-test +++ /dev/null @@ -1,10 +0,0 @@ -# ruby -wc says syntax ok -# ruby -w says blah.rb:2: undefined local variable or method `index' for main:Object (NameError) -if index < 0 and $VERBOSE - $stderr.puts "warning: index is a negative number" - if $DEBUG - $stderr.puts "index value: #{index.inspect}" - $stderr.puts "array state: #{array.inspect}" - end -end -~~~~~~~~~~ diff --git a/src/lint/linter/__tests__/xml/almost-empty.lint-test b/src/lint/linter/__tests__/xml/almost-empty.lint-test deleted file mode 100644 --- a/src/lint/linter/__tests__/xml/almost-empty.lint-test +++ /dev/null @@ -1,3 +0,0 @@ - -~~~~~~~~~~ -error:2:1 diff --git a/src/lint/linter/__tests__/xml/big-entity-name.lint-test b/src/lint/linter/__tests__/xml/big-entity-name.lint-test deleted file mode 100644 --- a/src/lint/linter/__tests__/xml/big-entity-name.lint-test +++ /dev/null @@ -1,6 +0,0 @@ - - -]> -&WhatHeSaid; -~~~~~~~~~~ diff --git a/src/lint/linter/__tests__/xml/big-name-1.lint-test b/src/lint/linter/__tests__/xml/big-name-1.lint-test deleted file mode 100644 --- a/src/lint/linter/__tests__/xml/big-name-1.lint-test +++ /dev/null @@ -1,2 +0,0 @@ - -~~~~~~~~~~ diff --git a/src/lint/linter/__tests__/xml/big-name-2.lint-test b/src/lint/linter/__tests__/xml/big-name-2.lint-test deleted file mode 100644 --- a/src/lint/linter/__tests__/xml/big-name-2.lint-test +++ /dev/null @@ -1,2 +0,0 @@ - -~~~~~~~~~~ diff --git a/src/lint/linter/__tests__/xml/cdata-1.lint-test b/src/lint/linter/__tests__/xml/cdata-1.lint-test deleted file mode 100644 --- a/src/lint/linter/__tests__/xml/cdata-1.lint-test +++ /dev/null @@ -1,4 +0,0 @@ - -Hello, world!]]> - -~~~~~~~~~~ diff --git a/src/lint/linter/__tests__/xml/cdata-2.lint-test b/src/lint/linter/__tests__/xml/cdata-2.lint-test deleted file mode 100644 --- a/src/lint/linter/__tests__/xml/cdata-2.lint-test +++ /dev/null @@ -1,7 +0,0 @@ - - - ]> - -~~~~~~~~~~ diff --git a/src/lint/linter/__tests__/xml/char-ref.lint-test b/src/lint/linter/__tests__/xml/char-ref.lint-test deleted file mode 100644 --- a/src/lint/linter/__tests__/xml/char-ref.lint-test +++ /dev/null @@ -1,3 +0,0 @@ - -~~~~~~~~~~ -error:1:63 diff --git a/src/lint/linter/__tests__/xml/comment.list-test b/src/lint/linter/__tests__/xml/comment.list-test deleted file mode 100644 --- a/src/lint/linter/__tests__/xml/comment.list-test +++ /dev/null @@ -1,7 +0,0 @@ - - - - - - -~~~~~~~~~~ diff --git a/src/lint/linter/__tests__/xml/empty-cdata.lint-test b/src/lint/linter/__tests__/xml/empty-cdata.lint-test deleted file mode 100644 --- a/src/lint/linter/__tests__/xml/empty-cdata.lint-test +++ /dev/null @@ -1,5 +0,0 @@ - - - - -~~~~~~~~~~ diff --git a/src/lint/linter/__tests__/xml/empty.lint-test b/src/lint/linter/__tests__/xml/empty.lint-test deleted file mode 100644 --- a/src/lint/linter/__tests__/xml/empty.lint-test +++ /dev/null @@ -1 +0,0 @@ -~~~~~~~~~~ diff --git a/src/lint/linter/__tests__/xml/gjobs.lint-test b/src/lint/linter/__tests__/xml/gjobs.lint-test deleted file mode 100644 --- a/src/lint/linter/__tests__/xml/gjobs.lint-test +++ /dev/null @@ -1,57 +0,0 @@ - - - - - - - GBackup - Development - - - Open - Mon, 07 Jun 1999 20:27:45 -0400 MET DST - USD 0.00 - - - - - - - - - Nathan Clemons - nathan@windsofstorm.net - - - - - - - - - - - - - - The program should be released as free software, under the GPL. - - - - - - - A GNOME based system that will allow a superuser to configure - compressed and uncompressed files and/or file systems to be backed - up with a supported media in the system. This should be able to - perform via find commands generating a list of files that are passed - to tar, dd, cpio, cp, gzip, etc., to be directed to the tape machine - or via operations performed on the filesystem itself. Email - notification and GUI status display very important. - - - - - - -~~~~~~~~~~ diff --git a/src/lint/linter/__tests__/xml/languages-1.lint-test b/src/lint/linter/__tests__/xml/languages-1.lint-test deleted file mode 100644 --- a/src/lint/linter/__tests__/xml/languages-1.lint-test +++ /dev/null @@ -1,16 +0,0 @@ - - - - 1972 - Dennis Ritchie - - - 1995 - Rasmus Lerdorf - - - 1995 - James Gosling - - -~~~~~~~~~~ diff --git a/src/lint/linter/__tests__/xml/languages-2.lint-test b/src/lint/linter/__tests__/xml/languages-2.lint-test deleted file mode 100644 --- a/src/lint/linter/__tests__/xml/languages-2.lint-test +++ /dev/null @@ -1,3 +0,0 @@ - - -~~~~~~~~~~ diff --git a/src/lint/linter/__tests__/xml/languages-3.lint-test b/src/lint/linter/__tests__/xml/languages-3.lint-test deleted file mode 100644 --- a/src/lint/linter/__tests__/xml/languages-3.lint-test +++ /dev/null @@ -1,5 +0,0 @@ - - - - -~~~~~~~~~~ diff --git a/src/lint/linter/__tests__/xml/languages-4.lint-test b/src/lint/linter/__tests__/xml/languages-4.lint-test deleted file mode 100644 --- a/src/lint/linter/__tests__/xml/languages-4.lint-test +++ /dev/null @@ -1,16 +0,0 @@ - - - - 1972 - Dennis Ritchie - - - 1995 - Rasmus Lerdorf - - - 1995 - James Gosling - - -~~~~~~~~~~ diff --git a/src/lint/linter/__tests__/xml/languages-5.lint-test b/src/lint/linter/__tests__/xml/languages-5.lint-test deleted file mode 100644 --- a/src/lint/linter/__tests__/xml/languages-5.lint-test +++ /dev/null @@ -1,6 +0,0 @@ - - - <> - -~~~~~~~~~~ -error:3:6 diff --git a/src/lint/linter/__tests__/xml/languages-6.lint-test b/src/lint/linter/__tests__/xml/languages-6.lint-test deleted file mode 100644 --- a/src/lint/linter/__tests__/xml/languages-6.lint-test +++ /dev/null @@ -1,7 +0,0 @@ - - - - -~~~~~~~~~~ -error:3:16 -error:4:1 diff --git a/src/lint/linter/__tests__/xml/slashdot.lint-test b/src/lint/linter/__tests__/xml/slashdot.lint-test deleted file mode 100644 --- a/src/lint/linter/__tests__/xml/slashdot.lint-test +++ /dev/null @@ -1,113 +0,0 @@ - - - 100 Mbit/s on Fibre to the home - http://slashdot.org/articles/99/06/06/1440211.shtml - - CmdrTaco - wouldn't-it-be-nice - internet - 20 -
articles
- topicinternet.jpg -
- - Gimp 1.2 Preview - http://slashdot.org/articles/99/06/06/1438246.shtml - - CmdrTaco - stuff-to-read - gimp - 12 -
articles
- topicgimp.gif -
- - Sony's AIBO robot Sold Out - http://slashdot.org/articles/99/06/06/1432256.shtml - - CmdrTaco - stuff-to-see - tech - 10 -
articles
- topictech2.jpg -
- - Ask Slashdot: Another Word for "Hacker"? - http://slashdot.org/askslashdot/99/06/05/1815225.shtml - - Cliff - hacker-vs-cracker - news - 385 -
askslashdot
- topicnews.gif -
- - Corel Linux FAQ - http://slashdot.org/articles/99/06/05/1842218.shtml - - CmdrTaco - stuff-to-read - corel - 164 -
articles
- topiccorel.gif -
- - Upside downsides MP3.COM. - http://slashdot.org/articles/99/06/05/1558210.shtml - - CmdrTaco - stuff-to-think-about - music - 48 -
articles
- topicmusic.gif -
- - 2 Terabits of Bandwidth - http://slashdot.org/articles/99/06/05/1554258.shtml - - CmdrTaco - faster-porn - internet - 66 -
articles
- topicinternet.jpg -
- - Suppression of cold fusion research? - http://slashdot.org/articles/99/06/04/2313200.shtml - - Hemos - possibly-probably - science - 217 -
articles
- topicscience.gif -
- - California Gov. Halts Wage Info Sale - http://slashdot.org/articles/99/06/04/235256.shtml - - Hemos - woo-hoo! - usa - 16 -
articles
- topicus.gif -
- - Red Hat Announces IPO - http://slashdot.org/articles/99/06/04/0849207.shtml - - Justin - details-sketchy - redhat - 155 -
articles
- topicredhat.gif -
-
-~~~~~~~~~~ diff --git a/src/lint/linter/__tests__/xml/svg.lint-test b/src/lint/linter/__tests__/xml/svg.lint-test deleted file mode 100644 --- a/src/lint/linter/__tests__/xml/svg.lint-test +++ /dev/null @@ -1,12 +0,0 @@ - - - - Four separate rectangles - - - - - - -~~~~~~~~~~ diff --git a/src/lint/linter/__tests__/xml/title.lint-test b/src/lint/linter/__tests__/xml/title.lint-test deleted file mode 100644 --- a/src/lint/linter/__tests__/xml/title.lint-test +++ /dev/null @@ -1,3 +0,0 @@ - -my title -~~~~~~~~~~ diff --git a/src/lint/linter/__tests__/xml/xhtml.lint-test b/src/lint/linter/__tests__/xml/xhtml.lint-test deleted file mode 100644 --- a/src/lint/linter/__tests__/xml/xhtml.lint-test +++ /dev/null @@ -1,1505 +0,0 @@ - - - - -XHTML 1.0: The Extensible HyperText Markup -Language - - - - - -

W3C

- -

XHTML 1.0: -The Extensible HyperText Markup Language

- -

A Reformulation of HTML 4.0 in XML 1.0

- -

W3C Proposed Recommendation 10 December 1999

- -
-
This version:
- -
-http://www.w3.org/TR/1999/PR-xhtml1-19991210
-(Postscript version, -PDF version, -ZIP archive, or -Gzip'd TAR archive) -
- -
Latest version:
- -
-http://www.w3.org/TR/xhtml1
- -
Previous versions:
- -
-http://www.w3.org/TR/1999/WD-xhtml1-19991124
-
-http://www.w3.org/TR/1999/PR-xhtml1-19990824
- -
Authors:
- -
See acknowledgements.
-
- - -
-
- -

Abstract

- -

This specification defines XHTML 1.0, a reformulation of HTML -4.0 as an XML 1.0 application, and three DTDs corresponding to -the ones defined by HTML 4.0. The semantics of the elements and -their attributes are defined in the W3C Recommendation for HTML -4.0. These semantics provide the foundation for future -extensibility of XHTML. Compatibility with existing HTML user -agents is possible by following a small set of guidelines.

- -

Status of this document

- -

This section describes the status of this document at the time -of its publication. Other documents may supersede this document. The -latest status of this document series is maintained at the W3C.

- -

This specification is a Proposed Recommendation of the HTML Working Group. It is -a revision of the Proposed Recommendation dated 24 August -1999 incorporating changes as a result of comments from the Proposed -Recommendation review, and -comments and further deliberations of the W3C HTML Working Group. A -diff-marked version from the previous -proposed recommendation is available for comparison purposes.

- -

On 10 December 1999, this document enters a - -Proposed Recommendation review period. From that date until 8 January -2000, -W3C Advisory Committee representatives are encouraged -to review this specification and return comments in their completed -ballots to w3c-html-review@w3.org. Please send any comments of a -confidential nature in separate email to w3t-html@w3.org, which is -visible to the Team only.

- -

No sooner than 14 days after the end of the review period, the -Director will announce the document's disposition: it may become a W3C -Recommendation (possibly with minor changes), it may revert to Working -Draft status, or it may be dropped as a W3C work item.

- -

Publication as a Proposed Recommendation does not imply endorsement -by the W3C membership. This is still a draft document and may be -updated, replaced or obsoleted by other documents at any time. It is -inappropriate to cite W3C Proposed Recommendation as other than "work -in progress."

- -

This document has been produced as part of the W3C HTML Activity. The goals of -the HTML Working -Group (members -only) are discussed in the HTML Working Group -charter (members -only).

- -

A list of current W3C Recommendations and other technical documents -can be found at http://www.w3.org/TR.

- -

Public discussion on HTML features takes place on the mailing list www-html@w3.org (archive). The W3C -staff contact for work on HTML is Dave -Raggett.

- -

Please report errors in this document to www-html-editor@w3.org.

- -

The list of known errors in this specification is available at http://www.w3.org/1999/12/PR-xhtml1-19991210-errata.

- -

Contents

- - - - -

1. What is XHTML?

- -

XHTML is a family of current and future document types and modules that -reproduce, subset, and extend HTML 4.0 [HTML]. XHTML family document types are XML based, -and ultimately are designed to work in conjunction with XML-based user agents. -The details of this family and its evolution are -discussed in more detail in the section on Future -Directions.

- -

XHTML 1.0 (this specification) is the first document type in the XHTML -family. It is a reformulation of the three HTML 4.0 document types as -applications of XML 1.0 [XML]. It is intended -to be used as a language for content that is both XML-conforming and, if some -simple guidelines are followed, -operates in HTML 4.0 conforming user agents. Developers who migrate -their content to XHTML 1.0 will realize the following benefits:

- -
    -
  • XHTML documents are XML conforming. As such, they are readily viewed, -edited, and validated with standard XML tools.
  • -
  • XHTML documents can be written to -to operate as well or better than they did before in existing -HTML 4.0-conforming user agents as well as in new, XHTML 1.0 conforming user -agents.
  • -
  • XHTML documents can utilize applications (e.g. scripts and applets) that rely -upon either the HTML Document Object Model or the XML Document Object Model [DOM].
  • -
  • As the XHTML family evolves, documents conforming to XHTML 1.0 will be more -likely to interoperate within and among various XHTML environments.
  • -
- -

The XHTML family is the next step in the evolution of the Internet. By -migrating to XHTML today, content developers can enter the XML world with all -of its attendant benefits, while still remaining confident in their -content's backward and future compatibility.

- -

1.1 What is HTML 4.0?

- -

HTML 4.0 [HTML] is an SGML (Standard -Generalized Markup Language) application conforming to -International Standard ISO 8879, and is widely regarded as the -standard publishing language of the World Wide Web.

- -

SGML is a language for describing markup languages, -particularly those used in electronic document exchange, document -management, and document publishing. HTML is an example of a -language defined in SGML.

- -

SGML has been around since the middle 1980's and has remained -quite stable. Much of this stability stems from the fact that the -language is both feature-rich and flexible. This flexibility, -however, comes at a price, and that price is a level of -complexity that has inhibited its adoption in a diversity of -environments, including the World Wide Web.

- -

HTML, as originally conceived, was to be a language for the -exchange of scientific and other technical documents, suitable -for use by non-document specialists. HTML addressed the problem -of SGML complexity by specifying a small set of structural and -semantic tags suitable for authoring relatively simple documents. -In addition to simplifying the document structure, HTML added -support for hypertext. Multimedia capabilities were added -later.

- -

In a remarkably short space of time, HTML became wildly -popular and rapidly outgrew its original purpose. Since HTML's -inception, there has been rapid invention of new elements for use -within HTML (as a standard) and for adapting HTML to vertical, -highly specialized, markets. This plethora of new elements has -led to compatibility problems for documents across different -platforms.

- -

As the heterogeneity of both software and platforms rapidly -proliferate, it is clear that the suitability of 'classic' HTML -4.0 for use on these platforms is somewhat limited.

- -

1.2 What is XML?

- -

XML is the shorthand for Extensible Markup -Language, and is an acronym of Extensible Markup Language [XML].

- -

XML was conceived as a means of regaining the power and -flexibility of SGML without most of its complexity. Although a -restricted form of SGML, XML nonetheless preserves most of SGML's -power and richness, and yet still retains all of SGML's commonly -used features.

- -

While retaining these beneficial features, XML removes many of -the more complex features of SGML that make the authoring and -design of suitable software both difficult and costly.

- -

1.3 Why the need for XHTML?

- -

The benefits of migrating to XHTML 1.0 are described above. Some of the -benefits of migrating to XHTML in general are:

- -
    -
  • Document developers and user agent designers are constantly -discovering new ways to express their ideas through new markup. In XML, it is -relatively easy to introduce new elements or additional element -attributes. The XHTML family is designed to accommodate these extensions -through XHTML modules and techniques for developing new XHTML-conforming -modules (described in the forthcoming XHTML Modularization specification). -These modules will permit the combination of existing and -new feature sets when developing content and when designing new user -agents.
  • - -
  • Alternate ways of accessing the Internet are constantly being -introduced. Some estimates indicate that by the year 2002, 75% of -Internet document viewing will be carried out on these alternate -platforms. The XHTML family is designed with general user agent -interoperability in mind. Through a new user agent and document profiling -mechanism, servers, proxies, and user agents will be able to perform -best effort content transformation. Ultimately, it will be possible to -develop XHTML-conforming content that is usable by any XHTML-conforming -user agent.
  • - -
- -

2. Definitions

- -

2.1 Terminology

- -

The following terms are used in this specification. These -terms extend the definitions in -[RFC2119] in ways based upon similar definitions in ISO/IEC -9945-1:1990 [POSIX.1]:

- -
-
Implementation-defined
- -
A value or behavior is implementation-defined when it is left -to the implementation to define [and document] the corresponding -requirements for correct document construction.
- -
May
- -
With respect to implementations, the word "may" is to be -interpreted as an optional feature that is not required in this -specification but can be provided. With respect to Document Conformance, the word "may" means that -the optional feature must not be used. The term "optional" has -the same definition as "may".
- -
Must
- -
In this specification, the word "must" is to be interpreted -as a mandatory requirement on the implementation or on Strictly -Conforming XHTML Documents, depending upon the context. The term -"shall" has the same definition as "must".
- -
Reserved
- -
A value or behavior is unspecified, but it is not allowed to -be used by Conforming Documents nor to be supported by a -Conforming User Agents.
- -
Should
- -
With respect to implementations, the word "should" is to be -interpreted as an implementation recommendation, but not a -requirement. With respect to documents, the word "should" is to -be interpreted as recommended programming practice for documents -and a requirement for Strictly Conforming XHTML Documents.
- -
Supported
- -
Certain facilities in this specification are optional. If a -facility is supported, it behaves as specified by this -specification.
- -
Unspecified
- -
When a value or behavior is unspecified, the specification -defines no portability requirements for a facility on an -implementation even when faced with a document that uses the -facility. A document that requires specific behavior in such an -instance, rather than tolerating any behavior when using that -facility, is not a Strictly Conforming XHTML Document.
-
- -

2.2 General Terms

- -
-
Attribute
- -
An attribute is a parameter to an element declared in the -DTD. An attribute's type and value range, including a possible -default value, are defined in the DTD.
- -
DTD
- -
A DTD, or document type definition, is a collection of XML -declarations that, as a collection, defines the legal structure, -elements, and -attributes that are available for use in a document that -complies to the DTD.
- -
Document
- -
A document is a stream of data that, after being combined -with any other streams it references, is structured such that it -holds information contained within -elements that are organized as defined in the associated -DTD. See Document -Conformance for more information.
- -
Element
- -
An element is a document structuring unit declared in the -DTD. The element's content model is -defined in the DTD, and additional -semantics may be defined in the prose description of the -element.
- -
Facilities
- -
Functionality includes elements, -attributes, and the semantics -associated with those elements and -attributes. An implementation -supporting that functionality is said to provide the necessary -facilities.
- -
Implementation
- -
An implementation is a system that provides collection of -facilities and services that supports -this specification. See User Agent -Conformance for more information.
- -
Parsing
- -
Parsing is the act whereby a -document is scanned, and the information contained within -the document is filtered into the -context of the elements in which the -information is structured.
- -
Rendering
- -
Rendering is the act whereby the information in a document is presented. This presentation is -done in the form most appropriate to the environment (e.g. -aurally, visually, in print).
- -
User Agent
- -
A user agent is an implementation -that retrieves and processes XHTML documents. See User Agent Conformance for more information.
- -
Validation
- -
Validation is a process whereby -documents are verified against the associated DTD, ensuring that the structure, use of elements, and use of -attributes are consistent with the definitions in the -DTD.
- -
Well-formed
- -
A document is well-formed when it -is structured according to the rules defined in Section 2.1 of -the XML 1.0 Recommendation [XML]. -Basically, this definition states that elements, delimited by -their start and end tags, are nested properly within one -another.
-
- - -

3. Normative Definition of -XHTML 1.0

- -

3.1 Document -Conformance

- -

This version of XHTML provides a definition of strictly -conforming XHTML documents, which are restricted to tags and -attributes from the XHTML namespace. See Section 3.1.2 for information on using XHTML -with other namespaces, for instance, to include metadata -expressed in RDF within XHTML documents.

- -

3.1.1 Strictly Conforming -Documents

- -

A Strictly Conforming XHTML Document is a document that -requires only the facilities described as mandatory in this -specification. Such a document must meet all of the following -criteria:

- -
    -
  1. -

    It must validate against one of the three DTDs found in Appendix A.

    -
  2. - -
  3. -

    The root element of the document must be -<html>.

    -
  4. - -
  5. -

    The root element of the document must designate the XHTML -namespace using the xmlns attribute [XMLNAMES]. The namespace for XHTML is -defined to be -http://www.w3.org/1999/xhtml.

    -
  6. - -
  7. -

    There must be a DOCTYPE declaration in the document prior to -the root element. The public identifier included in -the DOCTYPE declaration must reference one of the three DTDs -found in Appendix A using the respective -Formal Public Identifier. The system identifier may be changed to reflect -local system conventions.

    - -
    -<!DOCTYPE html
    -     PUBLIC "-//W3C//DTD XHTML 1.0 Strict//EN"
    -     "http://www.w3.org/TR/1999/PR-xhtml1-19991210/DTD/xhtml1-strict.dtd>
    -
    -<!DOCTYPE html
    -     PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN"
    -     "http://www.w3.org/TR/1999/PR-xhtml1-19991210/DTD/xhtml1-transitional.dtd>
    -
    -<!DOCTYPE html
    -     PUBLIC "-//W3C//DTD XHTML 1.0 Frameset//EN"
    -     "http://www.w3.org/TR/1999/PR-xhtml1-19991210/DTD/xhtml1-frameset.dtd>
    -
    -
  8. -
- -

Here is an example of a minimal XHTML document.

- -
-
-<?xml version="1.0" encoding="UTF-8"?>
-<!DOCTYPE html
-     PUBLIC "-//W3C//DTD XHTML 1.0 Strict//EN"
-    "http://www.w3.org/TR/1999/PR-xhtml1-19991210/DTD/xhtml1-strict.dtd">
-<html xmlns="http://www.w3.org/1999/xhtml" xml:lang="en" lang="en">
-  <head>
-    <title>Virtual Library</title>
-  </head>
-  <body>
-    <p>Moved to <a href="http://vlib.org/">vlib.org</a>.</p>
-  </body>
-</html>
-
- -

Note that in this example, the XML declaration is included. An XML -declaration like the one above is -not required in all XML documents. XHTML document authors are strongly encouraged to use XML declarations in all their documents. Such a declaration is required -when the character encoding of the document is other than the default UTF-8 or -UTF-16.

- -

3.1.2 Using XHTML with -other namespaces

- -

The XHTML namespace may be used with other XML namespaces -as per [XMLNAMES], although such -documents are not strictly conforming XHTML 1.0 documents as -defined above. Future work by W3C will address ways to specify -conformance for documents involving multiple namespaces.

- -

The following example shows the way in which XHTML 1.0 could -be used in conjunction with the MathML Recommendation:

- -
-
-<html xmlns="http://www.w3.org/1999/xhtml" xml:lang="en" lang="en">
-  <head>
-    <title>A Math Example</title>
-  </head>
-  <body>
-    <p>The following is MathML markup:</p>
-    <math xmlns="http://www.w3.org/1998/Math/MathML">
-      <apply> <log/>
-        <logbase>
-          <cn> 3 </cn>
-        </logbase>
-        <ci> x </ci>
-      </apply>
-    </math>
-  </body>
-</html>
-
-
- -

The following example shows the way in which XHTML 1.0 markup -could be incorporated into another XML namespace:

- -
-
-<?xml version="1.0" encoding="UTF-8"?>
-<!-- initially, the default namespace is "books" -->
-<book xmlns='urn:loc.gov:books'
-    xmlns:isbn='urn:ISBN:0-395-36341-6' xml:lang="en" lang="en">
-  <title>Cheaper by the Dozen</title>
-  <isbn:number>1568491379</isbn:number>
-  <notes>
-    <!-- make HTML the default namespace for a hypertext commentary -->
-    <p xmlns='http://www.w3.org/1999/xhtml'>
-        This is also available <a href="http://www.w3.org/">online</a>.
-    </p>
-  </notes>
-</book>
-
-
- -

3.2 User Agent -Conformance

- -

A conforming user agent must meet all of the following -criteria:

- -
    -
  1. In order to be consistent with the XML 1.0 Recommendation [XML], the user agent must parse and evaluate -an XHTML document for well-formedness. If the user agent claims -to be a validating user agent, it must also validate documents -against their referenced DTDs according to -[XML].
  2. - -
  3. When the user agent claims to support -facilities defined within this specification or required by -this specification through normative reference, it must do so in -ways consistent with the facilities' definition.
  4. - -
  5. When a user agent processes an XHTML document as generic XML, -it shall only recognize attributes of type -ID (e.g. the id attribute on most XHTML elements) -as fragment identifiers.
  6. - -
  7. If a user agent encounters an element it does not recognize, -it must render the element's content.
  8. - -
  9. If a user agent encounters an attribute it does not -recognize, it must ignore the entire attribute specification -(i.e., the attribute and its value).
  10. - -
  11. If a user agent encounters an attribute value it doesn't -recognize, it must use the default attribute value.
  12. - -
  13. If it encounters an entity reference (other than one -of the predefined entities) for which the User Agent has -processed no declaration (which could happen if the declaration -is in the external subset which the User Agent hasn't read), the entity -reference should be rendered as the characters (starting -with the ampersand and ending with the semi-colon) that -make up the entity reference.
  14. - -
  15. When rendering content, User Agents that encounter -characters or character entity references that are recognized but not renderable should display the document in such a way that it is obvious to the user that normal rendering has not taken place.
  16. - -
  17. -The following characters are defined in [XML] as whitespace characters: - -
      -
    • Space (&#x0020;)
    • -
    • Tab (&#x0009;)
    • -
    • Carriage return (&#x000D;)
    • -
    • Line feed (&#x000A;)
    • -
    - -

    -The XML processor normalizes different system's line end codes into one -single line-feed character, that is passed up to the application. The XHTML -user agent in addition, must treat the following characters as whitespace: -

    - -
      -
    • Form feed (&#x000C;)
    • -
    • Zero-width space (&#x200B;)
    • -
    - -

    -In elements where the 'xml:space' attribute is set to 'preserve', the user -agent must leave all whitespace characters intact (with the exception of -leading and trailing whitespace characters, which should be removed). -Otherwise, whitespace -is handled according to the following rules: -

    - -
      -
    • -All whitespace surrounding block elements should be removed. -
    • -
    • -Comments are removed entirely and do not affect whitespace handling. One -whitespace character on either side of a comment is treated as two white -space characters. -
    • -
    • -Leading and trailing whitespace inside a block element must be removed. -
    • -
    • Line feed characters within a block element must be converted into a -space (except when the 'xml:space' attribute is set to 'preserve'). -
    • -
    • -A sequence of white space characters must be reduced to a single space -character (except when the 'xml:space' attribute is set to 'preserve'). -
    • -
    • -With regard to rendition, -the User Agent should render the content in a -manner appropriate to the language in which the content is written. -In languages whose primary script is Latinate, the ASCII space -character is typically used to encode both grammatical word boundaries and -typographic whitespace; in languages whose script is related to Nagari -(e.g., Sanskrit, Thai, etc.), grammatical boundaries may be encoded using -the ZW 'space' character, but will not typically be represented by -typographic whitespace in rendered output; languages using Arabiform scripts -may encode typographic whitespace using a space character, but may also use -the ZW space character to delimit 'internal' grammatical boundaries (what -look like words in Arabic to an English eye frequently encode several words, -e.g. 'kitAbuhum' = 'kitAbu-hum' = 'book them' == their book); and languages -in the Chinese script tradition typically neither encode such delimiters nor -use typographic whitespace in this way. -
    • -
    - -

    Whitespace in attribute values is processed according to [XML].

    -
  18. -
- - -

4. Differences with HTML -4.0

- -

Due to the fact that XHTML is an XML application, certain -practices that were perfectly legal in SGML-based HTML 4.0 [HTML] must be changed.

- -

4.1 Documents must be -well-formed

- -

Well-formedness is a new concept -introduced by [XML]. Essentially this -means that all elements must either have closing tags or be -written in a special form (as described below), and that all the -elements must nest.

- -

Although overlapping is illegal in SGML, it was widely -tolerated in existing browsers.

- -
-

CORRECT: nested elements.

- -

<p>here is an emphasized -<em>paragraph</em>.</p>

-
- -
-

INCORRECT: overlapping elements

- -

<p>here is an emphasized -<em>paragraph.</p></em>

-
- -

4.2 Element and attribute -names must be in lower case

- -

XHTML documents must use lower case for all HTML element and -attribute names. This difference is necessary because XML is -case-sensitive e.g. <li> and <LI> are different -tags.

- -

4.3 For non-empty elements, -end tags are required

- -

In SGML-based HTML 4.0 certain elements were permitted to omit -the end tag; with the elements that followed implying closure. -This omission is not permitted in XML-based XHTML. All elements -other than those declared in the DTD as EMPTY must -have an end tag.

- -
-

CORRECT: terminated elements

- -

<p>here is a paragraph.</p><p>here is -another paragraph.</p>

-
- -
-

INCORRECT: unterminated elements

- -

<p>here is a paragraph.<p>here is another -paragraph.

-
- -

4.4 Attribute values must -always be quoted

- -

All attribute values must be quoted, even those which appear -to be numeric.

- -
-

CORRECT: quoted attribute values

- -

<table rows="3">

-
- -
-

INCORRECT: unquoted attribute values

- -

<table rows=3>

-
- -

4.5 Attribute -Minimization

- -

XML does not support attribute minimization. Attribute-value -pairs must be written in full. Attribute names such as -compact and checked cannot occur in elements -without their value being specified.

- -
-

CORRECT: unminimized attributes

- -

<dl compact="compact">

-
- -
-

INCORRECT: minimized attributes

- -

<dl compact>

-
- -

4.6 Empty Elements

- -

Empty elements must either have an end tag or the start tag must end with />. For instance, -<br/> or <hr></hr>. See HTML Compatibility Guidelines for information on ways to -ensure this is backward compatible with HTML 4.0 user agents.

- -
-

CORRECT: terminated empty tags

- -

<br/><hr/>

-
- -
-

INCORRECT: unterminated empty tags

- -

<br><hr>

-
- -

4.7 Whitespace handling in -attribute values

- -

In attribute values, user agents will strip leading and -trailing whitespace from attribute values and map sequences -of one or more whitespace characters (including line breaks) to -a single inter-word space (an ASCII space character for western -scripts). See -Section 3.3.3 of [XML].

- -

4.8 Script and Style -elements

- -

In XHTML, the script and style elements are declared as having -#PCDATA content. As a result, < and -& will be treated as the start of markup, and -entities such as &lt; and &amp; -will be recognized as entity references by the XML processor to -< and & respectively. Wrapping -the content of the script or style element within a -CDATA marked section avoids the expansion of these -entities.

- -
-
-<script>
- <![CDATA[
- ... unescaped script content ...
- ]]>
- </script>
-
-
- -

CDATA sections are recognized by the XML -processor and appear as nodes in the Document Object Model, see - -Section 1.3 of the DOM Level 1 Recommendation [DOM].

- -

An alternative is to use external script and style -documents.

- -

4.9 SGML exclusions

- -

SGML gives the writer of a DTD the ability to exclude specific -elements from being contained within an element. Such -prohibitions (called "exclusions") are not possible in XML.

- -

For example, the HTML 4.0 Strict DTD forbids the nesting of an -'a' element within another 'a' element -to any descendant depth. It is not possible to spell out such -prohibitions in XML. Even though these prohibitions cannot be -defined in the DTD, certain elements should not be nested. A -summary of such elements and the elements that should not be -nested in them is found in the normative -Appendix B.

- -

4.10 The elements with 'id' and 'name' -attributes

- -

HTML 4.0 defined the name attribute for the elements -a, -applet, frame, -iframe, img, and map. -HTML 4.0 also introduced -the id attribute. Both of these attributes are designed to be -used as fragment identifiers.

-

In XML, fragment identifiers are of type ID, and -there can only be a single attribute of type ID per element. -Therefore, in XHTML 1.0 the id -attribute is defined to be of type ID. In order to -ensure that XHTML 1.0 documents are well-structured XML documents, XHTML 1.0 -documents MUST use the id attribute when defining fragment -identifiers, even on elements that historically have also had a -name attribute. -See the HTML Compatibility -Guidelines for information on ensuring such anchors are backwards -compatible when serving XHTML documents as media type text/html. -

-

Note that in XHTML 1.0, the name attribute of these -elements is formally deprecated, and will be removed in a -subsequent version of XHTML.

- - -

5. Compatibility Issues

- -

Although there is no requirement for XHTML 1.0 documents to be -compatible with existing user agents, in practice this is easy to -accomplish. Guidelines for creating compatible documents can be -found in Appendix C.

- -

5.1 Internet Media Type

-

As of the publication of this recommendation, the general -recommended MIME labeling for XML-based applications -has yet to be resolved.

- -

However, XHTML Documents which follow the guidelines set forth -in Appendix C, "HTML Compatibility Guidelines" may be -labeled with the Internet Media Type "text/html", as they -are compatible with most HTML browsers. This document -makes no recommendation about MIME labeling of other -XHTML documents.

- - -

6. Future Directions

- -

XHTML 1.0 provides the basis for a family of document types -that will extend and subset XHTML, in order to support a wide -range of new devices and applications, by defining modules and -specifying a mechanism for combining these modules. This -mechanism will enable the extension and sub-setting of XHTML 1.0 -in a uniform way through the definition of new modules.

- -

6.1 Modularizing HTML

- -

As the use of XHTML moves from the traditional desktop user -agents to other platforms, it is clear that not all of the XHTML -elements will be required on all platforms. For example a hand -held device or a cell-phone may only support a subset of XHTML -elements.

- -

The process of modularization breaks XHTML up into a series of -smaller element sets. These elements can then be recombined to -meet the needs of different communities.

- -

These modules will be defined in a later W3C document.

- -

6.2 Subsets and -Extensibility

- -

Modularization brings with it several advantages:

- -
    -
  • -

    It provides a formal mechanism for sub-setting XHTML.

    -
  • - -
  • -

    It provides a formal mechanism for extending XHTML.

    -
  • - -
  • -

    It simplifies the transformation between document types.

    -
  • - -
  • -

    It promotes the reuse of modules in new document types.

    -
  • -
- -

6.3 Document -Profiles

- -

A document profile specifies the syntax and semantics of a set -of documents. Conformance to a document profile provides a basis -for interoperability guarantees. The document profile specifies -the facilities required to process documents of that type, e.g. -which image formats can be used, levels of scripting, style sheet -support, and so on.

- -

For product designers this enables various groups to define -their own standard profile.

- -

For authors this will obviate the need to write several -different versions of documents for different clients.

- -

For special groups such as chemists, medical doctors, or -mathematicians this allows a special profile to be built using -standard HTML elements plus a group of elements geared to the -specialist's needs.

- - -

-Appendix A. DTDs

- -

This appendix is normative.

- -

These DTDs and entity sets form a normative part of this -specification. The complete set of DTD files together with an XML -declaration and SGML Open Catalog is included in the zip file for this specification.

- -

A.1 Document Type -Definitions

- -

These DTDs approximate the HTML 4.0 DTDs. It is likely that -when the DTDs are modularized, a method of DTD construction will -be employed that corresponds more closely to HTML 4.0.

- - - -

A.2 Entity Sets

- -

The XHTML entity sets are the same as for HTML 4.0, but have -been modified to be valid XML 1.0 entity declarations. Note the -entity for the Euro currency sign (&euro; or -&#8364; or &#x20AC;) is defined -as part of the special characters.

- - - - -

Appendix B. Element -Prohibitions

- -

This appendix is normative.

- -

The following elements have prohibitions on which elements -they can contain (see Section 4.9). This -prohibition applies to all depths of nesting, i.e. it contains -all the descendant elements.

- -
a
-
-cannot contain other a elements.
-
pre
-
cannot contain the img, object, -big, small, sub, or -sup elements.
- -
button
-
cannot contain the input, select, -textarea, label, button, -form, fieldset, iframe or -isindex elements.
-
label
-
cannot contain other label elements.
-
form
-
cannot contain other form elements.
-
- - -

Appendix C. -HTML Compatibility Guidelines

- -

This appendix is informative.

- -

This appendix summarizes design guidelines for authors who -wish their XHTML documents to render on existing HTML user -agents.

- -

C.1 Processing Instructions

-

Be aware that processing instructions are rendered on some -user agents. However, also note that when the XML declaration is not included -in a document, the document can only use the default character encodings UTF-8 -or UTF-16.

- -

C.2 Empty Elements

-

Include a space before the trailing / and -> of empty elements, e.g. -<br />, -<hr /> and <img -src="karen.jpg" alt="Karen" />. Also, use the -minimized tag syntax for empty elements, e.g. <br />, as the alternative syntax <br></br> allowed by XML -gives uncertain results in many existing user agents.

- -

C.3 Element Minimization and Empty Element Content

-

Given an empty instance of an element whose content model is -not EMPTY (for example, an empty title or paragraph) -do not use the minimized form (e.g. use -<p> </p> and not -<p />).

- -

C.4 Embedded Style Sheets and Scripts

-

Use external style sheets if your style sheet uses -< or & or ]]> or --. Use -external scripts if your script uses < or -& or ]]> or --. Note that XML parsers -are permitted to silently remove the contents of comments. Therefore, the historical -practice of "hiding" scripts and style sheets within comments to make the -documents backward compatible is likely to not work as expected in XML-based -implementations.

- -

C.5 Line Breaks within Attribute Values

-

Avoid line breaks and multiple whitespace characters within -attribute values. These are handled inconsistently by user -agents.

- -

C.6 Isindex

-

Don't include more than one isindex element in -the document head. The isindex element -is deprecated in favor of the input element.

- -

C.7 The lang and xml:lang Attributes

-

Use both the lang and xml:lang -attributes when specifying the language of an element. The value -of the xml:lang attribute takes precedence.

- -

C.8 Fragment Identifiers

-

In XML, URIs [RFC2396] that end with fragment identifiers of the form -"#foo" do not refer to elements with an attribute -name="foo"; rather, they refer to elements with an -attribute defined to be of type ID, e.g., the -id attribute in HTML 4.0. Many existing HTML clients don't -support the use of ID-type attributes in this way, -so identical values may be supplied for both of these attributes to ensure -maximum forward and backward compatibility (e.g., <a id="foo" name="foo">...</a>).

- -

Further, since the set of -legal values for attributes of type ID is much smaller than -for those of type CDATA, the type of the name -attribute has been changed to NMTOKEN. This attribute is -constrained such that it can only have the same values as type -ID, or as the Name production in XML 1.0 Section -2.5, production 5. Unfortunately, this constraint cannot be expressed in the -XHTML 1.0 DTDs. Because of this change, care must be taken when -converting existing HTML documents. The values of these attributes -must be unique within the document, valid, and any references to these -fragment identifiers (both -internal and external) must be updated should the values be changed during -conversion.

-

Finally, note that XHTML 1.0 has deprecated the -name attribute of the a, applet, frame, iframe, img, and map -elements, and it will be -removed from XHTML in subsequent versions.

- -

C.9 Character Encoding

-

To specify a character encoding in the document, use both the -encoding attribute specification on the xml declaration (e.g. -<?xml version="1.0" -encoding="EUC-JP"?>) and a meta http-equiv statement -(e.g. <meta http-equiv="Content-type" -content='text/html; charset="EUC-JP"' />). The -value of the encoding attribute of the xml processing instruction -takes precedence.

- -

C.10 Boolean Attributes

-

Some HTML user agents are unable to interpret boolean -attributes when these appear in their full (non-minimized) form, -as required by XML 1.0. Note this problem doesn't effect user -agents compliant with HTML 4.0. The following attributes are -involved: compact, nowrap, -ismap, declare, noshade, -checked, disabled, readonly, -multiple, selected, -noresize, defer.

- -

C.11 Document Object Model and XHTML

-

-The Document Object Model level 1 Recommendation [DOM] -defines document object model interfaces for XML and HTML 4.0. The HTML 4.0 -document object model specifies that HTML element and attribute names are -returned in upper-case. The XML document object model specifies that -element and attribute names are returned in the case they are specified. In -XHTML 1.0, elements and attributes are specified in lower-case. This apparent difference can be -addressed in two ways: -

-
    -
  1. Applications that access XHTML documents served as Internet media type -text/html -via the DOM can use the HTML DOM, -and can rely upon element and attribute names being returned in -upper-case from those interfaces.
  2. -
  3. Applications that access XHTML documents served as Internet media types -text/xml or application/xml -can also use the XML DOM. Elements and attributes will be returned in lower-case. -Also, some XHTML elements may or may -not appear -in the object tree because they are optional in the content model -(e.g. the tbody element within -table). This occurs because in HTML 4.0 some elements were -permitted to be minimized such that their start and end tags are both omitted -(an SGML feature). -This is not possible in XML. Rather than require document authors to insert -extraneous elements, XHTML has made the elements optional. -Applications need to adapt to this -accordingly.
  4. -
- -

C.12 Using Ampersands in Attribute Values

-

-When an attribute value contains an ampersand, it must be expressed as a character -entity reference -(e.g. "&amp;"). For example, when the -href attribute -of the a element refers to a -CGI script that takes parameters, it must be expressed as -http://my.site.dom/cgi-bin/myscript.pl?class=guest&amp;name=user -rather than as -http://my.site.dom/cgi-bin/myscript.pl?class=guest&name=user. -

- -

C.13 Cascading Style Sheets (CSS) and XHTML

- -

The Cascading Style Sheets level 2 Recommendation [CSS2] defines style -properties which are applied to the parse tree of the HTML or XML -document. Differences in parsing will produce different visual or -aural results, depending on the selectors used. The following hints -will reduce this effect for documents which are served without -modification as both media types:

- -
    -
  1. -CSS style sheets for XHTML should use lower case element and -attribute names.
  2. - - -
  3. In tables, the tbody element will be inferred by the parser of an -HTML user agent, but not by the parser of an XML user agent. Therefore -you should always explicitely add a tbody element if it is referred to -in a CSS selector.
  4. - -
  5. Within the XHTML name space, user agents are expected to -recognize the "id" attribute as an attribute of type ID. -Therefore, style sheets should be able to continue using the -shorthand "#" selector syntax even if the user agent does not read -the DTD.
  6. - -
  7. Within the XHTML name space, user agents are expected to -recognize the "class" attribute. Therefore, style sheets should be -able to continue using the shorthand "." selector syntax.
  8. - -
  9. -CSS defines different conformance rules for HTML and XML documents; -be aware that the HTML rules apply to XHTML documents delivered as -HTML and the XML rules apply to XHTML documents delivered as XML.
  10. -
- -

Appendix D. -Acknowledgements

- -

This appendix is informative.

- -

This specification was written with the participation of the -members of the W3C HTML working group:

- -
-
Steven Pemberton, CWI (HTML Working Group Chair)
-Murray Altheim, Sun Microsystems
-Daniel Austin, CNET: The Computer Network
-Frank Boumphrey, HTML Writers Guild
-John Burger, Mitre
-Andrew W. Donoho, IBM
-Sam Dooley, IBM
-Klaus Hofrichter, GMD
-Philipp Hoschka, W3C
-Masayasu Ishikawa, W3C
-Warner ten Kate, Philips Electronics
-Peter King, Phone.com
-Paula Klante, JetForm
-Shin'ichi Matsui, W3C/Panasonic
-Shane McCarron, Applied Testing and Technology (The Open Group through August -1999)
-Ann Navarro, HTML Writers Guild
-Zach Nies, Quark
-Dave Raggett, W3C/HP (W3C lead for HTML)
-Patrick Schmitz, Microsoft
-Sebastian Schnitzenbaumer, Stack Overflow
-Chris Wilson, Microsoft
-Ted Wugofski, Gateway 2000
-Dan Zigmond, WebTV Networks
-
- - -

Appendix E. References

- -

This appendix is informative.

- -
- -
[CSS2]
- -
"Cascading Style Sheets, level 2 (CSS2) Specification", B. -Bos, H. W. Lie, C. Lilley, I. Jacobs, 12 May 1998.
-Available at: -http://www.w3.org/TR/REC-CSS2
- -
[DOM]
- -
"Document Object Model (DOM) Level 1 Specification", Lauren -Wood et al., 1 October 1998.
-Available at: -http://www.w3.org/TR/REC-DOM-Level-1
- -
[HTML]
- -
"HTML 4.01 Specification", D. Raggett, A. Le Hors, I. -Jacobs, 24 August 1999.
-Available at: -http://www.w3.org/TR/1999/PR-html40-19990824
- -
[POSIX.1]
- -
"ISO/IEC 9945-1:1990 Information Technology - Portable -Operating System Interface (POSIX) - Part 1: System Application -Program Interface (API) [C Language]", Institute of Electrical -and Electronics Engineers, Inc, 1990.
- -
-[RFC2046]
- -
"RFC2046: Multipurpose Internet Mail Extensions (MIME) Part -Two: Media Types", N. Freed and N. Borenstein, November -1996.
-Available at -http://www.ietf.org/rfc/rfc2046.txt. Note that this RFC -obsoletes RFC1521, RFC1522, and RFC1590.
- -
-[RFC2119]
- -
"RFC2119: Key words for use in RFCs to Indicate Requirement -Levels", S. Bradner, March 1997.
-Available at: -http://www.ietf.org/rfc/rfc2119.txt
- -
-[RFC2376]
- -
"RFC2376: XML Media Types", E. Whitehead, M. Murata, July -1998.
-Available at: -http://www.ietf.org/rfc/rfc2376.txt
- -
-[RFC2396]
- -
"RFC2396: Uniform Resource Identifiers (URI): Generic -Syntax", T. Berners-Lee, R. Fielding, L. Masinter, August -1998.
-This document updates RFC1738 and RFC1808.
-Available at: -http://www.ietf.org/rfc/rfc2396.txt
- -
[XML]
- -
"Extensible Markup Language (XML) 1.0 Specification", T. -Bray, J. Paoli, C. M. Sperberg-McQueen, 10 February 1998.
-Available at: -http://www.w3.org/TR/REC-xml
- -
[XMLNAMES]
- -
"Namespaces in XML", T. Bray, D. Hollander, A. Layman, 14 -January 1999.
-XML namespaces provide a simple method for qualifying names used -in XML documents by associating them with namespaces identified -by URI.
-Available at: -http://www.w3.org/TR/REC-xml-names
- -
-

-

- - - -~~~~~~~~~~ diff --git a/src/lint/linter/__tests__/xml/xlink.lint-test b/src/lint/linter/__tests__/xml/xlink.lint-test deleted file mode 100644 --- a/src/lint/linter/__tests__/xml/xlink.lint-test +++ /dev/null @@ -1,530 +0,0 @@ - - - -]> - - - - - - - -
- XML Linking Language (XLink) - Version 1.0 - WD-xlink-19990527 - World Wide Web Consortium Working Draft - 29May1999 - -

This draft is for public discussion.

-
- http://www.w3.org/XML/Group/1999/05/WD-xlink-current - - - http://www.w3.org/XML/Group/1999/05/WD-xlink-19990527 - http://www.w3.org/XML/Group/1999/05/WD-xlink-19990505 - http://www.w3.org/TR/1998/WD-xlink-19980303 - http://www.w3.org/TR/WD-xml-link-970630 - - - - - - Steve DeRose - Inso Corp. and Brown University - Steven_DeRose@Brown.edu - - - David Orchard - IBM Corp. - dorchard@ca.ibm.com - - - Ben Trafford - Invited Expert - bent@exemplary.net - - - - - -

This is a W3C Working Draft for review by W3C members and other interested parties. It is a draft document and may be updated, replaced, or obsoleted by other documents at any time. It is inappropriate to use W3C Working Drafts as reference material or to cite them as other than "work in progress". A list of current W3C working drafts can be found at http://www.w3.org/TR.

-

Note: Since working drafts are subject to frequent change, you are advised to reference the above URI, rather than the URIs for working drafts themselves. Some of the work remaining is described in .

-

This work is part of the W3C XML Activity (for current status, see http://www.w3.org/XML/Activity ). For information about the XPointer language which is expected to be used with XLink, see http://www.w3.org/TR/WD-xptr. -

-

See http://www.w3.org/TR/NOTE-xlink-principles for additional background on the design principles informing XLink.

-

Also see http://www.w3.org/TR/NOTE-xlink-req/ for the XLink requirements that this document attempts to satisfy.

-
- - - -

This specification defines constructs that may be inserted into XML DTDs, schemas and document instances to describe links between objects. It uses XML syntax to create structures that can describe the simple unidirectional hyperlinks of today's HTML as well as more sophisticated links.

-
- - -

Burlington, Seekonk, et al.: World-Wide Web Consortium, XML Working Group, 1998.

-
- - -

Created in electronic form.

-
- - - English - Extended Backus-Naur Form (formal grammar) - - - - - 1997-01-15 : Skeleton draft by TB - 1997-01-24 : Fleshed out by sjd - 1997-04-08 : Substantive draft - 1997-06-30 : Public draft - 1997-08-01 : Public draft - 1997-08-05 : Prose/organization work by sjd - 1997-10-14: Conformance and design principles; a bit of cleanup by elm - 1997-11-07: Update for editorial issues per issues doc, by sjd. - 1997-12-01: Update for editorial issues per issues doc in preparation for F2F meeting, by sjd. - 1998-01-13: Editorial cleanup, addition of new design principles, by elm. - 1998-02-27: Splitting out of XLink and XPointer, by elm. - 1998-03-03: Moved most of the XPointer locator stuff here. elm - 1999-04-24: Editorial rewrites to represent new ideas on XLink, especially the inclusion of arcs. bent - 1999-05-05: Prose/organization work by dorchard. Moved much of the semantics section around, from: locators, link semantics, remote resource semantics, local resource semantics; to: resource semantics, locators, behavior semantics, link semantics, arc semantics - 1999-05-12: Prose/organization work. Re-organized some of the sections, removed XML constructs from the document, added descriptive prose, edited document text for clarity. Rewrote the link recognition section. bent - 1999-05-17: Further prose work. Added non-normative examples. Clarified arcs. bent - 1999-05-23: Edited for grammar and clarity. bent - 1999-05-27: Final once-over before sending to group. Fixed sjd's email address. bent - - -
- - - - Introduction -

This specification defines constructs that may be inserted into XML DTDs, schemas, and document instances to describe links between objects. A link, as the term is used here, is an explicit relationship between two or more data objects or portions of data objects. This specification is concerned with the syntax used to assert link existence and describe link characteristics. Implicit (unasserted) relationships, for example that of one word to the next or that of a word in a text to its entry in an on-line dictionary are obviously important, but outside its scope.

-

Links are asserted by elements contained in XML document instances. The simplest case is very like an HTML A link, and has these characteristics: - -

The link is expressed at one of its ends (similar to the A element in some document)

-

Users can only initiate travel from that end to the other

-

The link's effect on windows, frames, go-back lists, stylesheets in use, and so on is mainly determined by browsers, not by the link itself. For example, traveral of A links normally replaces the current view, perhaps with a user option to open a new window.

-

The link goes to only one destination (although a server may have great freedom in finding or dynamically creating that destination).

- -

-

While this set of characteristics is already very powerful and obviously has proven itself highly useful and effective, each of these assumptions also limits the range of hypertext functionality. The linking model defined here provides ways to create links that go beyond each of these specific characteristics, thus providing features previously available mostly in dedicated hypermedia systems. -

- - - Origin and Goals -

Following is a summary of the design principles governing XLink: - -

XLink must be straightforwardly usable over the Internet.

-

XLink must be usable by a wide variety of link usage domains and classes of linking application software.

-

XLink must support HTML 4.0 linking constructs.

-

The XLink expression language must be XML.

-

The XLink design must be formal, concise, and illustrative.

-

XLinks must be human-readable and human-writable.

-

XLinks may reside within or outside the documents in which the - participating resources reside.

-

XLink must represent the abstract structure and significance of links.

-

XLink must be feasible to implement.

-

XLink must be informed by knowledge of established hypermedia systems and standards.

- -

-
- - - - Relationship to Existing Standards -

Three standards have been especially influential: - -

HTML: Defines several SGML element types that represent links.

-

HyTime: Defines inline and out-of-line link structures and some semantic features, including traversal control and presentation of objects. -

-

Text Encoding Initiative Guidelines (TEI P3): Provides structures for creating links, aggregate objects, and link collections out of them.

- -

-

Many other linking systems have also informed this design, especially Dexter, FRESS, MicroCosm, and InterMedia.

-
- - - Terminology -

The following basic terms apply in this document. - - - -

A symbolic representation of traversal behavior in links, especially the direction, context and timing of traversal.

- - - -

A representation of the relevant structure specified by the tags and attributes in an XML document, based on "groves" as defined in the ISO DSSSL standard.

-
- - -

Abstractly, a link which serves as one of its own resources. Concretely, a link where the content of the linking element serves as a participating resource. - HTML A, HyTime clink, and TEI XREF - are all inline links.

-
- - -

An explicit relationship between two or more data objects or portions of data objects.

-
- - -

An element that asserts the existence and describes the characteristics of a link.

-
- - -

The content of an inlinelinking element. Note that the content of the linking element could be explicitly pointed to by means of a regular locator in the same linking element, in which case the resource is considered remote, not local.

-
- - -

Data, provided as part of a link, which identifies a - resource.

-
- - -

A link whose traversal can be initiated from more than one of its participating resources. Note that being able to "go back" after following a one-directional link does not make the link multidirectional.

-
- - -

A link whose content does not serve as one of the link's participating resources . Such links presuppose a notion like extended link groups, which instruct application software where to look for links. Out-of-line links are generally required for supporting multidirectional traversal and for allowing read-only resources to have outgoing links.

-
- -

In the context of link behavior, a parsed link is any link whose content is transcluded into the document where the link originated. The use of the term "parsed" directly refers to the concept in XML of a - parsed entity.

-
- - -

A resource that belongs to a link. All resources are potential contributors to a link; participating resources are the actual contributors to a particular link.

-
- - -

Any participating resource of a link that is pointed to with a locator.

-
- - -

In the abstract sense, an addressable unit of information or service that is participating in a link. Examples include files, images, documents, programs, and query results. Concretely, anything reachable by the use of a locator in some linking element. Note that this term and its definition are taken from the basic specifications governing the World Wide Web. -

-
- - -

A portion of a resource, pointed to as the precise destination of a link. As one example, a link might specify that an entire document be retrieved and displayed, but that some specific part(s) of it is the specific linked data, to be treated in an application-appropriate manner such as indication by highlighting, scrolling, etc.

-
- - -

The action of using a link; that is, of accessing a resource. Traversal may be initiated by a user action (for example, clicking on the displayed content of a linking element) or occur under program control.

-
- -

-
- - - Notation -

The formal grammar for locators is given using a simple Extended Backus-Naur Form (EBNF) location, as described in the XML specification.

- -
-
- - - Locator Syntax -

The locator for a resource is typically provided by means of a Uniform Resource Identifier, or URI. XPointers can be used in conjunction with the URI structure, as fragment identifiers, to specify a more precise sub-resource.

- -

A locator generally contains a URI, as described in IETF RFCs and . As these RFCs state, the URI may include a trailing query (marked by a leading "?"), and be followed by a "#" and a fragment identifier, with the query interpreted by the host providing the indicated resource, and the interpretation of the fragment identifier dependent on the data type of the indicated resource.

- -

In order to locate XML documents and portions of documents, a locator value may contain either a URI or a fragment identifier, or both. Any fragment identifier for pointing into XML must be an XPointer.

-

Special syntax may be used to request the use of particular processing models in accessing the locator's resource. This is designed to reflect the realities of network operation, where it may or may not be desirable to exercise fine control over the distribution of work between local and remote processors. - - Locator - - Locator - URI - | Connector (XPointer | Name) - | URI Connector (XPointer | Name) - - - Connector'#' | '|' - - - URIURIchar* - - -

-

In this discussion, the term designated resource refers to the resource which an entire locator serves to locate. The following rules apply: - - -

The URI, if provided, locates a resource called the containing resource.

- - -

If the URI is not provided, the containing resource is considered to be the document in which the linking element is contained. -

- -

If an XPointer is provided, the designated resource is a sub-resource - of the containing resource; otherwise the designated resource is the - containing resource.

-
- - -

If the Connector is followed directly by a Name, the Name is shorthand for the XPointer"id(Name)"; that is, the sub-resource is the element in the containing resource that has an XML ID attribute whose value matches the Name. This shorthand is to encourage use of the robust id addressing mode.

-
- - -

If the connector is "#", this signals an intent that the containing resource is to be fetched as a whole from the host that provides it, and that the XPointer processing to extract the sub-resource - is to be performed on the client, that is to say on the same system where the linking element is recognized and processed.

-
- -

If the connector is "|", no intent is signaled as to what processing model is to be used to go about accessing the designated resource.

-
- -

-

Note that the definition of a URI includes an optional query component.

-

In the case where the URI contains a query (to be interpreted by the server), information providers and authors of server software are urged to use queries as follows: - - Query - - Query'XML-XPTR=' ( XPointer | Name) - - -

- -
- - - Link Recognition -

The existence of a link is asserted by a linking element. Linking elements must be recognized reliably by application software in order to provide appropriate display and behavior. There are several ways link recognition could be accomplished: for example, reserving element type names, reserving attributes names, leaving the matter of recognition entirely up to stylesheets and application software, or using the XLink namespace to specify element names and attribute names that would be recognized by namespace and XLink-aware processors. Using element and attribute names within the XLink namespace provides a balance between giving users control of their own markup language design and keeping the identification of linking elements simple and unambiguous.

-

The two approaches to identifying linking elements are relatively simple to implement. For example, here's how the HTML A element would be declared using attributes within the XLink namespace, and then how an element within the XLink namespace might do the same: - <A xlink:type="simple" xlink:href="http://www.w3.org/TR/wd-xlink/" -xlink:title="The Xlink Working Draft">The XLink Working Draft.</A> - <xlink:simple href="http://www.w3.org/TR/wd-xlink/" -title="The XLink Working Draft">The XLink Working Draft</xlink:simple> - Any arbitrary element can be made into an XLink by using the xlink:type attribute. And, of course, the explicit XLink elements may be used, as well. This document will go on to describe the linking attributes that are associated with linking elements. It may be assumed by the reader that these attributes would require the xlink namespace prefix if they existed within an arbitrary element, or that they may be used directly if they exist within an explicit Xlink element.

- -
- - - - Linking Attributes -

XLink has several attributes associated with the variety of links it may represent. These attributes define four main concepts: locators, arcs, behaviors, and semantics. Locators define where the actual resource is located. Arcs define the traversal of links. Where does the link come from? Where does it go to? All this information can be stored in the arc attributes. Behaviors define how the link is activated, and what the application should do with the resource being linked to. Semantics define useful information that the application may use, and enables the link for such specalized targets as constricted devices and accessibility software.

- - - Locator Attributes -

The only locator attribute at this time is href. This attribute must contain either a string in the form of a URI that defines the remote resource being linked to, a string containing a fragment identifier that links to a local resource, or a string containing a URI with a fragment identifier concacenated onto it.

-
- - - Arc Attributes -

Arcs contain two attributes, from and to. The from attribute may contain a string containing the content of a role attribute from the resource being linked from. The purpose of the from attribute is to define where this link is being actuated from.

-

The to attribute may contain a string containing the content of a role attribute from the resource being linked to. The purpose of the to attribute is to define where this link traverses to.

-

The application may use this information in a number of ways, especially in a complex hypertext system, but it is mainly useful in providing context for application behavior.

- -
- - - Behavior Attributes -

There are two attributes associated with behavior: show and actuate. The show attribute defines how the remote resource is to be revealed to the user. It has three options: new, parsed, and replace. The new option indicates that the remote resource should be shown in a new window (or other device context) without replacing the previous content. The parsed option, relating directly to the XML concept of a parsed entity, indicates that the content should be integrated into the document from which the link was actuated. The replace option is the one most commonly seen on the World Wide Web, where the document being linked from is entirely replaced by the object being linked to.

-

The actuate attribute defines how the link is initiated. It has two options: user and auto. The user option indicates that the link must be initiated by some sort of human-initiated selection, such as clicking on an HTML anchor. The auto option indicates that the link is automatically initiated when the application deems that the user has reached the link. It then follows the behavior set out in the show option.

- -
- - - Semantic Attributes -

There are two attributes associated with semantics, role and title. The role attribute is a generic string used to describe the function of the link's content. For example, a poem might have a link with a role="stanza". The role is also used as an identifier for the from and to attributes of arcs.

-

The title attribute is designed to provide human-readable text describing the link. It is very useful for those who have text-based applications, whether that be due to a constricted device that cannot display the link's content, or if it's being read by an application to a visually-impaired user, or if it's being used to create a table of links. The title attribute contains a simple, descriptive string.

-
-
- - - Linking Elements -

There are several kinds of linking elements in XLink: simple links, locators, arcs, and extended links. These elements may be instantiated via element declarations from the XLink namespace, or they may be instantiated via attribute declarations from the XLink namespace. Both kinds of instantiation are described in the definition of each linking element.

-

The simple link is used to declare a link that approximates the functionality of the HTML A element. It has, however, a few added features to increase its value, including the potential declaration of semantics and behavior. The locator elements are used to define the resource being linked to. Some links may contain multiple locators, representing a choice of potential links to be traversed. The arcs are used to define the traversal semantics of the link. Finally, an extended linking element differs from a simple link in that it can connect any number of resources, not just one local resource (optionally) and one remote resource, and in that extended links are more often out-of-line than simple links.

- - - Simple Links - -

The following are two examples of linking elements, each showing all the possible attributes that can be associated with a simple link. Here is the explicit XLink simple linking element. - <!ELEMENT xlink:simple ANY> -<!ATTLIST xlink:slink - href CDATA #REQUIRED - role CDATA #IMPLIED - title CDATA #IMPLIED - show (new|parsed|replace) "replace" - actuate (user|auto) "user" -> - And here is how to make an arbitrary element into a simple link. - <!ELEMENT xlink:simple ANY> -<!ATTLIST foo - xlink:type (simple|extended|locator|arc) #FIXED "simple" - xlink:href CDATA #REQUIRED - xlink:role CDATA #IMPLIED - xlink:title CDATA #IMPLIED - xlink:show (new|parsed|replace) "replace" - xlink:actuate (user|auto) "user" -> - Here is how the first example might look in a document: -<xlink:simple href="http://www.w3.org/TR/wd-xlink" role="working draft" - title="The XLink Working Draft" show="replace" actuate="user"> -The XLink Working Draft.</xlink:simple> -<foo xlink:href="http://www.w3.org/TR/wd-xlink" xlink:role="working draft" - xlink:title="The XLink Working Draft" xlink:show="new" xlink:actuate="user"> -The XLink Working Draft.</foo> - Alternately, a simple link could be as terse as this: -<foo xlink:href="#stanza1">The First Stanza.</foo> -

-

- There are no constraints on the contents of a simple linking element. In - the sample declaration above, it is given a content model of ANY - to illustrate that any content model or declared content is acceptable. In - a valid document, every element that is significant to XLink must still conform - to the constraints expressed in its governing DTD.

-

Note that it is meaningful to have an out-of-line simple link, although - such links are uncommon. They are called "one-ended" and are typically used - to associate discrete semantic properties with locations. The properties might - be expressed by attributes on the link, the link's element type name, or in - some other way, and are not considered full-fledged resources of the link. - Most out-of-line links are extended links, as these have a far wider range - of uses.

-
- - -Extended Links -

An extended link differs from a simple link in that it can connect any number of resources, not just one local resource (optionally) and one remote resource, and in that extended links are more often out-of-line than simple links.

-

These additional capabilities of extended links are required for: - - -

Enabling outgoing links in documents that cannot be modified to add an inline link

- - -

Creating links to and from resources in formats with no native support for embedded links (such as most multimedia formats)

-
- -

Applying and filtering sets of relevant links on demand

-
-

Enabling other advanced hypermedia capabilities

- -

-

Application software might be expected to provide traversal among all of a link's participating resources (subject to semantic constraints outside the scope of this specification) and to signal the fact that a given resource or sub-resource participates in one or more links when it is displayed (even though there is no markup at exactly that point to signal it).

-

A linking element for an extended link contains a series of child elements that serve as locators and arcs. Because an extended link can have more than one remote resource, it separates out linking itself from the mechanisms used to locate each resource (whereas a simple link combines the two).

-

The xlink:type attribute value for an extended link must be extended, if the link is being instantiated on an arbitrary element. Note that extended links introduce variants of the show and actuate behavior attributes. These attributes, the showdefault and actuatedefault define the same behavior as their counterparts. However, in this case, they are considered to define the default behavior for all the linking elements that they contain.

-

However, when a linking element within an extended link has a show or actuate attribute of its own, that attribute overrides the defaults set on the extended linking element.

-

The extended linking element itself retains those attributes relevant to the link as a whole, and to its local resource if any. Following are two sample declaration for an extended link. The first is an example of the explicit XLink extended link: - -<!ELEMENT xlink:extended ((xlink:arc | xlink:locator)*)> -<!ATTLIST xlink:extended - role CDATA #IMPLIED - title CDATA #IMPLIED - showdefault (new|parsed|replace) #IMPLIED - actuatedefault (user|auto) #IMPLIED > - - The second is an example of an arbitrary element being used an extended link: - -<!ELEMENT foo ((xlink:arc | xlink:locator)*)> -<!ATTLIST foo - xlink:type (simple|extended|locator|arc) #FIXED "extended" - xlink:role CDATA #IMPLIED - xlink:title CDATA #IMPLIED - xlink:showdefault (new|parsed|replace) #IMPLIED - xlink:actuatedefault (user|auto) #IMPLIED > - - The following two examples demonstrate how each of the above might appear within a document instance. Note that the content of these examples would be other elements. For brevity's sake, they've been left blank. The first example shows how the link might appear, using an explicit XLink extended link: - -<xlink:extended role="address book" title="Ben's Address Book" showdefault="replace" actuatedefault="user"> ... </xlink:extended> - - And the second shows how the link might appear, using an arbitrary element: - -<foo xlink:type="extended" xlink:role="address book" xlink:title="Ben's Address Book" xlink:showdefault="replace" xlink:actuatedefault="user"> ... </foo> -

- -
- - - Arc Elements -

An arc is contained within an extended link for the purpose of defining traversal behavior. More than one arc may be associated with a link. Otherwise, arc elements function exactly as the arc attributes might lead on to expect.

- -
- -
- -Conformance -

An element conforms to XLink if: -

The element has an xml:link attribute whose value is -one of the attribute values prescribed by this specification, and

-

the element and all of its attributes and content adhere to the -syntactic -requirements imposed by the chosen xml:link attribute value, -as prescribed in this specification.

-

-

Note that conformance is assessed at the level of individual elements, -rather than whole XML documents, because XLink and non-XLink linking mechanisms -may be used side by side in any one document.

-

An application conforms to XLink if it interprets XLink-conforming elements -according to all required semantics prescribed by this specification and, -for any optional semantics it chooses to support, supports them in the way -prescribed.

-
- - -Unfinished Work - -Structured Titles -

The simple title mechanism described in this draft is insufficient to cope -with internationalization or the use of multimedia in link titles. A future -version will provide a mechanism for the use of structured link titles.

-
-
- -References - -Eve Maler and Steve DeRose, editors. -XML Pointer Language (XPointer) V1.0. ArborText, Inso, and Brown -University. Burlington, Seekonk, et al.: World Wide Web Consortium, 1998. -(See http://www.w3.org/TR/WD-xptr - .) -ISO (International Organization for -Standardization). ISO/IEC 10744-1992 (E). Information technology -- Hypermedia/Time-based Structuring Language (HyTime). [Geneva]: -International Organization for Standardization, 1992. Extended -Facilities -Annex. [Geneva]: International Organization for Standardization, -1996. (See http://www.ornl.go -v/sgml/wg8/hytime/html/is10744r.html ). -IETF (Internet Engineering Task -Force). -RFC 1738: Uniform Resource Locators. 1991. (See -http://www.w3.org/Addressing/rfc1738.txt). -IETF (Internet Engineering Task -Force). -RFC 1808: Relative Uniform Resource Locators. 1995. (See http://www.w3.org/Addressing/rfc -1808.txt ). -C. M. Sperberg-McQueen and Lou Burnard, editors. - -Guidelines for Electronic Text Encoding and Interchange. Association -for Computers and the Humanities (ACH), Association for Computational -Linguistics -(ACL), and Association for Literary and Linguistic Computing (ALLC). Chicago, -Oxford: Text Encoding Initiative, 1994. -]Steven J. DeRose and David G. Durand. 1995. "The -TEI Hypertext Guidelines." In Computing and the Humanities -29(3). -Reprinted in Text Encoding Initiative: Background and -Context, -ed. Nancy Ide and Jean ronis , ISBN 0-7923-3704-2. - -
- -~~~~~~~~~~ diff --git a/src/lint/linter/__tests__/xml/youtube.lint-test b/src/lint/linter/__tests__/xml/youtube.lint-test deleted file mode 100644 --- a/src/lint/linter/__tests__/xml/youtube.lint-test +++ /dev/null @@ -1,3 +0,0 @@ - -http://gdata.youtube.com/feeds/api/users/theofficialfacebook/uploads2013-12-20T05:53:11.183ZUploads by theofficialfacebookhttp://www.gstatic.com/youtube/img/logo.pngtheofficialfacebookhttp://gdata.youtube.com/feeds/api/users/theofficialfacebookYouTube data API69125http://gdata.youtube.com/feeds/api/videos/ssRxR4yFMCw2013-12-19T17:25:25.000Z2013-12-20T05:52:04.000ZHome: First Look at the Latest FeaturesAn overview of the latest Home features, giving you more control over seeing the content you care most about the moment you wake up your phone.theofficialfacebookhttp://gdata.youtube.com/feeds/api/users/theofficialfacebookTechAn overview of the latest Home features, giving you more control over seeing the content you care most about the moment you wake up your phone.Home: First Look at the Latest Featureshttp://gdata.youtube.com/feeds/api/videos/qOfzWQ28A2E2013-10-24T17:30:43.000Z2013-12-20T05:47:21.000ZHome: Connect to Flickr, Instagram, Pinterest, and TumblrHome product designer Francis Luu walks you through one of the latest features in Facebook Home, connecting apps to see posts from Flickr, Instagram, Pinterest, and Tumblr on your lock screen.theofficialfacebookhttp://gdata.youtube.com/feeds/api/users/theofficialfacebookTechHome product designer Francis Luu walks you through one of the latest features in Facebook Home, connecting apps to see posts from Flickr, Instagram, Pinterest, and Tumblr on your lock screen.Home: Connect to Flickr, Instagram, Pinterest, and Tumblrhttp://gdata.youtube.com/feeds/api/videos/RDHwTuR70202013-08-08T16:34:56.000Z2013-12-20T05:03:31.000ZHow to Send Group MessagesWant to keep in touch with a group of friends? Start a group message.theofficialfacebookhttp://gdata.youtube.com/feeds/api/users/theofficialfacebookTechWant to keep in touch with a group of friends? Start a group message.How to Send Group Messageshttp://gdata.youtube.com/feeds/api/videos/hB8J4zDF_xU2013-07-30T15:24:19.000Z2013-12-18T09:01:57.000ZHow to Send Stickers and Photos in MessagesHave more fun with messages. Share photos and stickers.theofficialfacebookhttp://gdata.youtube.com/feeds/api/users/theofficialfacebookTechHave more fun with messages. Share photos and stickers.How to Send Stickers and Photos in Messageshttp://gdata.youtube.com/feeds/api/videos/v_5fQvqtRec2013-07-26T04:32:28.000Z2013-12-08T17:38:53.000ZHow to Use Chat HeadsKeep chatting with friends while checking out other stuff. Get started with chat heads.theofficialfacebookhttp://gdata.youtube.com/feeds/api/users/theofficialfacebookTechKeep chatting with friends while checking out other stuff. Get started with chat heads.How to Use Chat Headshttp://gdata.youtube.com/feeds/api/videos/Omihm7Lc7Ao2013-07-22T20:16:56.000Z2013-11-30T02:22:58.000ZFacebook at San Francisco Pride 2013More than 700 Facebook employees, including our CEO Mark Zuckerberg and former Super Bowl champion Brendon Ayanbadejo, marched in the San Francisco Pride Parade to show their support for the LGBTQ community. Celebrating Pride Week has been one of Facebook's favorite traditions for the past three years, and in the wake of the Supreme Court decisions we were even more thrilled to participate.theofficialfacebookhttp://gdata.youtube.com/feeds/api/users/theofficialfacebookTechMore than 700 Facebook employees, including our CEO Mark Zuckerberg and former Super Bowl champion Brendon Ayanbadejo, marched in the San Francisco Pride Parade to show their support for the LGBTQ community. Celebrating Pride Week has been one of Facebook's favorite traditions for the past three years, and in the wake of the Supreme Court decisions we were even more thrilled to participate.Facebook at San Francisco Pride 2013http://gdata.youtube.com/feeds/api/videos/Ib3ySuSedjk2013-07-19T03:34:38.000Z2013-11-25T20:47:31.000ZHow to Start ChattingChat with friends on the go. Watch and get started with Facebook messages.theofficialfacebookhttp://gdata.youtube.com/feeds/api/users/theofficialfacebookTechChat with friends on the go. Watch and get started with Facebook messages.How to Start Chattinghttp://gdata.youtube.com/feeds/api/videos/PjcXZeL_3IQ2013-07-05T19:33:25.000Z2013-12-12T22:11:46.000ZHow Privacy Works with Graph SearchLearn about how privacy works with search and how to manage information you share on Facebook.theofficialfacebookhttp://gdata.youtube.com/feeds/api/users/theofficialfacebookTechLearn about how privacy works with search and how to manage information you share on Facebook.How Privacy Works with Graph Searchhttp://gdata.youtube.com/feeds/api/videos/uRDvW_65R8k2013-04-30T01:01:37.000Z2013-12-02T04:10:21.000ZFacebook Home Presents: How to Use Chat HeadsChat heads on Facebook Home let you chat while using apps. Find out more at www.facebookhome.comtheofficialfacebookhttp://gdata.youtube.com/feeds/api/users/theofficialfacebookTechChat heads on Facebook Home let you chat while using apps. Find out more at www.facebookhome.comFacebook Home Presents: How to Use Chat Headshttp://gdata.youtube.com/feeds/api/videos/ioYz5UZ9dc82013-04-30T01:01:04.000Z2013-11-10T07:38:04.000ZFacebook Home Presents: How to Launch AppsUse your profile picture to launch apps on Facebook Home. Find out more at www.facebookhome.comtheofficialfacebookhttp://gdata.youtube.com/feeds/api/users/theofficialfacebookTechUse your profile picture to launch apps on Facebook Home. Find out more at www.facebookhome.comFacebook Home Presents: How to Launch Appshttp://gdata.youtube.com/feeds/api/videos/tlFiP6mLugg2013-04-30T01:00:14.000Z2013-04-30T01:00:14.000ZFacebook Home Presents: How to Use Cover FeedSwitch on and see friends, with cover feed on Facebook Home. Find out more at www.facebookhome.comtheofficialfacebookhttp://gdata.youtube.com/feeds/api/users/theofficialfacebookTechSwitch on and see friends, with cover feed on Facebook Home. Find out more at www.facebookhome.comFacebook Home Presents: How to Use Cover Feedhttp://gdata.youtube.com/feeds/api/videos/UuQpaoE20HE2013-04-30T00:59:31.000Z2013-04-30T00:59:31.000ZFacebook Home Presents: How to Use NotificationsNotifications on Facebook Home make knowing what's up easier. Find out more at www.facebookhome.comtheofficialfacebookhttp://gdata.youtube.com/feeds/api/users/theofficialfacebookTechNotifications on Facebook Home make knowing what's up easier. Find out more at www.facebookhome.comFacebook Home Presents: How to Use Notificationshttp://gdata.youtube.com/feeds/api/videos/voWvqBsyYbE2013-04-13T23:09:42.000Z2013-11-19T11:25:40.000ZFacebook Home "Dinner"A dull situation takes a turn for the interesting when a young woman steals a few glances at Facebook Home. www.FacebookHome.comtheofficialfacebookhttp://gdata.youtube.com/feeds/api/users/theofficialfacebookTechA dull situation takes a turn for the interesting when a young woman steals a few glances at Facebook Home. www.FacebookHome.comFacebook Home "Dinner"http://gdata.youtube.com/feeds/api/videos/ArFy91n1FR02013-04-13T03:06:50.000Z2013-11-20T12:07:36.000ZFacebook Home "Launch Day"Facebook HQ. Launch day. The team of engineers who built Facebook Home gathers as it finally ships. One guy appears to enjoy using Home already. Shot on location at Facebook, and featuring the actual product team, the film gives people a fun peek behind the Menlo Park curtain. www.FacebookHome.comtheofficialfacebookhttp://gdata.youtube.com/feeds/api/users/theofficialfacebookTechFacebook HQ. Launch day. The team of engineers who built Facebook Home gathers as it finally ships. One guy appears to enjoy using Home already. Shot on location at Facebook, and featuring the actual product team, the film gives people a fun peek behind the Menlo Park curtain. www.FacebookHome.comFacebook Home "Launch Day"http://gdata.youtube.com/feeds/api/videos/HiqbNxRurFA2013-04-12T16:42:02.000Z2013-11-20T22:25:34.000ZFacebook Home: First LookAdam walks you through Cover Feed and Chat Heads, just two of the new features in Facebook Home.theofficialfacebookhttp://gdata.youtube.com/feeds/api/users/theofficialfacebookTechAdam walks you through Cover Feed and Chat Heads, just two of the new features in Facebook Home.Facebook Home: First Lookhttp://gdata.youtube.com/feeds/api/videos/mx_GzNlQOxI2013-04-06T23:10:35.000Z2013-12-20T04:18:09.000ZFacebook Home "Airplane"A boring business trip gets a lot less boring, when Facebook Home brings a guy's friends on the journey with him. And all it takes is a few glances to reveal that his life isn't as conservative as his khakis.theofficialfacebookhttp://gdata.youtube.com/feeds/api/users/theofficialfacebookTechA boring business trip gets a lot less boring, when Facebook Home brings a guy's friends on the journey with him. And all it takes is a few glances to reveal that his life isn't as conservative as his khakis.Facebook Home "Airplane"http://gdata.youtube.com/feeds/api/videos/Lep_DSmSRwE2013-04-04T17:44:54.000Z2013-12-19T22:23:43.000ZFacebook HomeSee how Facebook Home puts your friends at the heart of your phone. www.facebookhome.comtheofficialfacebookhttp://gdata.youtube.com/feeds/api/users/theofficialfacebookTechSee how Facebook Home puts your friends at the heart of your phone. www.facebookhome.comFacebook Homehttp://gdata.youtube.com/feeds/api/videos/_PW54Sm99ck2013-03-07T18:37:20.000Z2013-12-08T05:07:51.000ZWhat's New About Your Facebook HomepageLearn more about some of the updates to your News Feed.theofficialfacebookhttp://gdata.youtube.com/feeds/api/users/theofficialfacebookTechLearn more about some of the updates to your News Feed.What's New About Your Facebook Homepagehttp://gdata.youtube.com/feeds/api/videos/YaQQHYQHnMk2013-03-07T18:36:53.000Z2013-12-18T20:22:02.000ZBehind the News Feed RedesignLearn more about the thinking behind the new look on Facebook.theofficialfacebookhttp://gdata.youtube.com/feeds/api/users/theofficialfacebookTechLearn more about the thinking behind the new look on Facebook.Behind the News Feed Redesignhttp://gdata.youtube.com/feeds/api/videos/W3k1USQbq802013-02-06T19:13:11.000Z2013-10-11T11:09:00.000ZIntroducing Facebook Graph SearchGraph Search is a new way for you to find people, photos, places and interests that are most relevant to you on Facebook.theofficialfacebookhttp://gdata.youtube.com/feeds/api/users/theofficialfacebookTechGraph Search is a new way for you to find people, photos, places and interests that are most relevant to you on Facebook.Introducing Facebook Graph Searchhttp://gdata.youtube.com/feeds/api/videos/fY1ziax3XDY2013-02-06T19:12:38.000Z2013-02-17T20:23:41.000ZFacebook Graph Search: Behind the ScenesGraph Search is a new way for you to find people, photos, places and interests that are most relevant to you on Facebook.theofficialfacebookhttp://gdata.youtube.com/feeds/api/users/theofficialfacebookTechGraph Search is a new way for you to find people, photos, places and interests that are most relevant to you on Facebook.Facebook Graph Search: Behind the Sceneshttp://gdata.youtube.com/feeds/api/videos/SAMMPqq31Vg2013-01-23T14:12:49.000Z2013-12-19T21:17:36.000ZFacebook Stories: The Dawn WallTommy Caldwell's dad introduced him to rock climbing at the age of three and by 16, Tommy was a world champion. For the last five years, Tommy has been attempting to climb a shear 3000-foot rock face that many consider the most difficult free climb ever attempted. How do you stay motivated on such a climb? See how Tommy was able to bring the encouragement of his friends, family and fans along for the ride.theofficialfacebookhttp://gdata.youtube.com/feeds/api/users/theofficialfacebookNewsTommy Caldwell's dad introduced him to rock climbing at the age of three and by 16, Tommy was a world champion. For the last five years, Tommy has been attempting to climb a shear 3000-foot rock face that many consider the most difficult free climb ever attempted. How do you stay motivated on such a climb? See how Tommy was able to bring the encouragement of his friends, family and fans along for the ride.Facebook Stories: The Dawn Wallhttp://gdata.youtube.com/feeds/api/videos/CaJYQXiu3PY2012-12-12T16:43:03.000Z2013-12-17T19:25:38.000ZHow to Report or Remove a Tag on FacebookLearn how to manage photo tags on Facebook. You can review the audience that the photo is shared with, report a photo that you would like taken down, or remove the tag.theofficialfacebookhttp://gdata.youtube.com/feeds/api/users/theofficialfacebookTechLearn how to manage photo tags on Facebook. You can review the audience that the photo is shared with, report a photo that you would like taken down, or remove the tag.How to Report or Remove a Tag on Facebookhttp://gdata.youtube.com/feeds/api/videos/vdLX29-ofoA2012-12-06T20:44:06.000Z2013-12-14T02:17:33.000ZFacebook Stories: Beyond the Yellow BoatWhen Jay Jaboneta heard that a group of children in the Philippines have to swim to school, he started a fundraiser on Facebook to buy them a boat—only to realize that the solution required a more local perspective.theofficialfacebookhttp://gdata.youtube.com/feeds/api/users/theofficialfacebookNonprofitWhen Jay Jaboneta heard that a group of children in the Philippines have to swim to school, he started a fundraiser on Facebook to buy them a boat—only to realize that the solution required a more local perspective.Facebook Stories: Beyond the Yellow Boathttp://gdata.youtube.com/feeds/api/videos/jGE8FibCbWU2012-10-31T18:56:26.000Z2012-12-14T01:25:58.000ZSocial ResolutionIf you see bullying on Facebook, report it.theofficialfacebookhttp://gdata.youtube.com/feeds/api/users/theofficialfacebookTechIf you see bullying on Facebook, report it.Social Resolution -~~~~~~~~~~ diff --git a/src/lint/linter/reporter.js b/src/lint/linter/reporter.js deleted file mode 100644 --- a/src/lint/linter/reporter.js +++ /dev/null @@ -1,18 +0,0 @@ -module.exports = { - reporter: function (results) { - var report = []; - - results.forEach(function (result) { - var error = result.error; - report.push({ - 'file' : result.file, - 'line' : error.line, - 'col' : error.character, - 'reason' : error.reason, - 'code' : error.code, - }); - }); - - process.stdout.write(JSON.stringify(report)); - } -}; diff --git a/src/lint/linter/ArcanistInlineHTMLXHPASTLinterRule.php b/src/lint/linter/xhpast/rules/ArcanistInlineHTMLXHPASTLinterRule.php rename from src/lint/linter/ArcanistInlineHTMLXHPASTLinterRule.php rename to src/lint/linter/xhpast/rules/ArcanistInlineHTMLXHPASTLinterRule.php