diff --git a/grammars.yml b/grammars.yml index 0e089e3a9..d7c9b85b4 100755 --- a/grammars.yml +++ b/grammars.yml @@ -423,6 +423,8 @@ vendor/grammars/language-etc: - source.curlrc - source.direct-x - source.dosbox-conf +- source.futhark +- source.generic-db - source.gitattributes - source.gitconfig - source.gitignore @@ -430,14 +432,20 @@ vendor/grammars/language-etc: - source.hosts - source.ini.npmrc - source.inputrc +- source.lcov - source.m4 - source.man-conf - source.nanorc +- source.neon - source.odin-ehr +- source.openbsd-pkg.contents - source.opts +- source.sieve - source.smpl - source.ssh-config +- source.tags - source.wgetrc +- text.openbsd-pkg.desc - text.xml.svg vendor/grammars/language-faust: - source.faust diff --git a/lib/linguist/languages.yml b/lib/linguist/languages.yml index 0b3469de4..44727de07 100755 --- a/lib/linguist/languages.yml +++ b/lib/linguist/languages.yml @@ -3356,6 +3356,16 @@ NCL: tm_scope: source.ncl ace_mode: text language_id: 240 +NEON: + type: data + extensions: + - ".neon" + tm_scope: source.neon + ace_mode: text + aliases: + - nette object notation + - ne-on + language_id: 481192983 NL: type: data extensions: diff --git a/samples/NEON/config.neon b/samples/NEON/config.neon new file mode 100644 index 000000000..09bfe78e9 --- /dev/null +++ b/samples/NEON/config.neon @@ -0,0 +1,516 @@ +parameters: + bootstrap: null + excludes_analyse: [] + autoload_directories: [] + autoload_files: [] + level: null + paths: [] + featureToggles: + disableRobotLoader: false + staticReflectionForPhpParser: true + disableRuntimeReflectionProvider: false + enableScanningPaths: false + closureUsesThis: false + randomIntParameters: false + nullCoalesce: false + fileExtensions: + - php + checkAlwaysTrueCheckTypeFunctionCall: false + checkAlwaysTrueInstanceof: false + checkAlwaysTrueStrictComparison: false + checkClassCaseSensitivity: false + checkFunctionArgumentTypes: false + checkFunctionNameCase: false + checkGenericClassInNonGenericObjectType: false + checkMissingIterableValueType: false + checkMissingVarTagTypehint: false + checkArgumentsPassedByReference: false + checkMaybeUndefinedVariables: false + checkNullables: false + checkThisOnly: true + checkUnionTypes: false + checkExplicitMixedMissingReturn: false + checkPhpDocMissingReturn: false + checkExtraArguments: false + checkMissingClosureNativeReturnTypehintRule: false + checkMissingTypehints: false + checkTooWideReturnTypesInProtectedAndPublicMethods: false + inferPrivatePropertyTypeFromConstructor: false + reportMaybes: false + reportMaybesInMethodSignatures: false + reportStaticMethodSignatures: false + mixinExcludeClasses: [] + parallel: + jobSize: 20 + processTimeout: 60.0 + maximumNumberOfProcesses: 32 + minimumNumberOfJobsPerProcess: 2 + buffer: 134217728 # 128 MB + polluteScopeWithLoopInitialAssignments: true + polluteScopeWithAlwaysIterableForeach: true + polluteCatchScopeWithTryAssignments: false + treatPhpDocTypesAsCertain: true + tipsOfTheDay: true + reportMagicMethods: false + reportMagicProperties: false + ignoreErrors: [] + internalErrorsCountLimit: 50 + cache: + nodesByFileCountMax: 512 + nodesByStringCountMax: 512 + reportUnmatchedIgnoredErrors: true + scopeClass: PHPStan\Analyser\MutatingScope + typeAliases: + scalar: 'int|float|string|bool' + number: 'int|float' + universalObjectCratesClasses: + - stdClass + stubFiles: + - ../stubs/ReflectionClass.stub + - ../stubs/iterable.stub + - ../stubs/ArrayObject.stub + - ../stubs/WeakReference.stub + - ../stubs/ext-ds.stub + - ../stubs/PDOStatement.stub + earlyTerminatingMethodCalls: [] + earlyTerminatingFunctionCalls: [] + memoryLimitFile: %tmpDir%/.memory_limit + staticReflectionClassNamePatterns: + - '#^PhpParser\\#' + - '#^PHPStan\\#' + - '#^Hoa\\#' + - '#^DateTime(?:Interface|Immutable)?$#' + - '#^Soap(?:Client|Var|Server|Fault|Param|Header)$#' + dynamicConstantNames: + - ICONV_IMPL + - LIBXML_VERSION + - LIBXML_DOTTED_VERSION + - PHP_VERSION + - PHP_MAJOR_VERSION + - PHP_MINOR_VERSION + - PHP_RELEASE_VERSION + - PHP_VERSION_ID + - PHP_EXTRA_VERSION + - PHP_ZTS + - PHP_DEBUG + - PHP_MAXPATHLEN + - PHP_OS + - PHP_OS_FAMILY + - PHP_SAPI + - PHP_EOL + - PHP_INT_MAX + - PHP_INT_MIN + - PHP_INT_SIZE + - PHP_FLOAT_DIG + - PHP_FLOAT_EPSILON + - PHP_FLOAT_MIN + - PHP_FLOAT_MAX + - DEFAULT_INCLUDE_PATH + - PEAR_INSTALL_DIR + - PEAR_EXTENSION_DIR + - PHP_EXTENSION_DIR + - PHP_PREFIX + - PHP_BINDIR + - PHP_BINARY + - PHP_MANDIR + - PHP_LIBDIR + - PHP_DATADIR + - PHP_SYSCONFDIR + - PHP_LOCALSTATEDIR + - PHP_CONFIG_FILE_PATH + - PHP_CONFIG_FILE_SCAN_DIR + - PHP_SHLIB_SUFFIX + - PHP_FD_SETSIZE + +extensions: + rules: PHPStan\DependencyInjection\RulesExtension + conditionalTags: PHPStan\DependencyInjection\ConditionalTagsExtension + parametersSchema: PHPStan\DependencyInjection\ParametersSchemaExtension + +parametersSchema: + bootstrap: schema(string(), nullable()) + excludes_analyse: listOf(string()) + autoload_directories: listOf(string()) + autoload_files: listOf(string()) + level: schema(anyOf(int(), string()), nullable()) + paths: listOf(string()) + featureToggles: structure([ + disableRobotLoader: bool(), + staticReflectionForPhpParser: bool(), + disableRuntimeReflectionProvider: bool(), + enableScanningPaths: bool(), + closureUsesThis: bool(), + randomIntParameters: bool(), + nullCoalesce: bool() + ]) + fileExtensions: listOf(string()) + checkAlwaysTrueCheckTypeFunctionCall: bool() + checkAlwaysTrueInstanceof: bool() + reportStaticMethodSignatures: bool() + parallel: structure([ + jobSize: int(), + processTimeout: float(), + maximumNumberOfProcesses: int(), + minimumNumberOfJobsPerProcess: int(), + buffer: int() + ]) + polluteScopeWithLoopInitialAssignments: bool() + polluteScopeWithAlwaysIterableForeach: bool() + polluteCatchScopeWithTryAssignments: bool() + treatPhpDocTypesAsCertain: bool() + reportMagicMethods: bool() + reportMagicProperties: bool() + ignoreErrors: listOf( + anyOf( + string(), + structure([ + message: string() + path: string() + ]), + structure([ + message: string() + count: int() + path: string() + ]), + structure([ + message: string() + paths: listOf(string()) + ]) + ) + ) + internalErrorsCountLimit: int() + cache: structure([ + nodesByFileCountMax: int() + nodesByStringCountMax: int() + ]) + reportUnmatchedIgnoredErrors: bool() + scopeClass: string() + typeAliases: arrayOf(string()) + universalObjectCratesClasses: listOf(string()) + stubFiles: listOf(string()) + earlyTerminatingMethodCalls: arrayOf(listOf(string())) + earlyTerminatingFunctionCalls: listOf(string()) + rootDir: string() + tmpDir: string() + currentWorkingDirectory: string() + cliArgumentsVariablesRegistered: bool() + mixinExcludeClasses: listOf(string()) + + # irrelevant Nette parameters + debugMode: bool() + productionMode: bool() + tempDir: string() + + # internal parameters only for DerivativeContainerFactory + additionalConfigFiles: listOf(string()) + allCustomConfigFiles: listOf(string()) + analysedPaths: listOf(string()) + composerAutoloaderProjectPaths: listOf(string()) + analysedPathsFromConfig: listOf(string()) + usedLevel: string() + cliAutoloadFile: schema(string(), nullable()) + +services: + - + class: PhpParser\BuilderFactory + + - + class: PhpParser\Lexer\Emulative + + - + class: PhpParser\NodeTraverser + setup: + - addVisitor(@PhpParser\NodeVisitor\NameResolver) + + - + class: PhpParser\NodeVisitor\NameResolver + + - + class: PhpParser\Parser\Php7 + + - + class: PhpParser\PrettyPrinter\Standard + + - + class: PHPStan\Broker\AnonymousClassNameHelper + arguments: + relativePathHelper: @simpleRelativePathHelper + + - + class: PHPStan\PhpDocParser\Lexer\Lexer + + - + class: PHPStan\PhpDoc\TypeAlias\TypeAliasesTypeNodeResolverExtension + arguments: + aliases: %typeAliases% + tags: + - phpstan.phpDoc.typeNodeResolverExtension + + - + class: PHPStan\PhpDoc\TypeNodeResolver + + - + class: PHPStan\PhpDoc\TypeNodeResolverExtensionRegistryProvider + factory: PHPStan\PhpDoc\LazyTypeNodeResolverExtensionRegistryProvider + + - + class: PHPStan\PhpDoc\TypeStringResolver + + - + class: PHPStan\PhpDoc\StubValidator + arguments: + stubFiles: %stubFiles% + + - + class: PHPStan\Analyser\Analyser + arguments: + internalErrorsCountLimit: %internalErrorsCountLimit% + + - + class: PHPStan\Analyser\FileAnalyser + arguments: + reportUnmatchedIgnoredErrors: %reportUnmatchedIgnoredErrors% + + - + class: PHPStan\Analyser\IgnoredErrorHelper + arguments: + ignoreErrors: %ignoreErrors% + reportUnmatchedIgnoredErrors: %reportUnmatchedIgnoredErrors% + + - + class: PHPStan\Analyser\LazyScopeFactory + arguments: + scopeClass: %scopeClass% + autowired: + - PHPStan\Analyser\ScopeFactory + + - + class: PHPStan\Analyser\NodeScopeResolver + arguments: + polluteScopeWithLoopInitialAssignments: %polluteScopeWithLoopInitialAssignments% + polluteCatchScopeWithTryAssignments: %polluteCatchScopeWithTryAssignments% + polluteScopeWithAlwaysIterableForeach: %polluteScopeWithAlwaysIterableForeach% + earlyTerminatingMethodCalls: %earlyTerminatingMethodCalls% + earlyTerminatingFunctionCalls: %earlyTerminatingFunctionCalls% + + - + class: PHPStan\Analyser\ResultCache\ResultCacheManager + arguments: + cacheFilePath: %tmpDir%/resultCache.php + allCustomConfigFiles: %allCustomConfigFiles% + analysedPaths: %analysedPaths% + composerAutoloaderProjectPaths: %composerAutoloaderProjectPaths% + stubFiles: %stubFiles% + usedLevel: %usedLevel% + cliAutoloadFile: %cliAutoloadFile% + + - + class: PHPStan\DependencyInjection\DerivativeContainerFactory + arguments: + currentWorkingDirectory: %currentWorkingDirectory% + tempDirectory: %tempDir% + additionalConfigFiles: %additionalConfigFiles% + analysedPaths: %analysedPaths% + composerAutoloaderProjectPaths: %composerAutoloaderProjectPaths% + analysedPathsFromConfig: %analysedPathsFromConfig% + allCustomConfigFiles: %allCustomConfigFiles% + usedLevel: %usedLevel% + + - + class: PHPStan\Parallel\Scheduler + arguments: + jobSize: %parallel.jobSize% + maximumNumberOfProcesses: %parallel.maximumNumberOfProcesses% + minimumNumberOfJobsPerProcess: %parallel.minimumNumberOfJobsPerProcess% + + - + class: PHPStan\Parser\CachedParser + arguments: + originalParser: @directParser + cachedNodesByFileCountMax: %cache.nodesByFileCountMax% + cachedNodesByStringCountMax: %cache.nodesByStringCountMax% + + - + class: PHPStan\Reflection\Mixin\MixinPropertiesClassReflectionExtension + tags: + - phpstan.broker.propertiesClassReflectionExtension + arguments: + mixinExcludeClasses: %mixinExcludeClasses% + + - + class: PHPStan\Reflection\Php\PhpClassReflectionExtension + arguments: + inferPrivatePropertyTypeFromConstructor: %inferPrivatePropertyTypeFromConstructor% + universalObjectCratesClasses: %universalObjectCratesClasses% + + - + class: PHPStan\Reflection\PhpDefect\PhpDefectClassReflectionExtension + + - + implement: PHPStan\Reflection\Php\PhpMethodReflectionFactory + + - + class: PHPStan\Reflection\Php\UniversalObjectCratesClassReflectionExtension + tags: + - phpstan.broker.propertiesClassReflectionExtension + arguments: + classes: %universalObjectCratesClasses% + + - + class: PHPStan\Rules\FunctionCallParametersCheck + arguments: + checkArgumentTypes: %checkFunctionArgumentTypes% + checkArgumentsPassedByReference: %checkArgumentsPassedByReference% + checkExtraArguments: %checkExtraArguments% + checkMissingTypehints: %checkMissingTypehints% + + - + class: PHPStan\Rules\FunctionDefinitionCheck + arguments: + checkClassCaseSensitivity: %checkClassCaseSensitivity% + checkThisOnly: %checkThisOnly% + + typeSpecifier: + class: PHPStan\Analyser\TypeSpecifier + factory: @typeSpecifierFactory::create + + typeSpecifierFactory: + class: PHPStan\Analyser\TypeSpecifierFactory + + relativePathHelper: + class: PHPStan\File\RelativePathHelper + factory: PHPStan\File\FuzzyRelativePathHelper + arguments: + currentWorkingDirectory: %currentWorkingDirectory% + analysedPaths: %analysedPaths% + + simpleRelativePathHelper: + class: PHPStan\File\RelativePathHelper + factory: PHPStan\File\SimpleRelativePathHelper + arguments: + currentWorkingDirectory: %currentWorkingDirectory% + autowired: false + + broker: + class: PHPStan\Broker\Broker + factory: @brokerFactory::create + autowired: + - PHPStan\Broker\Broker + + brokerFactory: + class: PHPStan\Broker\BrokerFactory + + cacheStorage: + class: PHPStan\Cache\FileCacheStorage + arguments: + directory: %tmpDir%/cache/PHPStan + autowired: no + + directParser: + class: PHPStan\Parser\DirectParser + autowired: no + + phpParserDecorator: + class: PHPStan\Parser\PhpParserDecorator + arguments: + wrappedParser: @PHPStan\Parser\Parser + autowired: no + + registry: + class: PHPStan\Rules\Registry + factory: @PHPStan\Rules\RegistryFactory::create + + stubPhpDocProvider: + class: PHPStan\PhpDoc\StubPhpDocProvider + arguments: + stubFiles: %stubFiles% + + # Reflection providers + + reflectionProviderFactory: + class: PHPStan\Reflection\ReflectionProvider\ReflectionProviderFactory + arguments: + runtimeReflectionProvider: @runtimeReflectionProvider + parser: @phpParserDecorator + phpParserReflectionProvider: @phpParserReflectionProvider + enableStaticReflectionForPhpParser: %featureToggles.staticReflectionForPhpParser% + disableRuntimeReflectionProvider: %featureToggles.disableRuntimeReflectionProvider% + + reflectionProvider: + factory: @PHPStan\Reflection\ReflectionProvider\ReflectionProviderFactory::create + autowired: + - PHPStan\Reflection\ReflectionProvider + + phpParserReflectionProvider: + class: PHPStan\Reflection\ReflectionProvider\ClassWhitelistReflectionProvider + arguments: + reflectionProvider: @betterReflectionProvider + patterns: %staticReflectionClassNamePatterns% + autowired: false + + regexParser: + class: Hoa\Compiler\Llk\Parser + factory: Hoa\Compiler\Llk\Llk::load(@regexGrammarStream) + + regexGrammarStream: + class: Hoa\File\Read + arguments: + streamName: 'hoa://Library/Regex/Grammar.pp' + + runtimeReflectionProvider: + class: PHPStan\Reflection\Runtime\RuntimeReflectionProvider + autowired: false + + - + class: PHPStan\Reflection\BetterReflection\BetterReflectionSourceLocatorFactory + arguments: + parser: @phpParserDecorator + autoloadDirectories: %autoload_directories% + autoloadFiles: %autoload_files% + analysedPaths: %analysedPaths% + composerAutoloaderProjectPaths: %composerAutoloaderProjectPaths% + analysedPathsFromConfig: %analysedPathsFromConfig% + enableScanningPaths: %featureToggles.enableScanningPaths% + + - + implement: PHPStan\Reflection\BetterReflection\BetterReflectionProviderFactory + + # Error formatters + + errorFormatter.raw: + class: PHPStan\Command\ErrorFormatter\RawErrorFormatter + + errorFormatter.baselineNeon: + class: PHPStan\Command\ErrorFormatter\BaselineNeonErrorFormatter + arguments: + relativePathHelper: @simpleRelativePathHelper + + errorFormatter.table: + class: PHPStan\Command\ErrorFormatter\TableErrorFormatter + arguments: + showTipsOfTheDay: %tipsOfTheDay% + + errorFormatter.checkstyle: + class: PHPStan\Command\ErrorFormatter\CheckstyleErrorFormatter + arguments: + relativePathHelper: @simpleRelativePathHelper + + errorFormatter.json: + class: PHPStan\Command\ErrorFormatter\JsonErrorFormatter + arguments: + pretty: false + + errorFormatter.junit: + class: PHPStan\Command\ErrorFormatter\JunitErrorFormatter + arguments: + relativePathHelper: @simpleRelativePathHelper + + errorFormatter.prettyJson: + class: PHPStan\Command\ErrorFormatter\JsonErrorFormatter + arguments: + pretty: true + + errorFormatter.gitlab: + class: PHPStan\Command\ErrorFormatter\GitlabErrorFormatter + arguments: + relativePathHelper: @simpleRelativePathHelper diff --git a/samples/NEON/example.neon b/samples/NEON/example.neon new file mode 100644 index 000000000..0234755da --- /dev/null +++ b/samples/NEON/example.neon @@ -0,0 +1,12 @@ +php: + date.timezone: Europe/Prague + zlib.output_compression: true + +database: + driver: mysql + username: root + password: beruska92 + +users: [ + Dave, Kryten, Rimmer +] diff --git a/vendor/README.md b/vendor/README.md index 6d48bdd3f..1300f032f 100644 --- a/vendor/README.md +++ b/vendor/README.md @@ -267,6 +267,7 @@ This is a list of grammars that Linguist selects to provide syntax highlighting - **Muse:** [Alhadis/language-emacs-lisp](https://github.com/Alhadis/language-emacs-lisp) - **NASL:** [tenable/sublimetext-nasl](https://github.com/tenable/sublimetext-nasl) - **NCL:** [rpavlick/language-ncl](https://github.com/rpavlick/language-ncl) +- **NEON:** [Alhadis/language-etc](https://github.com/Alhadis/language-etc) - **NPM Config:** [Alhadis/language-etc](https://github.com/Alhadis/language-etc) - **NSIS:** [github-linguist/NSIS](https://github.com/github-linguist/NSIS) - **Nearley:** [Hardmath123/sublime-nearley](https://github.com/Hardmath123/sublime-nearley) diff --git a/vendor/grammars/language-etc b/vendor/grammars/language-etc index ea35e9602..21894de79 160000 --- a/vendor/grammars/language-etc +++ b/vendor/grammars/language-etc @@ -1 +1 @@ -Subproject commit ea35e9602a5c4685b945ee3fd7a23850f446f74f +Subproject commit 21894de79dd77215c1573a55504fc000b713665a diff --git a/vendor/licenses/grammar/dartlang.txt b/vendor/licenses/grammar/dartlang.txt deleted file mode 100644 index 29282ca79..000000000 --- a/vendor/licenses/grammar/dartlang.txt +++ /dev/null @@ -1,32 +0,0 @@ ---- -type: grammar -name: dartlang -version: c5acdb2c8acfd2e5130ca5e94b380af02f8fafef -license: bsd-3-clause ---- -Copyright 2015, the Dart project authors. All rights reserved. -Redistribution and use in source and binary forms, with or without -modification, are permitted provided that the following conditions are -met: - - * Redistributions of source code must retain the above copyright - notice, this list of conditions and the following disclaimer. - * Redistributions in binary form must reproduce the above - copyright notice, this list of conditions and the following - disclaimer in the documentation and/or other materials provided - with the distribution. - * Neither the name of Google Inc. nor the names of its - contributors may be used to endorse or promote products derived - from this software without specific prior written permission. - -THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS -"AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT -LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR -A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT -OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, -SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT -LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, -DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY -THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT -(INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE -OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. \ No newline at end of file diff --git a/vendor/licenses/grammar/language-etc.txt b/vendor/licenses/grammar/language-etc.txt index 73aab50f6..74dce86e6 100644 --- a/vendor/licenses/grammar/language-etc.txt +++ b/vendor/licenses/grammar/language-etc.txt @@ -1,7 +1,7 @@ --- type: grammar name: language-etc -version: ea35e9602a5c4685b945ee3fd7a23850f446f74f +version: 21894de79dd77215c1573a55504fc000b713665a license: isc --- Copyright (c) 2018-2020, John Gardner