├── _config.yml ├── testData ├── MockPackages3 │ └── peppy │ │ └── vers.peppy.txt ├── psi │ ├── Rule.smk │ ├── RuleInvalid.smk │ ├── RuleNoName.smk │ ├── RuleInvalidNoParamBodyEof.smk │ ├── RuleIncomplete1.smk │ ├── RuleInPythonBlock.smk │ ├── RuleIncomplete2.smk │ ├── RuleInvalidNoParamBody.smk │ ├── DocstringAtEndOfFile.smk │ ├── Issue275_1.smk │ ├── RuleMultipleSingleLine.smk │ ├── RuleSectionNotebook.smk │ ├── RuleInvalidNoBreak.smk │ ├── RuleStringCallExpressionArgument.smk │ ├── Issue275_2.smk │ ├── ModuleIncomplete.smk │ ├── RuleMultiple.smk │ ├── RuleSectionTemplateEngine.smk │ ├── RuleMultipleSingleLineNoBreak.smk │ ├── RuleParamsListArgs.smk │ ├── FormattedStringInToplevelStatements.smk │ ├── WorkflowContainer.smk │ ├── PythonCode.smk │ ├── RuleParams.smk │ ├── SingleLineDocstring.smk │ ├── WorkflowEnvvars.smk │ ├── WorkflowLocalrulesHangingComma.smk │ ├── HangingComa.smk │ ├── RuleParamsListKeywordArgs.smk │ ├── RuleRun.smk │ ├── RuleSectionContainer.smk │ ├── WorkflowRuleorderHangingSeparator.smk │ ├── Issue175.smk │ ├── MultiLineDocstrings.smk │ ├── RuleSectionEnvmodules.smk │ ├── Issue190.smk │ ├── RuleInvalidParam.smk │ ├── WorkflowLocalrulesInvalid.smk │ ├── FormattedStringArgument.smk │ ├── Module.smk │ ├── RuleParamsListArgsMultiple.smk │ ├── KeywordIdentifierWithNoIndent.smk │ ├── UnexpectedSectionKeyword.smk │ ├── WorkflowParamsListArgsKeywordsInRule.smk │ ├── SingleSubworkflow.smk │ ├── RuleParamsListArgsIncorrectRuleSectionLevelIndentation.smk │ ├── RuleParamsListKeywordArgsMultiple.smk │ ├── WorkflowLocalrules.smk │ ├── WorkflowRuleorderInvalid.smk │ ├── RuleParamsListArgsHangingComma.smk │ ├── Issue202.smk │ ├── RuleParamsListArgsStringMultiline.smk │ ├── EmptySections.smk │ ├── SingleQuotedDocstrings.smk │ ├── Issue130.smk │ ├── RuleRunPythonBlock.smk │ ├── RuleMultilineStringArgumentsWithCallsAndExplicitConcatenation.smk │ ├── KeywordLikeIdentifiersAsKeywords.smk │ ├── UseIncomplete.smk │ ├── KeywordIdentifiersAtToplevelWithPrecedingOpenBrace.smk │ ├── RuleParamsListArgsIndents.smk │ ├── WorkflowRuleorder.smk │ ├── WorkflowParamsListArgsKeywords.smk │ ├── WorkflowUnknownSections.smk │ ├── KeywordLikeIdentifiersAsIdentifiers.smk │ ├── Issue313_1.smk │ ├── Checkpoint.smk │ ├── RuleParamsListArgsIndentationInsideBraces.smk │ ├── WorkflowPythonCodeBlockKeywords.smk │ ├── RuleInvalidNoParamBodyEof.txt │ ├── WorkflowTopLevelDecoratorsInRuleAsKeywordParams.smk │ ├── CrazyDocstrings.smk │ ├── RuleNoName.txt │ ├── RuleParamsListArgsStringMultilineIncorrectUnindent.smk │ ├── Issue275.smk │ ├── RuleInvalid.txt │ ├── Rule.txt │ ├── Issue313_2.smk │ ├── FormattedStringAfterToplevelSection.smk │ ├── RuleSectionNotebook.txt │ ├── RuleSectionTemplateEngine.txt │ ├── RuleSectionName.smk │ ├── UnbalancedBracesRecovery.smk │ ├── RuleInvalidNoParamBody.txt │ ├── DocstringAtEndOfFile.txt │ ├── RuleIncomplete1.txt │ ├── RuleMultipleSingleLineWithRuleSectionIndent.smk │ ├── RuleIncomplete2.txt │ ├── Use.smk │ ├── RuleParamsListArgs.txt │ ├── RuleInPythonBlock.txt │ ├── Issue275_1.txt │ ├── RuleParamsListArgsIncorrectIndentation.smk │ ├── RuleSectionContainer.txt │ ├── RuleParamsListArgsKeywords.smk │ ├── SingleLineDocstring.txt │ ├── Issue275_2.txt │ ├── RuleMultiple.txt │ ├── RuleMultipleSingleLine.txt │ ├── MultiLineDocstrings.txt │ ├── WorkflowContainer.txt │ ├── RuleMultipleSingleLineNoBreak.txt │ ├── UseInvalid.smk │ ├── WorkflowEnvvars.txt │ └── RuleParamsListArgsIncorrectUnindent.smk ├── MockPackages3_smk_6.1 │ └── snakemake │ │ └── vers.snakecharm.txt ├── MockPackages3_smk_6.5 │ └── snakemake │ │ └── vers.snakecharm.txt ├── stringLanguagePsi │ ├── BracesAndComma.smkStringLanguage │ ├── LbraceAndComma.smkStringLanguage │ ├── NoIdentifier.smkStringLanguage │ ├── RegexpOnly.smkStringLanguage │ ├── LbraceIdentifier.smkStringLanguage │ ├── LbraceIdentifierDot.smkStringLanguage │ ├── LbraceSubscription.smkStringLanguage │ ├── OrdinaryRegexp.smkStringLanguage │ ├── RbracketInName.smkStringLanguage │ ├── MultipleAccess.smkStringLanguage │ ├── DotsInsteadOfIdentifiers.smkStringLanguage │ ├── FormatSpecifier.smkStringLanguage │ ├── LbraceIncompleteSubscription1.smkStringLanguage │ ├── LbraceIncompleteSubscription2.smkStringLanguage │ ├── SpacesInIdentifierName.smkStringLanguage │ ├── BadIdentifierName.smkStringLanguage │ ├── MissingDot.smkStringLanguage │ ├── Subscription.smkStringLanguage │ ├── InjectionWithSpaceInside.smkStringLanguage │ ├── MultipleLanguageSections.smkStringLanguage │ ├── MissingIdentifier.smkStringLanguage │ ├── NoIdentifier.txt │ ├── LbraceIdentifier.txt │ ├── LbraceAndComma.txt │ ├── BracesAndComma.txt │ ├── FormatSpecifier.txt │ ├── LbraceIdentifierDot.txt │ ├── LbraceIncompleteSubscription1.txt │ ├── LbraceIncompleteSubscription2.txt │ ├── LbraceSubscription.txt │ ├── RegexpOnly.txt │ ├── MultipleAccess.txt │ ├── OrdinaryRegexp.txt │ ├── RbracketInName.txt │ ├── SpacesInIdentifierName.txt │ ├── DotsInsteadOfIdentifiers.txt │ ├── MissingDot.txt │ ├── InjectionWithSpaceInside.txt │ └── BadIdentifierName.txt ├── MockPackages3_smk_5x │ └── snakemake │ │ └── vers.snakecharm.txt ├── MockPackages3_smk_7.32.4 │ └── snakemake │ │ └── vers.snakecharm.txt ├── MockSdk2.7 │ ├── bin │ │ └── python2.7 │ └── Lib │ │ └── abc.py ├── MockSdk3.7 │ ├── bin │ │ └── python3.7 │ └── Lib │ │ └── collections │ │ └── abc.py ├── formatter │ ├── spaceAfterSectionKeywordColon.smk │ ├── alignSectionArgs_NotKeepLB_after.smk │ ├── spaceAfterSectionKeywordColon_after.smk │ ├── alignSectionArgs.smk │ ├── alignSectionArgs_KeepLB.smk │ ├── alignSectionArgs_NotKeepLB.smk │ ├── alignSectionArgs_after.smk │ ├── alignSectionArgs_AlignMultiline.smk │ ├── alignSectionArgs_KeepLB_after.smk │ ├── alignSectionArgs_AlignMultiline_after.smk │ ├── hardWrap20_NoWrap_after.smk │ ├── hardWrap20.smk │ ├── hardWrap20_NoWrap.smk │ ├── hardWrap20_after.smk │ ├── aroundRuleLikeSections.smk │ └── aroundRuleLikeSections_after.smk ├── editing │ ├── enterAfterRuleParamColon.smk │ ├── enterAfterRuleParamsIncomplete.smk │ ├── enterAfterRuleParamColon.after.smk │ ├── enterAfterRuleParamsIncomplete2.smk │ ├── enterAfterRuleParamsIncomplete.after.smk │ └── enterAfterRuleParamsIncomplete2.after.smk ├── wrappers_storage2 │ └── bio │ │ └── bismark │ │ └── custom_wr1 │ │ ├── wrapper.py │ │ ├── environment.yaml │ │ └── meta.yaml ├── wrappers_storage │ ├── bio │ │ ├── bcftools │ │ │ ├── call │ │ │ │ ├── environment.yaml │ │ │ │ ├── meta.yaml │ │ │ │ └── wrapper.py │ │ │ └── reheader │ │ │ │ ├── environment.yaml │ │ │ │ ├── meta.yaml │ │ │ │ └── wrapper.py │ │ ├── samtools │ │ │ ├── sort │ │ │ │ ├── environment.yaml │ │ │ │ ├── meta.yaml │ │ │ │ └── wrapper.py │ │ │ ├── depth │ │ │ │ ├── environment.yaml │ │ │ │ ├── meta.yaml │ │ │ │ └── wrapper.py │ │ │ └── bam2fq │ │ │ │ └── interleaved │ │ │ │ ├── environment.yaml │ │ │ │ ├── meta.yaml │ │ │ │ └── wrapper.py │ │ ├── pear │ │ │ ├── environment.yaml │ │ │ └── meta.yaml │ │ ├── arriba │ │ │ ├── environment.yaml │ │ │ └── meta.yaml │ │ ├── fastp │ │ │ ├── environment.yaml │ │ │ └── meta.yaml │ │ ├── fastqc │ │ │ ├── environment.yaml │ │ │ └── meta.yaml │ │ ├── last │ │ │ └── lastal │ │ │ │ ├── environment.yaml │ │ │ │ └── meta.yaml │ │ ├── multiqc │ │ │ ├── environment.yaml │ │ │ ├── meta.yaml │ │ │ └── wrapper.py │ │ ├── gatk3 │ │ │ └── printreads │ │ │ │ ├── environment.yaml │ │ │ │ ├── meta.yaml │ │ │ │ └── wrapper.py │ │ ├── vcftools │ │ │ └── filter │ │ │ │ ├── meta.yaml │ │ │ │ ├── environment.yaml │ │ │ │ └── wrapper.py │ │ ├── hisat2 │ │ │ └── index │ │ │ │ ├── environment.yaml │ │ │ │ ├── meta.yaml │ │ │ │ └── wrapper.py │ │ ├── bedtools │ │ │ └── coveragebed │ │ │ │ ├── environment.yaml │ │ │ │ ├── meta.yaml │ │ │ │ └── wrapper.py │ │ ├── picard │ │ │ └── bedtointervallist │ │ │ │ ├── environment.yaml │ │ │ │ ├── wrapper.py │ │ │ │ └── meta.yaml │ │ ├── gatk │ │ │ └── applybqsr │ │ │ │ ├── environment.yaml │ │ │ │ ├── meta.yaml │ │ │ │ └── wrapper.py │ │ ├── bismark │ │ │ ├── bismark │ │ │ │ ├── environment.yaml │ │ │ │ └── meta.yaml │ │ │ ├── bismark2report │ │ │ │ └── environment.yaml │ │ │ └── bismark_methylation_extractor │ │ │ │ └── environment.yaml │ │ └── bwa │ │ │ ├── mem-samblaster │ │ │ ├── environment.yaml │ │ │ └── meta.yaml │ │ │ └── mem │ │ │ ├── environment.yaml │ │ │ └── meta.yaml │ └── utils │ │ └── cairosvg │ │ ├── environment.yaml │ │ ├── meta.yaml │ │ └── wrapper.py ├── MockPackages3_smk_9.3.0 │ └── snakemake │ │ └── ioutils │ │ ├── collect.py │ │ ├── evaluate.py │ │ └── exists.py ├── folding │ ├── workflowTopLevel.smk │ ├── rule.smk │ ├── checkpoint.smk │ ├── pythonBlocks.smk │ ├── pythonComments.smk │ ├── multilineRulesDoNotCollapse.smk │ └── multilineRulesCollapse.smk └── inspections │ └── SnakemakeRuleKeywordsAfterExecutionInspection │ └── paramsKeywordAfterRun.smk ├── src ├── test │ ├── resources │ │ ├── cucumber.properties │ │ └── features │ │ │ ├── highlighting │ │ │ ├── color_settings_page.feature │ │ │ ├── inspections │ │ │ │ ├── avoid_tab_whitespaces.feature │ │ │ │ ├── module_redeclaration.feature │ │ │ │ ├── weak_warning_for_pep_without_pepfile.feature │ │ │ │ ├── subworkflow_redeclaration.feature │ │ │ │ └── unused_local.feature │ │ │ └── pythonregexp_highlighting_in_wildcard_constraints_section.feature │ │ │ ├── stringLanguage │ │ │ └── issue380.feature │ │ │ ├── refactoring │ │ │ └── rename_section.feature │ │ │ ├── controlflow │ │ │ └── snakemake_controlflow.feature │ │ │ ├── resolve │ │ │ ├── subworkflow_name_resolve.feature │ │ │ └── py_code_resolve.feature │ │ │ ├── actions │ │ │ ├── goto_symbol.feature │ │ │ └── smk_code_block_provider.feature │ │ │ ├── findUsages │ │ │ └── rules_and_checkpoints_find_usages.feature │ │ │ ├── completion │ │ │ ├── subworkflow_name_completion.feature │ │ │ └── py_code_completion.feature │ │ │ └── formatter │ │ │ └── indent_on_new_line_typing.feature │ └── kotlin │ │ ├── features │ │ └── AllCucumberFeaturesTest.kt │ │ └── com │ │ └── jetbrains │ │ └── snakecharm │ │ ├── SnakeFileTypeTest.kt │ │ ├── SnakemakeFoldingTest.kt │ │ └── FakeSnakemakeInjector.kt └── main │ ├── resources │ ├── icons │ │ ├── snakemake_16.png │ │ └── snakemake_16@2x.png │ ├── inspectionDescriptions │ │ ├── SmkRedundantCommaInspection.html │ │ ├── SmkShadowMultipleSettingsInspection.html │ │ ├── SmkDocstringsWillBeIgnoredInspection.html │ │ ├── SmkSubworkflowRedeclarationInspection.html │ │ ├── SmkAvoidTabWhitespace.html │ │ ├── SmkModuleRedeclarationInspection.html │ │ ├── SmkShadowSettingsInspection.html │ │ ├── SmkSectionRedeclarationInspection.html │ │ ├── SmkMinVersionWarningInspection.html │ │ ├── SmkRuleRedeclarationInspection.html │ │ ├── SmkTemplateEngineSettingsInspection.html │ │ ├── SmkSectionUnspecifiedFieldArgsInspection.html │ │ ├── SmkCondaSectionNotAllowedWithRun.html │ │ ├── SmkFileEndsWithCommentInspection.html │ │ ├── SmkSectionDuplicatedArgsInspection.html │ │ ├── SmkSubscriptionIndexOutOfBoundsInspection.html │ │ ├── SmkLocalrulesRuleorderRepeatedRuleInspection.html │ │ ├── SmkSLSubscriptionIndexOutOfBoundsInspection.html │ │ ├── SmkEnvmodulesNotAllowedSectionInspection.html │ │ ├── SmkMultilineFunctionCallInspection.html │ │ ├── SmkNotSameWildcardsSetInspection.html │ │ ├── SmkRuleOrCheckpointNameYetUndefinedInspection.html │ │ ├── SmkWildcardNotDefinedInspection.html │ │ ├── SmkResourcesKeywordArgsInspection.html │ │ ├── SmkRuleSectionAfterExecutionInspection.html │ │ ├── SmkSLUndeclaredSectionInspection.html │ │ ├── SmkUndeclaredSectionInspection.html │ │ ├── SmkExecutionSubsectionInUseSectionInspection.html │ │ ├── SmkLocalrulesRuleorderConfusingReferenceInspection.html │ │ ├── SmkSectionMultipleArgsInspection.html │ │ ├── SmkLambdaRuleParamsInspection.html │ │ ├── SmkMisuseUsageIOFlagMethodsInspection.html │ │ ├── SmkSectionMultilineStringArgsInspection.html │ │ ├── SmkWrapperMissedArgumentsInspection.html │ │ ├── SmkUnusedLogFileInspection.html │ │ ├── SmkSLQuotingMisuseInGetAccessorInspection.html │ │ ├── SmkWildcardInNotOverriddenSectionInspection.html │ │ ├── SmkSLMissingWildcardsAccessorPrefixInspection.html │ │ ├── SmkSectionUnexpectedKeywordArgsInspection.html │ │ ├── SmkSeveralRulesAreOverriddenAsOneInspection.html │ │ ├── SmkSectionVariableRequiresLambdaAccessInspection.html │ │ ├── SmkUnresolvedImportedRuleNameInspection.html │ │ ├── SmkSectionUnexpectedCallableArgsInspection.html │ │ ├── SmkSLWildcardNameIsConfusingInspection.html │ │ ├── SmkDepreciatedKeywordsInspection.html │ │ └── SmkUnrecognizedSectionInspection.html │ └── com │ │ └── jetbrains │ │ └── snakecharm │ │ ├── lang │ │ └── formatter │ │ │ ├── blank_lines_settings.smk │ │ │ └── default.smk │ │ └── spellchecker │ │ └── snakemake.dic │ ├── kotlin │ └── com │ │ └── jetbrains │ │ └── snakecharm │ │ ├── stringLanguage │ │ ├── lang │ │ │ ├── psi │ │ │ │ ├── SmkSLExpression.kt │ │ │ │ ├── references │ │ │ │ │ └── SmkSLBaseReference.kt │ │ │ │ ├── SmkSLSubscriptionIndexKeyExpression.kt │ │ │ │ ├── SmkSLElementType.kt │ │ │ │ ├── SmkSLElement.kt │ │ │ │ ├── SmkSLElementImpl.kt │ │ │ │ ├── SmkSLFile.kt │ │ │ │ ├── elementTypes │ │ │ │ │ └── SmkSLElementTypes.kt │ │ │ │ └── SmkSLSubscriptionExpression.kt │ │ │ ├── parser │ │ │ │ └── SmkSLLexerAdapter.kt │ │ │ ├── highlighter │ │ │ │ ├── AbstractSmkSLAnnotator.kt │ │ │ │ ├── SmkSLSyntaxHighlighterFactory.kt │ │ │ │ └── SmkSLAnnotatingVisitor.kt │ │ │ ├── SmkSLBraceMatcher.kt │ │ │ └── SmkSLElementVisitor.kt │ │ ├── SmkSLanguage.kt │ │ └── SmkSLFileType.kt │ │ ├── spellchecker │ │ └── SmkBundledDictionaryProvider.kt │ │ ├── SnakemakeIcons.kt │ │ ├── codeInsight │ │ ├── completion │ │ │ ├── SmkCompletionContributorPattern.kt │ │ │ └── wrapper │ │ │ │ ├── SmkWrapperCompletionContributor.kt │ │ │ │ └── SmkWrapperArgsCompletionContributor.kt │ │ ├── SmkCodeInsightScope.kt │ │ └── refactoring │ │ │ └── SmkRenamePsiElementProcessor.kt │ │ ├── lang │ │ ├── SmkFileElementType.kt │ │ ├── parser │ │ │ ├── SmkFunctionParsing.kt │ │ │ ├── SnakemakeParser.kt │ │ │ ├── SmkParsingScope.kt │ │ │ └── SmkParserDefinition.kt │ │ ├── psi │ │ │ ├── stubs │ │ │ │ ├── SmkStubs.kt │ │ │ │ ├── SmkUseNameIndex.kt │ │ │ │ ├── SmkModuleNameIndex.kt │ │ │ │ ├── SmkCheckpointNameIndex.kt │ │ │ │ └── SmkRuleNameIndex.kt │ │ │ ├── SmkArgsSection.kt │ │ │ ├── impl │ │ │ │ ├── SmkExcludedRulesNamesListImpl.kt │ │ │ │ ├── SmkUseNewNamePatternImpl.kt │ │ │ │ ├── SmkSubworkflowArgsSectionImpl.kt │ │ │ │ ├── SmkArgsSectionImpl.kt │ │ │ │ ├── stubs │ │ │ │ │ ├── SmkRuleElementType.kt │ │ │ │ │ ├── SmkSubworkflowElementType.kt │ │ │ │ │ ├── SmkUseElementType.kt │ │ │ │ │ ├── SmkCheckpointElementType.kt │ │ │ │ │ └── SmkModuleElementType.kt │ │ │ │ ├── refs │ │ │ │ │ └── SmkPyQualifiedReference.kt │ │ │ │ └── SmkWorkflowRuleorderSectionImpl.kt │ │ │ ├── types │ │ │ │ ├── SmkRulesType.kt │ │ │ │ └── SmkCheckpointType.kt │ │ │ ├── SmkRuleLike.kt │ │ │ └── SmkRuleOrCheckpoint.kt │ │ ├── validation │ │ │ ├── SmkAnnotator.kt │ │ │ └── SmkReturnAnnotator.kt │ │ ├── formatter │ │ │ ├── SmkCustomCodeStyleSettings.kt │ │ │ ├── SmkCodeStyleSettingsPanel.kt │ │ │ └── SmkCodeStyleConfigurable.kt │ │ ├── structureView │ │ │ ├── SmkStructureViewFactory.kt │ │ │ └── SmkStructureViewModel.kt │ │ └── SnakemakeLanguageDialect.kt │ │ ├── SmkFileType.kt │ │ ├── inspections │ │ ├── SnakemakeInspectionVisitor.kt │ │ ├── smksl │ │ │ └── SmkSLInspectionVisitor.kt │ │ ├── SnakemakeInspection.kt │ │ └── SmkAvoidTabWhitespace.kt │ │ ├── SnakemakePluginUtil.kt │ │ ├── SnakemakeBundle.kt │ │ └── framework │ │ └── SmkFrameworkType.kt │ └── java │ └── com │ └── jetbrains │ └── snakecharm │ ├── SnakemakePluginListener.java │ └── lang │ └── psi │ └── elementTypes │ └── SmkStubElementTypes.java ├── gradle └── wrapper │ ├── gradle-wrapper.jar │ └── gradle-wrapper.properties ├── .github └── readme │ ├── JBResearch_SnakeCharm_Plugin_logo.png │ └── JBResearch_SnakeCharm_Plugin_white_logo.png ├── CODE_OF_CONDUCT.md ├── settings.gradle.kts ├── snakemake2py.py └── LICENSE.txt /_config.yml: -------------------------------------------------------------------------------- 1 | theme: jekyll-theme-slate -------------------------------------------------------------------------------- /testData/MockPackages3/peppy/vers.peppy.txt: -------------------------------------------------------------------------------- 1 | 0.31.0 -------------------------------------------------------------------------------- /testData/psi/Rule.smk: -------------------------------------------------------------------------------- 1 | rule all: 2 | input: 'foo' -------------------------------------------------------------------------------- /testData/psi/RuleInvalid.smk: -------------------------------------------------------------------------------- 1 | rule 2 | input: 'foo' -------------------------------------------------------------------------------- /testData/psi/RuleNoName.smk: -------------------------------------------------------------------------------- 1 | rule: 2 | input: 'foo' -------------------------------------------------------------------------------- /testData/MockPackages3_smk_6.1/snakemake/vers.snakecharm.txt: -------------------------------------------------------------------------------- 1 | 6.1 -------------------------------------------------------------------------------- /testData/MockPackages3_smk_6.5/snakemake/vers.snakecharm.txt: -------------------------------------------------------------------------------- 1 | 6.5 -------------------------------------------------------------------------------- /testData/psi/RuleInvalidNoParamBodyEof.smk: -------------------------------------------------------------------------------- 1 | rule: 2 | input: -------------------------------------------------------------------------------- /testData/stringLanguagePsi/BracesAndComma.smkStringLanguage: -------------------------------------------------------------------------------- 1 | {,} -------------------------------------------------------------------------------- /testData/stringLanguagePsi/LbraceAndComma.smkStringLanguage: -------------------------------------------------------------------------------- 1 | {, -------------------------------------------------------------------------------- /testData/stringLanguagePsi/NoIdentifier.smkStringLanguage: -------------------------------------------------------------------------------- 1 | {} -------------------------------------------------------------------------------- /testData/stringLanguagePsi/RegexpOnly.smkStringLanguage: -------------------------------------------------------------------------------- 1 | {,\d+} -------------------------------------------------------------------------------- /testData/MockPackages3_smk_5x/snakemake/vers.snakecharm.txt: -------------------------------------------------------------------------------- 1 | 6.0.5 -------------------------------------------------------------------------------- /testData/stringLanguagePsi/LbraceIdentifier.smkStringLanguage: -------------------------------------------------------------------------------- 1 | {foo -------------------------------------------------------------------------------- /src/test/resources/cucumber.properties: -------------------------------------------------------------------------------- 1 | cucumber.publish.quiet=true 2 | -------------------------------------------------------------------------------- /testData/stringLanguagePsi/LbraceIdentifierDot.smkStringLanguage: -------------------------------------------------------------------------------- 1 | {foo. -------------------------------------------------------------------------------- /testData/stringLanguagePsi/LbraceSubscription.smkStringLanguage: -------------------------------------------------------------------------------- 1 | {foo[0] -------------------------------------------------------------------------------- /testData/stringLanguagePsi/OrdinaryRegexp.smkStringLanguage: -------------------------------------------------------------------------------- 1 | {foo, \d+} -------------------------------------------------------------------------------- /testData/stringLanguagePsi/RbracketInName.smkStringLanguage: -------------------------------------------------------------------------------- 1 | {foo],\d+} -------------------------------------------------------------------------------- /testData/MockPackages3_smk_7.32.4/snakemake/vers.snakecharm.txt: -------------------------------------------------------------------------------- 1 | 7.32.4 2 | -------------------------------------------------------------------------------- /testData/MockSdk2.7/bin/python2.7: -------------------------------------------------------------------------------- 1 | # placeholder for python interpreter 2 | -------------------------------------------------------------------------------- /testData/MockSdk3.7/bin/python3.7: -------------------------------------------------------------------------------- 1 | # placeholder for python interpreter 2 | -------------------------------------------------------------------------------- /testData/formatter/spaceAfterSectionKeywordColon.smk: -------------------------------------------------------------------------------- 1 | rule foo: 2 | input:a -------------------------------------------------------------------------------- /testData/stringLanguagePsi/MultipleAccess.smkStringLanguage: -------------------------------------------------------------------------------- 1 | {foo.boo.doo.too} -------------------------------------------------------------------------------- /testData/editing/enterAfterRuleParamColon.smk: -------------------------------------------------------------------------------- 1 | rule all: 2 | input:"xxx" -------------------------------------------------------------------------------- /testData/editing/enterAfterRuleParamsIncomplete.smk: -------------------------------------------------------------------------------- 1 | rule foo: 2 | input: -------------------------------------------------------------------------------- /testData/psi/RuleIncomplete1.smk: -------------------------------------------------------------------------------- 1 | rule 2 | rule my_rule: 3 | output: 'out.txt', -------------------------------------------------------------------------------- /testData/stringLanguagePsi/DotsInsteadOfIdentifiers.smkStringLanguage: -------------------------------------------------------------------------------- 1 | {.[foo..boo.} -------------------------------------------------------------------------------- /testData/stringLanguagePsi/FormatSpecifier.smkStringLanguage: -------------------------------------------------------------------------------- 1 | {foo:%Y-%m-%d %H:%M:%S} -------------------------------------------------------------------------------- /testData/stringLanguagePsi/LbraceIncompleteSubscription1.smkStringLanguage: -------------------------------------------------------------------------------- 1 | {foo[ -------------------------------------------------------------------------------- /testData/stringLanguagePsi/LbraceIncompleteSubscription2.smkStringLanguage: -------------------------------------------------------------------------------- 1 | {foo[0 -------------------------------------------------------------------------------- /testData/stringLanguagePsi/SpacesInIdentifierName.smkStringLanguage: -------------------------------------------------------------------------------- 1 | { foo,\d+} -------------------------------------------------------------------------------- /testData/editing/enterAfterRuleParamColon.after.smk: -------------------------------------------------------------------------------- 1 | rule all: 2 | input: 3 | a="xxx" -------------------------------------------------------------------------------- /testData/psi/RuleInPythonBlock.smk: -------------------------------------------------------------------------------- 1 | def foo(): 2 | rule aa: 3 | output: "bb" 4 | -------------------------------------------------------------------------------- /testData/psi/RuleIncomplete2.smk: -------------------------------------------------------------------------------- 1 | rule foo 2 | rule my_rule: 3 | output: 'out.txt', -------------------------------------------------------------------------------- /testData/psi/RuleInvalidNoParamBody.smk: -------------------------------------------------------------------------------- 1 | rule: 2 | input: 3 | output: 'foo' 4 | -------------------------------------------------------------------------------- /testData/stringLanguagePsi/BadIdentifierName.smkStringLanguage: -------------------------------------------------------------------------------- 1 | {f?o&*o.boo.doo.to[o[100]} -------------------------------------------------------------------------------- /testData/stringLanguagePsi/MissingDot.smkStringLanguage: -------------------------------------------------------------------------------- 1 | {foo boo} 2 | {foo1[key]foo2} -------------------------------------------------------------------------------- /testData/stringLanguagePsi/Subscription.smkStringLanguage: -------------------------------------------------------------------------------- 1 | {foo[0].boo.doo[0][0][0].too} -------------------------------------------------------------------------------- /testData/editing/enterAfterRuleParamsIncomplete2.smk: -------------------------------------------------------------------------------- 1 | rule foo: 2 | input: 3 | pass -------------------------------------------------------------------------------- /testData/formatter/alignSectionArgs_NotKeepLB_after.smk: -------------------------------------------------------------------------------- 1 | rule r: 2 | input: "a","b" 3 | -------------------------------------------------------------------------------- /testData/formatter/spaceAfterSectionKeywordColon_after.smk: -------------------------------------------------------------------------------- 1 | rule foo: 2 | input: a 3 | -------------------------------------------------------------------------------- /testData/psi/DocstringAtEndOfFile.smk: -------------------------------------------------------------------------------- 1 | rule boo: 2 | shell: "echo hello" 3 | "world" -------------------------------------------------------------------------------- /testData/editing/enterAfterRuleParamsIncomplete.after.smk: -------------------------------------------------------------------------------- 1 | rule foo: 2 | input: 3 | foo -------------------------------------------------------------------------------- /testData/formatter/alignSectionArgs.smk: -------------------------------------------------------------------------------- 1 | rule r: 2 | input: 3 | "a", 4 | "b" -------------------------------------------------------------------------------- /testData/psi/Issue275_1.smk: -------------------------------------------------------------------------------- 1 | if True: 2 | rule: 3 | shell: "2" 4 | "3" -------------------------------------------------------------------------------- /testData/psi/RuleMultipleSingleLine.smk: -------------------------------------------------------------------------------- 1 | rule all1: input: 'foo1' 2 | rule all2: input: 'foo2' 3 | -------------------------------------------------------------------------------- /testData/psi/RuleSectionNotebook.smk: -------------------------------------------------------------------------------- 1 | rule hello: 2 | notebook: 3 | "hello.py.ipynb" -------------------------------------------------------------------------------- /testData/formatter/alignSectionArgs_KeepLB.smk: -------------------------------------------------------------------------------- 1 | rule r: 2 | input: 3 | "a", 4 | "b" -------------------------------------------------------------------------------- /testData/psi/RuleInvalidNoBreak.smk: -------------------------------------------------------------------------------- 1 | rule all1: input: 'foo1' 2 | rule all2: 3 | input: 'foo2' 4 | -------------------------------------------------------------------------------- /testData/psi/RuleStringCallExpressionArgument.smk: -------------------------------------------------------------------------------- 1 | rule NAME: 2 | shell: 'command {} {}'.format(1, 2) -------------------------------------------------------------------------------- /testData/editing/enterAfterRuleParamsIncomplete2.after.smk: -------------------------------------------------------------------------------- 1 | rule foo: 2 | input: 3 | foo 4 | pass -------------------------------------------------------------------------------- /testData/formatter/alignSectionArgs_NotKeepLB.smk: -------------------------------------------------------------------------------- 1 | rule r: 2 | input: 3 | "a", 4 | "b" -------------------------------------------------------------------------------- /testData/formatter/alignSectionArgs_after.smk: -------------------------------------------------------------------------------- 1 | rule r: 2 | input: 3 | "a", 4 | "b" 5 | -------------------------------------------------------------------------------- /testData/psi/Issue275_2.smk: -------------------------------------------------------------------------------- 1 | if True: 2 | pass 3 | rule: 4 | shell: "2" 5 | "3" -------------------------------------------------------------------------------- /testData/psi/ModuleIncomplete.smk: -------------------------------------------------------------------------------- 1 | module 2 | module z 3 | module v: 4 | module f: 5 | snakefile: "myfile" -------------------------------------------------------------------------------- /testData/psi/RuleMultiple.smk: -------------------------------------------------------------------------------- 1 | rule all: 2 | input: 'foo' 3 | 4 | rule ddd: 5 | input: 'doo' 6 | -------------------------------------------------------------------------------- /testData/psi/RuleSectionTemplateEngine.smk: -------------------------------------------------------------------------------- 1 | rule hello: 2 | template_engine: 3 | "hello.py.ipynb" -------------------------------------------------------------------------------- /testData/formatter/alignSectionArgs_AlignMultiline.smk: -------------------------------------------------------------------------------- 1 | rule r: 2 | input: 3 | "a", 4 | "b" -------------------------------------------------------------------------------- /testData/formatter/alignSectionArgs_KeepLB_after.smk: -------------------------------------------------------------------------------- 1 | rule r: 2 | input: 3 | "a", 4 | "b" 5 | -------------------------------------------------------------------------------- /testData/psi/RuleMultipleSingleLineNoBreak.smk: -------------------------------------------------------------------------------- 1 | rule all1: input: 'foo1' 2 | 3 | rule all2: input: 'foo2' 4 | -------------------------------------------------------------------------------- /testData/psi/RuleParamsListArgs.smk: -------------------------------------------------------------------------------- 1 | rule samtools_sort: 2 | input: 3 | "foo" 4 | output: "boo" -------------------------------------------------------------------------------- /testData/MockSdk3.7/Lib/collections/abc.py: -------------------------------------------------------------------------------- 1 | from _collections_abc import * 2 | from _collections_abc import __all__ 3 | -------------------------------------------------------------------------------- /testData/psi/FormattedStringInToplevelStatements.smk: -------------------------------------------------------------------------------- 1 | print(f"{rule}") 2 | 3 | rule foo: 4 | shell: "echo hello" -------------------------------------------------------------------------------- /testData/psi/WorkflowContainer.smk: -------------------------------------------------------------------------------- 1 | container: "ddd" 2 | 3 | rule aaa: 4 | params: 5 | container = "foo10" -------------------------------------------------------------------------------- /testData/stringLanguagePsi/InjectionWithSpaceInside.smkStringLanguage: -------------------------------------------------------------------------------- 1 | "{Prefix1 Suffix1}" "{Prefix2.fooo Suffix2.boo}" -------------------------------------------------------------------------------- /testData/formatter/alignSectionArgs_AlignMultiline_after.smk: -------------------------------------------------------------------------------- 1 | rule r: 2 | input: 3 | "a", 4 | "b" 5 | -------------------------------------------------------------------------------- /testData/wrappers_storage2/bio/bismark/custom_wr1/wrapper.py: -------------------------------------------------------------------------------- 1 | output_dir = snakemake.output.get("custom_html", None) 2 | -------------------------------------------------------------------------------- /testData/psi/PythonCode.smk: -------------------------------------------------------------------------------- 1 | def foo(): 2 | pass 3 | 4 | def boo(arg1, arg2): 5 | pass 6 | 7 | TRACK = 'hg19.gtf' 8 | -------------------------------------------------------------------------------- /testData/psi/RuleParams.smk: -------------------------------------------------------------------------------- 1 | rule all: 2 | input: 'iiii' 3 | output: 'ooooo' 4 | 5 | rule ddd: 6 | input: 'ddd' 7 | -------------------------------------------------------------------------------- /testData/psi/SingleLineDocstring.smk: -------------------------------------------------------------------------------- 1 | rule NAME: 2 | """Docstring""" 3 | input: "input.txt" 4 | output: "output.txt" -------------------------------------------------------------------------------- /gradle/wrapper/gradle-wrapper.jar: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/JetBrains-Research/snakecharm/HEAD/gradle/wrapper/gradle-wrapper.jar -------------------------------------------------------------------------------- /testData/psi/WorkflowEnvvars.smk: -------------------------------------------------------------------------------- 1 | envvars: 2 | "SOME_VARIABLE" 3 | 4 | rule aaa: 5 | params: 6 | envvars = "foo10" -------------------------------------------------------------------------------- /testData/psi/WorkflowLocalrulesHangingComma.smk: -------------------------------------------------------------------------------- 1 | localrules: foo0, 2 | 3 | localrules: foo1, foo2, 4 | 5 | localrules: foo1, foo2, -------------------------------------------------------------------------------- /testData/psi/HangingComa.smk: -------------------------------------------------------------------------------- 1 | rule my_rule: 2 | input: 'my_input.file', 3 | output: 'my_output.file' 4 | shell: 'echo hi world' -------------------------------------------------------------------------------- /testData/psi/RuleParamsListKeywordArgs.smk: -------------------------------------------------------------------------------- 1 | rule samtools_sort: 2 | input: 3 | input="in.bam" 4 | output: output="in.bam" -------------------------------------------------------------------------------- /testData/psi/RuleRun.smk: -------------------------------------------------------------------------------- 1 | rule compose_merge: 2 | run: foo 3 | 4 | rule compose_merge: 5 | run: 6 | foo 7 | boo() -------------------------------------------------------------------------------- /testData/stringLanguagePsi/MultipleLanguageSections.smkStringLanguage: -------------------------------------------------------------------------------- 1 | some text {foo.boo.doo, \d+} some text {foo[0].boo[0].doo.too,a{3,5}} -------------------------------------------------------------------------------- /testData/psi/RuleSectionContainer.smk: -------------------------------------------------------------------------------- 1 | rule foo: 2 | container: "docker://joseespinosa/docker-r-ggplot2" 3 | script: 4 | "foo.R" -------------------------------------------------------------------------------- /testData/psi/WorkflowRuleorderHangingSeparator.smk: -------------------------------------------------------------------------------- 1 | ruleorder: rule1 > 2 | 3 | ruleorder: rule1 > rule2 > 4 | 5 | ruleorder: rule1 > rule2 > -------------------------------------------------------------------------------- /src/main/resources/icons/snakemake_16.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/JetBrains-Research/snakecharm/HEAD/src/main/resources/icons/snakemake_16.png -------------------------------------------------------------------------------- /testData/psi/Issue175.smk: -------------------------------------------------------------------------------- 1 | rule boo: 2 | "world", 3 | shell: "echo hello" 4 | 5 | rule boo: 6 | "wo" + "rld" 7 | shell: "echo hello" -------------------------------------------------------------------------------- /testData/psi/MultiLineDocstrings.smk: -------------------------------------------------------------------------------- 1 | rule Name: 2 | """ line 1 3 | line 2 4 | """ 5 | input: "input.txt" 6 | output: "output.txt" -------------------------------------------------------------------------------- /testData/psi/RuleSectionEnvmodules.smk: -------------------------------------------------------------------------------- 1 | rule rule_332: 2 | envmodules: 3 | config["FOO"], 4 | config["BOO"] 5 | script: "" -------------------------------------------------------------------------------- /src/main/resources/icons/snakemake_16@2x.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/JetBrains-Research/snakecharm/HEAD/src/main/resources/icons/snakemake_16@2x.png -------------------------------------------------------------------------------- /testData/wrappers_storage/bio/bcftools/call/environment.yaml: -------------------------------------------------------------------------------- 1 | channels: 2 | - bioconda 3 | - conda-forge 4 | dependencies: 5 | - bcftools ==1.10 6 | -------------------------------------------------------------------------------- /testData/wrappers_storage/bio/samtools/sort/environment.yaml: -------------------------------------------------------------------------------- 1 | channels: 2 | - bioconda 3 | - conda-forge 4 | dependencies: 5 | - samtools ==1.10 6 | -------------------------------------------------------------------------------- /testData/wrappers_storage/utils/cairosvg/environment.yaml: -------------------------------------------------------------------------------- 1 | channels: 2 | - bioconda 3 | - conda-forge 4 | dependencies: 5 | - cairosvg =2.4.2 6 | -------------------------------------------------------------------------------- /testData/stringLanguagePsi/MissingIdentifier.smkStringLanguage: -------------------------------------------------------------------------------- 1 | {} 2 | {.} 3 | {foo1.} 4 | {foo2..} 5 | {foo3..} 6 | {foo3..[dd]} 7 | {foo3[]} 8 | {foo3[]..} -------------------------------------------------------------------------------- /testData/wrappers_storage/bio/bcftools/reheader/environment.yaml: -------------------------------------------------------------------------------- 1 | channels: 2 | - bioconda 3 | - conda-forge 4 | dependencies: 5 | - bcftools ==1.10 6 | -------------------------------------------------------------------------------- /testData/wrappers_storage/bio/pear/environment.yaml: -------------------------------------------------------------------------------- 1 | channels: 2 | - bioconda 3 | - conda-forge 4 | - defaults 5 | dependencies: 6 | - pear=0.9.6 7 | -------------------------------------------------------------------------------- /testData/wrappers_storage/bio/samtools/depth/environment.yaml: -------------------------------------------------------------------------------- 1 | channels: 2 | - bioconda 3 | - conda-forge 4 | dependencies: 5 | - samtools ==1.10 6 | -------------------------------------------------------------------------------- /testData/wrappers_storage/utils/cairosvg/meta.yaml: -------------------------------------------------------------------------------- 1 | name: cairosvg 2 | description: Convert SVG files with cairosvg. 3 | authors: 4 | - Johannes Köster 5 | -------------------------------------------------------------------------------- /testData/psi/Issue190.smk: -------------------------------------------------------------------------------- 1 | if True: 2 | a = 2 3 | rule all: 4 | params: 5 | extra="--buffer_size 20G" 6 | # fooo 7 | -------------------------------------------------------------------------------- /testData/psi/RuleInvalidParam.smk: -------------------------------------------------------------------------------- 1 | rule: 2 | input 'foo1' 3 | 4 | rule: 5 | 'input': 'foo2' 6 | 7 | rule all3: input foo3 8 | 9 | rule all4: 'input': foo4 -------------------------------------------------------------------------------- /testData/wrappers_storage/bio/arriba/environment.yaml: -------------------------------------------------------------------------------- 1 | channels: 2 | - conda-forge 3 | - bioconda 4 | - defaults 5 | dependencies: 6 | - arriba ==1.1.0 7 | -------------------------------------------------------------------------------- /testData/wrappers_storage/bio/arriba/meta.yaml: -------------------------------------------------------------------------------- 1 | name: "arriba" 2 | description: Detect gene fusions from chimeric STAR output 3 | authors: 4 | - Jan Forster 5 | -------------------------------------------------------------------------------- /testData/wrappers_storage/bio/fastp/environment.yaml: -------------------------------------------------------------------------------- 1 | channels: 2 | - bioconda 3 | - conda-forge 4 | - defaults 5 | dependencies: 6 | - fastp ==0.20.0 7 | -------------------------------------------------------------------------------- /testData/wrappers_storage/bio/fastqc/environment.yaml: -------------------------------------------------------------------------------- 1 | channels: 2 | - bioconda 3 | - conda-forge 4 | - defaults 5 | dependencies: 6 | - fastqc ==0.11.9 7 | -------------------------------------------------------------------------------- /testData/wrappers_storage/bio/last/lastal/environment.yaml: -------------------------------------------------------------------------------- 1 | channels: 2 | - bioconda 3 | - conda-forge 4 | - defaults 5 | dependencies: 6 | - last=874 7 | -------------------------------------------------------------------------------- /testData/wrappers_storage/bio/multiqc/environment.yaml: -------------------------------------------------------------------------------- 1 | channels: 2 | - bioconda 3 | - conda-forge 4 | - defaults 5 | dependencies: 6 | - multiqc ==1.9 7 | -------------------------------------------------------------------------------- /src/main/resources/inspectionDescriptions/SmkRedundantCommaInspection.html: -------------------------------------------------------------------------------- 1 | 2 | 3 | This inspection shows when comma is unnecessary 4 | 5 | -------------------------------------------------------------------------------- /testData/psi/WorkflowLocalrulesInvalid.smk: -------------------------------------------------------------------------------- 1 | localrules: 'foo1', foo2 2 | 3 | localrules: foo3 foo4 4 | 5 | localrules: 6 | foo5 7 | foo6 8 | 9 | localrules: foo7 -------------------------------------------------------------------------------- /testData/wrappers_storage/bio/gatk3/printreads/environment.yaml: -------------------------------------------------------------------------------- 1 | channels: 2 | - bioconda 3 | - conda-forge 4 | - defaults 5 | dependencies: 6 | - gatk ==3.8 7 | -------------------------------------------------------------------------------- /testData/wrappers_storage/bio/samtools/bam2fq/interleaved/environment.yaml: -------------------------------------------------------------------------------- 1 | channels: 2 | - conda-forge 3 | - bioconda 4 | dependencies: 5 | - samtools ==1.10 6 | -------------------------------------------------------------------------------- /testData/wrappers_storage/bio/vcftools/filter/meta.yaml: -------------------------------------------------------------------------------- 1 | name: vcftools filter 2 | description: Filter vcf files using vcftools 3 | authors: 4 | - Patrik Smeds 5 | -------------------------------------------------------------------------------- /.github/readme/JBResearch_SnakeCharm_Plugin_logo.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/JetBrains-Research/snakecharm/HEAD/.github/readme/JBResearch_SnakeCharm_Plugin_logo.png -------------------------------------------------------------------------------- /testData/wrappers_storage/bio/hisat2/index/environment.yaml: -------------------------------------------------------------------------------- 1 | channels: 2 | - bioconda 3 | - defaults 4 | dependencies: 5 | - hisat2 ==2.1.0 6 | - samtools ==1.9 7 | -------------------------------------------------------------------------------- /src/main/resources/inspectionDescriptions/SmkShadowMultipleSettingsInspection.html: -------------------------------------------------------------------------------- 1 | 2 | 3 | Only one argument is allowed in 'shadow' section 4 | 5 | -------------------------------------------------------------------------------- /testData/psi/FormattedStringArgument.smk: -------------------------------------------------------------------------------- 1 | rule NAME: 2 | shell: 3 | "multiline" 4 | f"{30 + 42}" 5 | "string" 6 | f"arg{25}" -------------------------------------------------------------------------------- /testData/psi/Module.smk: -------------------------------------------------------------------------------- 1 | module foo: 2 | snakefile: "myfile" 3 | config: config["something"] 4 | meta-wrapper: "some/wrapper/here" 5 | skip_validation: True 6 | -------------------------------------------------------------------------------- /testData/stringLanguagePsi/NoIdentifier.txt: -------------------------------------------------------------------------------- 1 | FILE 2 | PsiElement(LBRACE)('{') 3 | PsiErrorElement:Expected identifier name 4 | 5 | PsiElement(RBRACE)('}') -------------------------------------------------------------------------------- /testData/wrappers_storage/bio/vcftools/filter/environment.yaml: -------------------------------------------------------------------------------- 1 | channels: 2 | - bioconda 3 | - conda-forge 4 | - defaults 5 | dependencies: 6 | - vcftools ==0.1.16 7 | -------------------------------------------------------------------------------- /.github/readme/JBResearch_SnakeCharm_Plugin_white_logo.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/JetBrains-Research/snakecharm/HEAD/.github/readme/JBResearch_SnakeCharm_Plugin_white_logo.png -------------------------------------------------------------------------------- /testData/formatter/hardWrap20_NoWrap_after.smk: -------------------------------------------------------------------------------- 1 | rule r: 2 | input: 3 | "a","b","c","d","e","f","g","h","i","j","k","l","m","n","o","p","a","b","c","d","e","f","g","h" 4 | -------------------------------------------------------------------------------- /testData/wrappers_storage/bio/bcftools/reheader/meta.yaml: -------------------------------------------------------------------------------- 1 | name: bcftools reheader 2 | description: Change header or sample names of vcf/bcf file. 3 | authors: 4 | - Jan Forster 5 | -------------------------------------------------------------------------------- /testData/wrappers_storage/bio/bedtools/coveragebed/environment.yaml: -------------------------------------------------------------------------------- 1 | channels: 2 | - bioconda 3 | - conda-forge 4 | - defaults 5 | dependencies: 6 | - bedtools ==2.29.0 7 | -------------------------------------------------------------------------------- /testData/wrappers_storage/bio/picard/bedtointervallist/environment.yaml: -------------------------------------------------------------------------------- 1 | channels: 2 | - bioconda 3 | - conda-forge 4 | - defaults 5 | dependencies: 6 | - picard ==2.22.1 7 | -------------------------------------------------------------------------------- /src/main/resources/inspectionDescriptions/SmkDocstringsWillBeIgnoredInspection.html: -------------------------------------------------------------------------------- 1 | 2 | 3 | Snakemake will ignore all docstrings except the first one. 4 | 5 | -------------------------------------------------------------------------------- /src/main/resources/inspectionDescriptions/SmkSubworkflowRedeclarationInspection.html: -------------------------------------------------------------------------------- 1 | 2 | 3 | Only last subworkflow with the same name will be executed 4 | 5 | -------------------------------------------------------------------------------- /testData/formatter/hardWrap20.smk: -------------------------------------------------------------------------------- 1 | rule r: 2 | input: 3 | "a", "b", "c", "d", "e", "f", "g", "h", "i", "j", "k", "l", "m", "n", "o", "p", "a", "b", "c", "d", "e", "f", "g", "h" -------------------------------------------------------------------------------- /testData/wrappers_storage/bio/gatk/applybqsr/environment.yaml: -------------------------------------------------------------------------------- 1 | channels: 2 | - bioconda 3 | - conda-forge 4 | - defaults 5 | dependencies: 6 | - gatk4 ==4.1.4.1 7 | - openjdk =8 -------------------------------------------------------------------------------- /src/main/resources/inspectionDescriptions/SmkAvoidTabWhitespace.html: -------------------------------------------------------------------------------- 1 | 2 | 3 | Tab character detected. PEP-8 recommends to use spaces in Python like code. 4 | 5 | -------------------------------------------------------------------------------- /src/main/resources/inspectionDescriptions/SmkModuleRedeclarationInspection.html: -------------------------------------------------------------------------------- 1 | 2 | 3 | Only last module with the same name will be used 4 | 5 | -------------------------------------------------------------------------------- /src/main/resources/inspectionDescriptions/SmkShadowSettingsInspection.html: -------------------------------------------------------------------------------- 1 | 2 | 3 | This inspection tells if setting used in 'shadow' section isn't supported 4 | 5 | -------------------------------------------------------------------------------- /testData/formatter/hardWrap20_NoWrap.smk: -------------------------------------------------------------------------------- 1 | rule r: 2 | input: 3 | "a", "b", "c", "d", "e", "f", "g", "h", "i", "j", "k", "l", "m", "n", "o", "p", "a", "b", "c", "d", "e", "f", "g", "h" -------------------------------------------------------------------------------- /testData/wrappers_storage/bio/fastp/meta.yaml: -------------------------------------------------------------------------------- 1 | name: "fastp" 2 | description: trim and QC fastq reads with fastp 3 | authors: 4 | - Sebastian Kurscheid (sebastian.kurscheid@anu.edu.au) 5 | -------------------------------------------------------------------------------- /testData/wrappers_storage/bio/samtools/depth/meta.yaml: -------------------------------------------------------------------------------- 1 | name: samtools depth 2 | description: Compute the read depth at each position or region using samtools. 3 | authors: 4 | - Dayne Filer 5 | -------------------------------------------------------------------------------- /src/main/resources/inspectionDescriptions/SmkSectionRedeclarationInspection.html: -------------------------------------------------------------------------------- 1 | 2 | 3 | The first occurrence of a section overrides all its following occurrences. 4 | 5 | -------------------------------------------------------------------------------- /src/main/resources/inspectionDescriptions/SmkMinVersionWarningInspection.html: -------------------------------------------------------------------------------- 1 | 2 | 3 | Warns user if version set using min_version is higher than the one set in settings 4 | 5 | -------------------------------------------------------------------------------- /src/main/resources/inspectionDescriptions/SmkRuleRedeclarationInspection.html: -------------------------------------------------------------------------------- 1 | 2 | 3 | If there are multiple rule declarations with the same name, code fails at runtime. 4 | 5 | -------------------------------------------------------------------------------- /src/main/resources/inspectionDescriptions/SmkTemplateEngineSettingsInspection.html: -------------------------------------------------------------------------------- 1 | 2 | 3 | This inspection tells if an option used in 'template_engine' section isn't supported 4 | 5 | -------------------------------------------------------------------------------- /testData/psi/RuleParamsListArgsMultiple.smk: -------------------------------------------------------------------------------- 1 | rule samtools_sort: 2 | input: 3 | "foo1", 4 | "foo2" 5 | output: "boo1", "boo2" 6 | output: "doo1", 7 | "doo2" 8 | output: "zzzzzz" -------------------------------------------------------------------------------- /testData/stringLanguagePsi/LbraceIdentifier.txt: -------------------------------------------------------------------------------- 1 | FILE 2 | PsiElement(LBRACE)('{') 3 | SmkSLReferenceExpressionImpl: foo 4 | PsiElement(Py:IDENTIFIER)('foo') 5 | PsiErrorElement:Expected '}' 6 | -------------------------------------------------------------------------------- /src/main/resources/inspectionDescriptions/SmkSectionUnspecifiedFieldArgsInspection.html: -------------------------------------------------------------------------------- 1 | 2 | 3 | Warn if rule/checkpoint/subworkflow object used as argument instead of one of its fields. 4 | 5 | -------------------------------------------------------------------------------- /src/main/resources/inspectionDescriptions/SmkCondaSectionNotAllowedWithRun.html: -------------------------------------------------------------------------------- 1 | 2 | 3 | Conda environments are only allowed with shell, script, notebook, or wrapper directives (not with run). 4 | 5 | -------------------------------------------------------------------------------- /testData/psi/KeywordIdentifierWithNoIndent.smk: -------------------------------------------------------------------------------- 1 | checkpoint NAME: 2 | input: "text" 3 | 4 | def foo(rule): 5 | pass 6 | 7 | if True: 8 | foo( 9 | rule = 1 10 | 11 | rule boo: 12 | input: foo( 13 | rule -------------------------------------------------------------------------------- /testData/wrappers_storage/bio/bismark/bismark/environment.yaml: -------------------------------------------------------------------------------- 1 | channels: 2 | - bioconda 3 | - conda-forge 4 | - defaults 5 | dependencies: 6 | - bowtie2 == 2.3.4.3 7 | - bismark == 0.22.1 8 | - samtools == 1.9 9 | -------------------------------------------------------------------------------- /testData/wrappers_storage/bio/bwa/mem-samblaster/environment.yaml: -------------------------------------------------------------------------------- 1 | channels: 2 | - conda-forge 3 | - bioconda 4 | - nodefaults 5 | dependencies: 6 | - bwa =0.7.18 7 | - sambamba =1.0.1 8 | - samblaster =0.1.26 9 | -------------------------------------------------------------------------------- /testData/wrappers_storage/bio/bedtools/coveragebed/meta.yaml: -------------------------------------------------------------------------------- 1 | name: "coverageBed" 2 | description: 3 | Returns the depth and breadth of coverage of features from B 4 | on the intervals in A. 5 | authors: 6 | - Patrik Smeds 7 | -------------------------------------------------------------------------------- /testData/wrappers_storage/bio/bismark/bismark2report/environment.yaml: -------------------------------------------------------------------------------- 1 | channels: 2 | - bioconda 3 | - conda-forge 4 | - defaults 5 | dependencies: 6 | - bowtie2 == 2.3.4.3 7 | - bismark == 0.22.1 8 | - samtools == 1.9 9 | -------------------------------------------------------------------------------- /testData/wrappers_storage/bio/bwa/mem-samblaster/meta.yaml: -------------------------------------------------------------------------------- 1 | name: "bwa mem samblaster" 2 | description: Map reads using bwa mem, mark duplicates by samblaster and sort and index by sambamba. 3 | authors: 4 | - Christopher Schröder -------------------------------------------------------------------------------- /testData/wrappers_storage2/bio/bismark/custom_wr1/environment.yaml: -------------------------------------------------------------------------------- 1 | channels: 2 | - bioconda 3 | - conda-forge 4 | - defaults 5 | dependencies: 6 | - bowtie2 == 2.3.4.3 7 | - bismark == 0.22.1 8 | - samtools == 1.9 9 | -------------------------------------------------------------------------------- /src/main/resources/inspectionDescriptions/SmkFileEndsWithCommentInspection.html: -------------------------------------------------------------------------------- 1 | 2 | 3 | Snakemake treats a comment in the end of a file as a syntax error. Please add a whitespace after the comment. 4 | 5 | -------------------------------------------------------------------------------- /testData/psi/UnexpectedSectionKeyword.smk: -------------------------------------------------------------------------------- 1 | rule: 2 | booo: '' 3 | 4 | checkpoint aaa: 5 | booo: '' 6 | 7 | rule all: 8 | input: '' 9 | 10 | subworkflow foo: 11 | booo: '' 12 | 13 | booo: '' 14 | configfile: '' -------------------------------------------------------------------------------- /testData/psi/WorkflowParamsListArgsKeywordsInRule.smk: -------------------------------------------------------------------------------- 1 | rule: 2 | output: report("report/workflow.rst") 3 | wildcard_constraints: 4 | dataset="\d+" 5 | singularity: 6 | "docker://continuumio/miniconda3:4.4.10" -------------------------------------------------------------------------------- /src/main/resources/inspectionDescriptions/SmkSectionDuplicatedArgsInspection.html: -------------------------------------------------------------------------------- 1 | 2 | 3 | Duplicated arguments may be misspelling in input/output/params/resources/ 4 | log/wildcard_constraints sections. 5 | 6 | -------------------------------------------------------------------------------- /src/main/resources/inspectionDescriptions/SmkSubscriptionIndexOutOfBoundsInspection.html: -------------------------------------------------------------------------------- 1 | 2 | 3 | This inspection warns about access to a section argument by an index, which exceeds section argument number. 4 | 5 | -------------------------------------------------------------------------------- /src/main/resources/inspectionDescriptions/SmkLocalrulesRuleorderRepeatedRuleInspection.html: -------------------------------------------------------------------------------- 1 | 2 | 3 | This inspection checks whether a rule name inside localrules/ruleorder section has been used more than once. 4 | 5 | -------------------------------------------------------------------------------- /src/main/resources/inspectionDescriptions/SmkSLSubscriptionIndexOutOfBoundsInspection.html: -------------------------------------------------------------------------------- 1 | 2 | 3 | This inspection warns about access to a section argument by an index, which exceeds section argument number. 4 | 5 | -------------------------------------------------------------------------------- /testData/stringLanguagePsi/LbraceAndComma.txt: -------------------------------------------------------------------------------- 1 | FILE 2 | PsiElement(LBRACE)('{') 3 | PsiErrorElement:Expected identifier name 4 | 5 | PsiElement(COMMA)(',') 6 | PsiErrorElement:Expected regular expression 7 | -------------------------------------------------------------------------------- /testData/wrappers_storage/bio/bcftools/call/meta.yaml: -------------------------------------------------------------------------------- 1 | name: bcftools call 2 | description: Call variants with `bcftools call `_. 3 | authors: 4 | - Johannes Köster 5 | - Michael Hall 6 | -------------------------------------------------------------------------------- /src/main/resources/inspectionDescriptions/SmkEnvmodulesNotAllowedSectionInspection.html: -------------------------------------------------------------------------------- 1 | 2 | 3 | The directive 'envmodules' is only allowed with 'shell', 'script', 'notebook', or 'wrapper' directives (not with run). 4 | 5 | -------------------------------------------------------------------------------- /testData/MockPackages3_smk_9.3.0/snakemake/ioutils/collect.py: -------------------------------------------------------------------------------- 1 | import snakemake.io 2 | 3 | 4 | # Alias for expand that provides a more intuitive name for the use case of 5 | # collecting files from previous jobs. 6 | collect = snakemake.io.expand 7 | -------------------------------------------------------------------------------- /testData/psi/SingleSubworkflow.smk: -------------------------------------------------------------------------------- 1 | subworkflow otherworkflow: 2 | workdir: 3 | "../path/to/otherworkflow" 4 | snakefile: 5 | "../path/to/otherworkflow/Snakefile" 6 | configfile: 7 | "path/to/custom_configfile.yaml" -------------------------------------------------------------------------------- /src/main/kotlin/com/jetbrains/snakecharm/stringLanguage/lang/psi/SmkSLExpression.kt: -------------------------------------------------------------------------------- 1 | package com.jetbrains.snakecharm.stringLanguage.lang.psi 2 | 3 | import com.jetbrains.python.psi.PyExpression 4 | 5 | interface SmkSLExpression: PyExpression, SmkSLElement -------------------------------------------------------------------------------- /src/main/resources/inspectionDescriptions/SmkMultilineFunctionCallInspection.html: -------------------------------------------------------------------------------- 1 | 2 | 3 | Checks whether there are function call which spans over multiple lines but starts at the same line as section. 4 | 5 | -------------------------------------------------------------------------------- /src/main/resources/inspectionDescriptions/SmkNotSameWildcardsSetInspection.html: -------------------------------------------------------------------------------- 1 | 2 | 3 | This inspection checks if wildcards sets in 'output', 'log' and 'benchmark' sections 4 | are equal as it is required by snakemake. 5 | 6 | -------------------------------------------------------------------------------- /src/main/resources/inspectionDescriptions/SmkRuleOrCheckpointNameYetUndefinedInspection.html: -------------------------------------------------------------------------------- 1 | 2 | 3 | If there is a yet-undefined rule/checkpoint name after rules./checkpoints., snakemake will show and error at runtime 4 | 5 | -------------------------------------------------------------------------------- /src/main/resources/inspectionDescriptions/SmkWildcardNotDefinedInspection.html: -------------------------------------------------------------------------------- 1 | 2 | 3 | This inspection checks if a wildcard was not defined. Snakemake requires all wildcards to be defined in output/log/benchmark sections. 4 | 5 | -------------------------------------------------------------------------------- /testData/psi/RuleParamsListArgsIncorrectRuleSectionLevelIndentation.smk: -------------------------------------------------------------------------------- 1 | rule foo: 2 | # comment 3 | input: 4 | "file.txt", 5 | # comment 6 | "txt" # incorrect rule section level indentation for an argument 7 | # comment 8 | -------------------------------------------------------------------------------- /src/main/kotlin/com/jetbrains/snakecharm/stringLanguage/lang/parser/SmkSLLexerAdapter.kt: -------------------------------------------------------------------------------- 1 | package com.jetbrains.snakecharm.stringLanguage.lang.parser 2 | 3 | import com.intellij.lexer.FlexAdapter 4 | 5 | class SmkSLLexerAdapter : FlexAdapter(_SmkSLLexer(null)) -------------------------------------------------------------------------------- /src/main/resources/inspectionDescriptions/SmkResourcesKeywordArgsInspection.html: -------------------------------------------------------------------------------- 1 | 2 | 3 | This inspection checks whether all 'resources' section arguments are keyword arguments (e.g. 'threads=4'), 4 | not positional arguments. 5 | 6 | -------------------------------------------------------------------------------- /src/main/resources/inspectionDescriptions/SmkRuleSectionAfterExecutionInspection.html: -------------------------------------------------------------------------------- 1 | 2 | 3 | Rule sections such as input/output/params/..., cannot be used after run/shell/script/wrapper/cwl/notebook/template_engine sections. 4 | 5 | -------------------------------------------------------------------------------- /testData/psi/RuleParamsListKeywordArgsMultiple.smk: -------------------------------------------------------------------------------- 1 | rule samtools_sort: 2 | input: 3 | int1="i1.bam", 4 | int2="i2.bam" 5 | output: 6 | out1="out1.bam", out2="out2.bam" 7 | output: out1="out1.bam", 8 | out2="out2.bam" -------------------------------------------------------------------------------- /testData/psi/WorkflowLocalrules.smk: -------------------------------------------------------------------------------- 1 | localrules: foo0 2 | 3 | localrules: foo1, foo2 4 | 5 | localrules: 6 | rule1, boo, doo, 7 | soo, goo 8 | 9 | localrules: rule1, boo, doo, 10 | soo, goo 11 | 12 | def foo(): 13 | localrules: boo1, boo2 -------------------------------------------------------------------------------- /testData/psi/WorkflowRuleorderInvalid.smk: -------------------------------------------------------------------------------- 1 | ruleorder: 'rule1' > rule2 > rule3 2 | 3 | ruleorder: rule4, rule5 4 | 5 | ruleorder: rule6 > 'rule7' 6 | 7 | ruleorder: rule8 rule9 8 | 9 | ruleorder: 10 | rule10 11 | rule11 12 | 13 | ruleorder: rule12 -------------------------------------------------------------------------------- /src/main/resources/inspectionDescriptions/SmkSLUndeclaredSectionInspection.html: -------------------------------------------------------------------------------- 1 | 2 | 3 | This inspection warns if used section isn't declared in rule. It is likely you are using a wrong section, or you have forgotten to define it. 4 | 5 | -------------------------------------------------------------------------------- /src/main/resources/inspectionDescriptions/SmkUndeclaredSectionInspection.html: -------------------------------------------------------------------------------- 1 | 2 | 3 | This inspection warns if used section isn't declared in rule. It is likely you are using a wrong section, or you have forgotten to define it. 4 | 5 | -------------------------------------------------------------------------------- /testData/folding/workflowTopLevel.smk: -------------------------------------------------------------------------------- 1 | onstart: 2 | print() 3 | print() 4 | 5 | onerror: 6 | print() 7 | print() 8 | 9 | onsuccess: 10 | print() 11 | print() 12 | -------------------------------------------------------------------------------- /testData/psi/RuleParamsListArgsHangingComma.smk: -------------------------------------------------------------------------------- 1 | rule all: 2 | output: "aaa1", 3 | 4 | rule samtools_sort: 5 | output: "boo1", 6 | "boo2", 7 | input: 8 | "foo1", 9 | output: "zoo1", 10 | "zoo2", 11 | output: "foo3", -------------------------------------------------------------------------------- /testData/wrappers_storage/bio/multiqc/meta.yaml: -------------------------------------------------------------------------------- 1 | name: multiqc 2 | description: | 3 | Generate qc report using multiqc. 4 | authors: 5 | - Julian de Ruiter 6 | input: 7 | - input directory containing qc files 8 | output: 9 | - qc report (html) 10 | -------------------------------------------------------------------------------- /testData/folding/rule.smk: -------------------------------------------------------------------------------- 1 | rule foo: 2 | input: 3 | a = "aaa", 4 | b = "bbb" 5 | output: "ooo" 6 | params: c = "ccc" 7 | run: 8 | print() 9 | print() 10 | print() 11 | -------------------------------------------------------------------------------- /testData/formatter/hardWrap20_after.smk: -------------------------------------------------------------------------------- 1 | rule r: 2 | input: 3 | "a","b","c", 4 | "d","e","f", 5 | "g","h","i", 6 | "j","k","l", 7 | "m","n","o", 8 | "p","a","b", 9 | "c","d","e", 10 | "f","g","h" 11 | -------------------------------------------------------------------------------- /testData/psi/Issue202.smk: -------------------------------------------------------------------------------- 1 | configfile: "config.yaml" 2 | 3 | # config['FQ_RELATIVE_PATHS'] = collect_relative_paths( 4 | "" 5 | ) 6 | 7 | include: "rules/raw_qc.smk" 8 | include: "rules/bismark_align.smk" 9 | 10 | rule all: 11 | input: 12 | "ddd" 13 | -------------------------------------------------------------------------------- /testData/stringLanguagePsi/BracesAndComma.txt: -------------------------------------------------------------------------------- 1 | FILE 2 | PsiElement(LBRACE)('{') 3 | PsiErrorElement:Expected identifier name 4 | 5 | PsiElement(COMMA)(',') 6 | PsiErrorElement:Expected regular expression 7 | 8 | PsiElement(RBRACE)('}') -------------------------------------------------------------------------------- /src/main/resources/inspectionDescriptions/SmkExecutionSubsectionInUseSectionInspection.html: -------------------------------------------------------------------------------- 1 | 2 | 3 | This inspection highlights the sections which can't be overridden in 'use rule' ('shell', 'script', 4 | 'notebook', 'cwl' and 'run' sections). 5 | 6 | -------------------------------------------------------------------------------- /src/main/resources/inspectionDescriptions/SmkLocalrulesRuleorderConfusingReferenceInspection.html: -------------------------------------------------------------------------------- 1 | 2 | 3 | Localrules or ruleorder section may include rules which are not defined in the same file, but it looks confusing, likely copy-paste error. 4 | 5 | -------------------------------------------------------------------------------- /src/main/resources/inspectionDescriptions/SmkSectionMultipleArgsInspection.html: -------------------------------------------------------------------------------- 1 | 2 | 3 | Ony one argument is allowed in subworkflow/shell/wrapper/script/cwl/conda/ 4 | singularity/priority/version/group/message/benchmark/threads/shadow sections. 5 | 6 | -------------------------------------------------------------------------------- /testData/formatter/aroundRuleLikeSections.smk: -------------------------------------------------------------------------------- 1 | rule r1: 2 | input: "1" 3 | rule r2: 4 | input: "1" 5 | checkpoint c1: 6 | input: "1" 7 | checkpoint c2: 8 | input: "1" 9 | subworkflow s1: 10 | configfile: "1" 11 | subworkflow s2: 12 | configfile: "2" -------------------------------------------------------------------------------- /testData/psi/RuleParamsListArgsStringMultiline.smk: -------------------------------------------------------------------------------- 1 | print( 2 | "{dataset}/inputfile" 3 | "fff" 4 | ) 5 | 6 | rule samtools_sort: 7 | input: 8 | "foo" 9 | "boo" 10 | 11 | rule samtools_sort: 12 | input: 13 | "foo" \ 14 | "boo" -------------------------------------------------------------------------------- /src/main/kotlin/com/jetbrains/snakecharm/stringLanguage/lang/psi/references/SmkSLBaseReference.kt: -------------------------------------------------------------------------------- 1 | package com.jetbrains.snakecharm.stringLanguage.lang.psi.references 2 | 3 | import com.intellij.psi.PsiPolyVariantReference 4 | 5 | interface SmkSLBaseReference: PsiPolyVariantReference -------------------------------------------------------------------------------- /src/main/resources/inspectionDescriptions/SmkLambdaRuleParamsInspection.html: -------------------------------------------------------------------------------- 1 | 2 | 3 | This inspection checks validity of lambda parameter names in a rule section 4 | (e.g. only 'wildcards' for 'input' section; see Snakemake documentation on rules). 5 | 6 | -------------------------------------------------------------------------------- /src/main/resources/inspectionDescriptions/SmkMisuseUsageIOFlagMethodsInspection.html: -------------------------------------------------------------------------------- 1 | 2 | 3 | Input/Output flags (e.g. ancient(..), protected(..), directory(..), etc) not supported by all rule sections. This inspection warns about such flags misuse. 4 | 5 | -------------------------------------------------------------------------------- /testData/folding/checkpoint.smk: -------------------------------------------------------------------------------- 1 | checkpoint foo: 2 | input: 3 | a = "aaa", 4 | b = "bbb" 5 | output: "ooo" 6 | params: c = "ccc" 7 | run: 8 | print() 9 | print() 10 | print() 11 | -------------------------------------------------------------------------------- /testData/wrappers_storage/bio/bwa/mem/environment.yaml: -------------------------------------------------------------------------------- 1 | channels: 2 | - conda-forge 3 | - bioconda 4 | - nodefaults 5 | dependencies: 6 | - bwa =0.7.18 7 | - fgbio-minimal =2.3.0 8 | - samtools =1.21 9 | - picard-slim =3.2.0 10 | - snakemake-wrapper-utils =0.6.2 11 | -------------------------------------------------------------------------------- /testData/wrappers_storage/bio/samtools/sort/meta.yaml: -------------------------------------------------------------------------------- 1 | name: samtools sort 2 | description: Sort bam file with samtools. 3 | authors: 4 | - Johannes Köster 5 | notes: | 6 | * Samtools -@/--threads takes one integer as input. This is the number of additional threads and not raw threads. 7 | -------------------------------------------------------------------------------- /src/main/resources/inspectionDescriptions/SmkSectionMultilineStringArgsInspection.html: -------------------------------------------------------------------------------- 1 | 2 | 3 | Sections string arguments not separated by comma will be concatenated to a larger string at runtime. This isn't a bug, 4 | but maybe a comma separator is missing. 5 | 6 | -------------------------------------------------------------------------------- /testData/psi/EmptySections.smk: -------------------------------------------------------------------------------- 1 | rule RULE_NAME: # can be empty 2 | 3 | checkpoint CHECKPOINT_NAME: # can be empty 4 | 5 | use rule RULE_NAME as USE_RULE_NAME with: # can be empty 6 | 7 | subworkflow SUBWORKFLOW_NAME: # can't be empty 8 | 9 | module MODULE_NAME: # can't be empty 10 | -------------------------------------------------------------------------------- /CODE_OF_CONDUCT.md: -------------------------------------------------------------------------------- 1 | ## Code of Conduct 2 | 3 | This project and the corresponding community is governed by the [JetBrains Open Source and Community Code of Conduct](https://confluence.jetbrains.com/display/ALL/JetBrains+Open+Source+and+Community+Code+of+Conduct). Please make sure you read it. 4 | 5 | -------------------------------------------------------------------------------- /testData/psi/SingleQuotedDocstrings.smk: -------------------------------------------------------------------------------- 1 | rule NAME: 2 | "Docstring 1" 3 | input: "input.txt" 4 | 'Docstring 2' 5 | output: "output.txt" 6 | 7 | rule ANOTHER_NAME: 8 | "Docstring 1" 9 | input: 10 | "input.txt" 11 | 'Docstring 2' 12 | output: "output.txt" -------------------------------------------------------------------------------- /testData/wrappers_storage/bio/bismark/bismark_methylation_extractor/environment.yaml: -------------------------------------------------------------------------------- 1 | channels: 2 | - bioconda 3 | - conda-forge 4 | - defaults 5 | dependencies: 6 | - bowtie2 == 2.3.4.3 7 | - bismark == 0.22.1 8 | - samtools == 1.9 9 | - perl-gdgraph == 1.54 # for bismark plots module -------------------------------------------------------------------------------- /testData/wrappers_storage/bio/fastqc/meta.yaml: -------------------------------------------------------------------------------- 1 | name: fastqc 2 | description: | 3 | Generate fastq qc statistics using fastqc. 4 | authors: 5 | - Julian de Ruiter 6 | input: 7 | - fastq file 8 | output: 9 | - html file containing statistics 10 | - zip file containing statistics 11 | -------------------------------------------------------------------------------- /src/main/resources/inspectionDescriptions/SmkWrapperMissedArgumentsInspection.html: -------------------------------------------------------------------------------- 1 | 2 | 3 | Inspection warns about missing wrapper sections or section keyword arguments. Inspection cannot differ required and optional arguments, so it warns even if argument is optional. 4 | 5 | -------------------------------------------------------------------------------- /testData/stringLanguagePsi/FormatSpecifier.txt: -------------------------------------------------------------------------------- 1 | FILE 2 | PsiElement(LBRACE)('{') 3 | SmkSLElementImpl(FORMAT_SPECIFIER_EXPRESSION) 4 | SmkSLReferenceExpressionImpl: foo 5 | PsiElement(Py:IDENTIFIER)('foo') 6 | PsiElement(FORMAT_SPECIFIER)(':%Y-%m-%d %H:%M:%S') 7 | PsiElement(RBRACE)('}') -------------------------------------------------------------------------------- /testData/stringLanguagePsi/LbraceIdentifierDot.txt: -------------------------------------------------------------------------------- 1 | FILE 2 | PsiElement(LBRACE)('{') 3 | SmkSLReferenceExpressionImpl: null 4 | SmkSLReferenceExpressionImpl: foo 5 | PsiElement(Py:IDENTIFIER)('foo') 6 | PsiElement(DOT)('.') 7 | PsiErrorElement:Expected identifier name 8 | -------------------------------------------------------------------------------- /settings.gradle.kts: -------------------------------------------------------------------------------- 1 | //TODO: Uncomment to allow intellij gradle plugin unpublished versions: 2 | //pluginManagement { 3 | // repositories { 4 | // maven("https://oss.sonatype.org/content/repositories/snapshots/") 5 | // gradlePluginPortal() 6 | // } 7 | //} 8 | rootProject.name = "snakecharm" -------------------------------------------------------------------------------- /src/main/resources/inspectionDescriptions/SmkUnusedLogFileInspection.html: -------------------------------------------------------------------------------- 1 | 2 | This inspection highlights a 'log' section if it is not referenced from rule's 'shell'/'run' section and if the rule doesn't have 'notebook' / 'script' / 'wrapper' / 'cwl' sections. 3 | 4 | -------------------------------------------------------------------------------- /testData/folding/pythonBlocks.smk: -------------------------------------------------------------------------------- 1 | if True: 2 | pass 3 | pass 4 | elif True: 5 | pass 6 | pass 7 | else: 8 | pass 9 | pass 10 | 11 | def foo(): 12 | print() 13 | print() 14 | -------------------------------------------------------------------------------- /testData/psi/Issue130.smk: -------------------------------------------------------------------------------- 1 | with open("") as f: 2 | pass 3 | 4 | rule r1: input: "i1" 5 | 6 | while True: 7 | pass 8 | 9 | rule r2: input: "i2" 10 | 11 | for i in range(5): 12 | pass 13 | 14 | rule r3: input: "i3" 15 | 16 | for i in range(5): 17 | pass 18 | 19 | workdir: "foo" 20 | -------------------------------------------------------------------------------- /testData/psi/RuleRunPythonBlock.smk: -------------------------------------------------------------------------------- 1 | rule compose_merge: 2 | run: 3 | with open(output.txt, 'w') as out: 4 | foo(*input, sep="\n", file=out) 5 | value = 2 + 3 6 | foo("foo", str(value)) 7 | foo("foo" 8 | "dooo", 9 | "sss") 10 | -------------------------------------------------------------------------------- /testData/psi/RuleMultilineStringArgumentsWithCallsAndExplicitConcatenation.smk: -------------------------------------------------------------------------------- 1 | rule NAME: 2 | shell: 3 | "mkdir -p" + 4 | "multiline " 5 | "string" 6 | .join(['a', 'b', 'c']) 7 | + "string".join([]) + "text" 8 | "newline" -------------------------------------------------------------------------------- /gradle/wrapper/gradle-wrapper.properties: -------------------------------------------------------------------------------- 1 | distributionBase=GRADLE_USER_HOME 2 | distributionPath=wrapper/dists 3 | distributionUrl=https\://services.gradle.org/distributions/gradle-8.13-bin.zip 4 | networkTimeout=10000 5 | validateDistributionUrl=true 6 | zipStoreBase=GRADLE_USER_HOME 7 | zipStorePath=wrapper/dists 8 | -------------------------------------------------------------------------------- /testData/formatter/aroundRuleLikeSections_after.smk: -------------------------------------------------------------------------------- 1 | rule r1: 2 | input: "1" 3 | 4 | rule r2: 5 | input: "1" 6 | 7 | checkpoint c1: 8 | input: "1" 9 | 10 | checkpoint c2: 11 | input: "1" 12 | 13 | subworkflow s1: 14 | configfile: "1" 15 | 16 | subworkflow s2: 17 | configfile: "2" 18 | -------------------------------------------------------------------------------- /src/main/kotlin/com/jetbrains/snakecharm/stringLanguage/lang/psi/SmkSLSubscriptionIndexKeyExpression.kt: -------------------------------------------------------------------------------- 1 | package com.jetbrains.snakecharm.stringLanguage.lang.psi 2 | 3 | import com.jetbrains.python.psi.PyReferenceExpression 4 | 5 | interface SmkSLSubscriptionIndexKeyExpression : SmkSLReferenceExpression, PyReferenceExpression -------------------------------------------------------------------------------- /testData/psi/KeywordLikeIdentifiersAsKeywords.smk: -------------------------------------------------------------------------------- 1 | if True: 2 | configfile: "ss1" 3 | elif True: 4 | configfile: "ss2" 5 | else: 6 | configfile: "ss3" 7 | 8 | try: 9 | configfile: "ss4" 10 | except: 11 | configfile: "ss5" 12 | 13 | def foo(): 14 | rule boo: 15 | input: "in" 16 | 17 | -------------------------------------------------------------------------------- /src/main/resources/inspectionDescriptions/SmkSLQuotingMisuseInGetAccessorInspection.html: -------------------------------------------------------------------------------- 1 | 2 | 3 | This inspection warns if key is quoted by a mistake when is used snakemake string language. E.g. "/folder/{config['sample']}.fq" instead of "/folder/{config[sample]}.fq". 4 | 5 | -------------------------------------------------------------------------------- /testData/psi/UseIncomplete.smk: -------------------------------------------------------------------------------- 1 | use 2 | use rule 3 | use rule a 4 | use rule b from 5 | use rule f from module as module_name2 with 6 | use rule NAME as name_2 7 | input: "data_file.txt" 8 | use rule NAME as : 9 | input: "data_file.txt" 10 | use rule from M with: 11 | use rule with: 12 | output: "myfile3" 13 | -------------------------------------------------------------------------------- /src/main/resources/inspectionDescriptions/SmkWildcardInNotOverriddenSectionInspection.html: -------------------------------------------------------------------------------- 1 | 2 | 3 | This inspection detects a sections, which were inherited, but weren't overridden and contain 4 | wildcards, which no longer exist (e.g. because sections, which defined the wildcard were overridden). 5 | 6 | -------------------------------------------------------------------------------- /testData/inspections/SnakemakeRuleKeywordsAfterExecutionInspection/paramsKeywordAfterRun.smk: -------------------------------------------------------------------------------- 1 | rule name: 2 | input: 3 | "inputfile.txt" 4 | output: 5 | "outputfile.txt" 6 | run: 7 | print('string') 8 | params: mem_mb=100 9 | -------------------------------------------------------------------------------- /src/main/resources/com/jetbrains/snakecharm/lang/formatter/blank_lines_settings.smk: -------------------------------------------------------------------------------- 1 | a = 2 2 | b = 3 3 | 4 | configfile: "dd" 5 | rule name1: 6 | input: "in1" 7 | rule name2: 8 | input: "in2" 9 | 10 | 11 | 12 | 13 | 14 | 15 | 16 | # 7 blank lines are before this rule 17 | checkpoint name3: 18 | input: "in3" 19 | -------------------------------------------------------------------------------- /testData/wrappers_storage/bio/samtools/bam2fq/interleaved/meta.yaml: -------------------------------------------------------------------------------- 1 | name: samtools bam2fq interleaved 2 | description: 3 | Convert a bam file back to unaligned reads in a single fastq file with 4 | samtools. For paired end reads, this results in an unsorted interleaved file. 5 | authors: 6 | - David Laehnemann 7 | - Victoria Sack 8 | -------------------------------------------------------------------------------- /src/main/kotlin/com/jetbrains/snakecharm/stringLanguage/lang/psi/SmkSLElementType.kt: -------------------------------------------------------------------------------- 1 | package com.jetbrains.snakecharm.stringLanguage.lang.psi 2 | 3 | import com.intellij.psi.tree.IElementType 4 | import com.jetbrains.snakecharm.stringLanguage.SmkSLanguage 5 | 6 | class SmkSLElementType(debugName: String) : IElementType(debugName, SmkSLanguage) -------------------------------------------------------------------------------- /testData/psi/KeywordIdentifiersAtToplevelWithPrecedingOpenBrace.smk: -------------------------------------------------------------------------------- 1 | rule foo1: 2 | run: 3 | rule = 1 4 | checkpoint = 2 5 | print(rule, 6 | checkpoint 7 | 8 | rule foo2: 9 | run: 10 | rule = 1 11 | checkpoint = 2 12 | print(rule 13 | checkpoint: 14 | output: touch("output.txt") -------------------------------------------------------------------------------- /testData/wrappers_storage2/bio/bismark/custom_wr1/meta.yaml: -------------------------------------------------------------------------------- 1 | name: custom_wr1 2 | description: | 3 | Desc 4 | authors: 5 | - Author Name Surname 6 | input: 7 | - custom_1: Custome 1 8 | - custom_2: Custome 2 9 | 10 | params: 11 | - custom_params_1: Params 1 12 | 13 | output: 14 | - output1: Output 1 15 | - output2: Output 2 -------------------------------------------------------------------------------- /src/main/kotlin/com/jetbrains/snakecharm/spellchecker/SmkBundledDictionaryProvider.kt: -------------------------------------------------------------------------------- 1 | package com.jetbrains.snakecharm.spellchecker 2 | 3 | import com.intellij.spellchecker.BundledDictionaryProvider 4 | 5 | class SmkBundledDictionaryProvider : BundledDictionaryProvider { 6 | override fun getBundledDictionaries() = arrayOf("snakemake.dic") 7 | } -------------------------------------------------------------------------------- /src/main/resources/inspectionDescriptions/SmkSLMissingWildcardsAccessorPrefixInspection.html: -------------------------------------------------------------------------------- 1 | 2 | 3 | This inspection warns if wildcard name is accessed without 'wildcards.' prefix. Some sections (e.g. shell, message, etc) 4 | requires such prefix, although some other sections (e.g. input, params) doesn't require it. 5 | 6 | -------------------------------------------------------------------------------- /src/main/resources/com/jetbrains/snakecharm/spellchecker/snakemake.dic: -------------------------------------------------------------------------------- 1 | localrules 2 | ruleorder 3 | checkpoint 4 | configfile 5 | pepfile 6 | pepschema 7 | workdir 8 | wildcard_constraints 9 | singularity 10 | onsuccess 11 | onerror 12 | onstart 13 | subworkflow 14 | snakefile 15 | conda 16 | cwl 17 | snakemake 18 | snakefile 19 | envmodules 20 | envvars -------------------------------------------------------------------------------- /testData/psi/RuleParamsListArgsIndents.smk: -------------------------------------------------------------------------------- 1 | rule samtools_sort: 2 | output: "zoo1", 3 | "zoo2", 4 | "zoo3", 5 | "zoo4", 6 | "zoo5", 7 | "zoo6", 8 | "zoo7" 9 | 10 | input: "foo1", 11 | "foo2", 12 | "foo3" 13 | 14 | input: "boo1", 15 | "boo2", 16 | "boo3" -------------------------------------------------------------------------------- /testData/psi/WorkflowRuleorder.smk: -------------------------------------------------------------------------------- 1 | ruleorder: rule1 2 | 3 | ruleorder: rule1 > rule2 > rule3 4 | 5 | ruleorder: 6 | rule1 > rule2 > doo > 7 | roo > ho 8 | 9 | ruleorder: rule1 > rule2 > doo > 10 | roo > ho 11 | 12 | ruleorder: 13 | rule1 > rule2 14 | > rule3 > rule4 15 | 16 | def foo(): 17 | ruleorder: tex2pdf_with_bib > tex2pdf_without_bib 18 | -------------------------------------------------------------------------------- /src/main/resources/inspectionDescriptions/SmkSectionUnexpectedKeywordArgsInspection.html: -------------------------------------------------------------------------------- 1 | 2 | 3 | Following sections do not expect keyword arguments: benchmark, cache, conda, container, cwl, group, message, notebook, 4 | priority, script, shadow, shell, singularity, threads, version, wrapper, workdir, snakefile, configfile, pepfile, 5 | pepschema. 6 | 7 | -------------------------------------------------------------------------------- /testData/stringLanguagePsi/LbraceIncompleteSubscription1.txt: -------------------------------------------------------------------------------- 1 | FILE 2 | PsiElement(LBRACE)('{') 3 | SmkSLSubscriptionExpressionImpl(SUBSCRIPTION_EXPRESSION) 4 | SmkSLReferenceExpressionImpl: foo 5 | PsiElement(Py:IDENTIFIER)('foo') 6 | PsiElement(LBRACKET)('[') 7 | SmkSLSubscriptionKeyExpression: [null] 8 | PsiErrorElement:Expected key 9 | -------------------------------------------------------------------------------- /src/main/kotlin/com/jetbrains/snakecharm/SnakemakeIcons.kt: -------------------------------------------------------------------------------- 1 | package com.jetbrains.snakecharm 2 | 3 | import com.intellij.openapi.util.IconLoader 4 | 5 | /** 6 | * @author Roman.Chernyatchik 7 | * @date 2018-12-30 8 | */ 9 | object SnakemakeIcons { 10 | val FILE = IconLoader.getIcon("/icons/snakeCharm_fileType.svg", SnakemakeIcons::class.java) 11 | val FACET = FILE 12 | } -------------------------------------------------------------------------------- /testData/psi/WorkflowParamsListArgsKeywords.smk: -------------------------------------------------------------------------------- 1 | configfile: "config.yaml" 2 | report: "report/workflow.rst" 3 | singularity: "docker://continuumio/miniconda3:4.4.10" 4 | include: 5 | 'tex.smrules' 6 | workdir: "path/to/workdir" 7 | wildcard_constraints: 8 | dataset="\d+" 9 | 10 | def foo(): 11 | configfile: "config.yaml" 12 | include: "path/to/other.snakefile" 13 | -------------------------------------------------------------------------------- /testData/psi/WorkflowUnknownSections.smk: -------------------------------------------------------------------------------- 1 | unknownSection1: "Unknown_section1" 2 | 3 | unknownSection2: 4 | "Unknown_section2" 5 | 6 | unknownSection3: 7 | foo=".*", 8 | boo=".*" 9 | 10 | variable1: int = 5 11 | 12 | variable2: string = "variable2" 13 | 14 | variable3: int 15 | 16 | def foo(a: int): 17 | return a 18 | 19 | incorrectVariable: 20 | int -------------------------------------------------------------------------------- /src/main/kotlin/com/jetbrains/snakecharm/stringLanguage/lang/psi/SmkSLElement.kt: -------------------------------------------------------------------------------- 1 | package com.jetbrains.snakecharm.stringLanguage.lang.psi 2 | 3 | import com.intellij.lang.injection.InjectedLanguageManager 4 | import com.intellij.psi.PsiElement 5 | 6 | interface SmkSLElement: PsiElement { 7 | fun injectionHost() = InjectedLanguageManager.getInstance(project).getInjectionHost(this) 8 | } 9 | -------------------------------------------------------------------------------- /src/main/java/com/jetbrains/snakecharm/SnakemakePluginListener.java: -------------------------------------------------------------------------------- 1 | package com.jetbrains.snakecharm; 2 | 3 | import com.intellij.ide.plugins.DynamicPluginListener; 4 | 5 | /** 6 | * Read about dynamic plugins: ... 7 | */ 8 | public class SnakemakePluginListener implements DynamicPluginListener { 9 | } 10 | -------------------------------------------------------------------------------- /testData/psi/KeywordLikeIdentifiersAsIdentifiers.smk: -------------------------------------------------------------------------------- 1 | import rule 2 | import subworkflow 3 | import workdir, wildcard_constraints 4 | from snakemake.utils import report 5 | 6 | print(rule) 7 | 8 | rule foo: run: 9 | rule = 1 10 | checkpoint = 1 11 | configfile = 2 12 | report = 3 13 | wildcard_constraints = 4 14 | print(rule, 15 | checkpoint) 16 | 17 | print(singularity) -------------------------------------------------------------------------------- /testData/folding/pythonComments.smk: -------------------------------------------------------------------------------- 1 | # the first line in comment 2 | # the second line 3 | # the third line 4 | print("") 5 | # multiline comment starts here 6 | # line in comment 7 | # line in comment 8 | # multiline comment ends here 9 | print("") 10 | 11 | # one more comment 12 | # 13 | # one more comment 14 | # 15 | # -------------------------------------------------------------------------------- /testData/psi/Issue313_1.smk: -------------------------------------------------------------------------------- 1 | rule rule_313: 2 | output: "dd" 3 | 4 | # noinspection SmkRuleRedeclaration 5 | rule rule_313: 6 | output: "dd" 7 | # noinspection SmkSectionMultilineStringArgs 8 | input: 9 | "iiii" 10 | "iiii" 11 | 12 | # XXX: suppressed here !!!!! 13 | # noinspection SmkSectionMultilineStringArgs 14 | log: 15 | "lllll" 16 | "lllll" -------------------------------------------------------------------------------- /src/main/kotlin/com/jetbrains/snakecharm/codeInsight/completion/SmkCompletionContributorPattern.kt: -------------------------------------------------------------------------------- 1 | package com.jetbrains.snakecharm.codeInsight.completion 2 | 3 | import com.intellij.patterns.PlatformPatterns 4 | import com.jetbrains.snakecharm.lang.SnakemakeLanguageDialect 5 | 6 | object SmkCompletionContributorPattern { 7 | val IN_SNAKEMAKE = PlatformPatterns.psiFile().withLanguage(SnakemakeLanguageDialect) 8 | } -------------------------------------------------------------------------------- /src/main/kotlin/com/jetbrains/snakecharm/stringLanguage/lang/psi/SmkSLElementImpl.kt: -------------------------------------------------------------------------------- 1 | package com.jetbrains.snakecharm.stringLanguage.lang.psi 2 | 3 | import com.intellij.lang.ASTNode 4 | import com.jetbrains.python.psi.impl.PyElementImpl 5 | 6 | open class SmkSLElementImpl(node: ASTNode) : PyElementImpl(node), SmkSLElement { 7 | override fun toString() = "${this::class.java.simpleName}(${node.elementType})" 8 | } -------------------------------------------------------------------------------- /src/main/resources/inspectionDescriptions/SmkSeveralRulesAreOverriddenAsOneInspection.html: -------------------------------------------------------------------------------- 1 | 2 | 3 | This inspections warns if several inherited rules were overridden as one, so when the new name doesn't contain '*' pattern. 4 | If 'use rule' section declares inherited rules in the list, runtime exception will be produced. 5 | Otherwise, only the last inherited rule will be overridden. 6 | 7 | -------------------------------------------------------------------------------- /testData/psi/Checkpoint.smk: -------------------------------------------------------------------------------- 1 | # the checkpoint that shall trigger re-evaluation of the DAG 2 | checkpoint somestep: 3 | input: 4 | "samples/{sample}.txt" 5 | output: 6 | "somestep/{sample}.txt" 7 | shell: 8 | # simulate some output vale 9 | "echo {wildcards.sample} > somestep/{wildcards.sample}.txt" 10 | 11 | checkpoint somestep2: 12 | run: 13 | foo() 14 | -------------------------------------------------------------------------------- /testData/stringLanguagePsi/LbraceIncompleteSubscription2.txt: -------------------------------------------------------------------------------- 1 | FILE 2 | PsiElement(LBRACE)('{') 3 | SmkSLSubscriptionExpressionImpl(SUBSCRIPTION_EXPRESSION) 4 | SmkSLReferenceExpressionImpl: foo 5 | PsiElement(Py:IDENTIFIER)('foo') 6 | PsiElement(LBRACKET)('[') 7 | SmkSLSubscriptionKeyExpression: [0] 8 | PsiElement(ACCESS_KEY)('0') 9 | PsiErrorElement:Expected ']' 10 | -------------------------------------------------------------------------------- /testData/wrappers_storage/bio/hisat2/index/meta.yaml: -------------------------------------------------------------------------------- 1 | name: hisat2 index 2 | authors: 3 | - Joël Simoneau 4 | description: | 5 | Create index with hisat2. 6 | input: 7 | - sequence: list of FASTA files of list of sequences 8 | output: 9 | - Directory of the hisat2 custom index. 10 | params: 11 | - prefix: prefix of index file path (required). Must be related to output 12 | - extra: additional parameters 13 | -------------------------------------------------------------------------------- /src/main/kotlin/com/jetbrains/snakecharm/lang/SmkFileElementType.kt: -------------------------------------------------------------------------------- 1 | package com.jetbrains.snakecharm.lang 2 | 3 | import com.intellij.lang.Language 4 | import com.jetbrains.python.psi.PyFileElementType 5 | 6 | /** 7 | * @author Roman.Chernyatchik 8 | * @date 2018-12-31 9 | */ 10 | class SmkFileElementType(language: Language) : PyFileElementType(language) { 11 | override fun getExternalId() = "snakemake.FILE" 12 | } -------------------------------------------------------------------------------- /src/main/kotlin/com/jetbrains/snakecharm/lang/parser/SmkFunctionParsing.kt: -------------------------------------------------------------------------------- 1 | package com.jetbrains.snakecharm.lang.parser 2 | 3 | import com.jetbrains.python.parsing.FunctionParsing 4 | import com.jetbrains.snakecharm.lang.psi.elementTypes.SmkElementTypes 5 | 6 | class SmkFunctionParsing(context: SmkParserContext) : FunctionParsing(context) { 7 | override fun getReferenceType() = SmkElementTypes.SMK_PY_REFERENCE_EXPRESSION 8 | } -------------------------------------------------------------------------------- /testData/psi/RuleParamsListArgsIndentationInsideBraces.smk: -------------------------------------------------------------------------------- 1 | rule all: 2 | input: 3 | expand("plots/cycle-scores.{covariate}.pdf", 4 | covariate=cells.columns[1:]), 5 | expand(["tables/diffexp.{test}.tsv", 6 | "plots/diffexp.{test}.bcv.pdf", 7 | "plots/diffexp.{test}.md.pdf", 8 | "plots/diffexp.{test}.disp.pdf"], 9 | test=config["diffexp"]) -------------------------------------------------------------------------------- /testData/psi/WorkflowPythonCodeBlockKeywords.smk: -------------------------------------------------------------------------------- 1 | onstart: 2 | foo("Workflow started, no error") 3 | 4 | onsuccess: 5 | foo("Workflow finished, no error") 6 | 7 | onerror: 8 | foo("An error occurred") 9 | shell("mail -s \"an error occurred\" youremail@provider.com < {log}") 10 | 11 | onstart: foo("Workflow started, no error"); boo() 12 | 13 | 14 | def boo(): 15 | onsuccess: 16 | foo("AAAA") 17 | -------------------------------------------------------------------------------- /src/test/kotlin/features/AllCucumberFeaturesTest.kt: -------------------------------------------------------------------------------- 1 | package features 2 | 3 | import io.cucumber.junit.Cucumber 4 | import io.cucumber.junit.CucumberOptions 5 | import org.junit.runner.RunWith 6 | 7 | @RunWith(Cucumber::class) 8 | @CucumberOptions( 9 | plugin = ["pretty", "summary"], 10 | tags = "not @ignore" 11 | // tags="not @ignore and @here" 12 | // tags="@ignore" 13 | ) 14 | class AllCucumberFeaturesTest -------------------------------------------------------------------------------- /src/test/resources/features/highlighting/color_settings_page.feature: -------------------------------------------------------------------------------- 1 | Feature: Color Settings Page 2 | 3 | Scenario: Checks that color settings page tags have the same highlighting with Smk annotators 4 | Given a snakemake project 5 | Given I open a color settings page text 6 | Then I expect the tag highlighting to be the same as the annotator highlighting 7 | When I check highlighting infos ignoring extra highlighting -------------------------------------------------------------------------------- /src/main/resources/inspectionDescriptions/SmkSectionVariableRequiresLambdaAccessInspection.html: -------------------------------------------------------------------------------- 1 | 2 | 3 | This inspection warns if identifier requires lambda access. E.g. 'input', 'output', 'wildcards' cannot be accessed 4 | directly in 'params' section. In such case user should use lambda syntax, e.g. basename = lambda wildcards, input, output, threads, resources: input.bam.replace(".bam", ""). 5 | 6 | -------------------------------------------------------------------------------- /testData/stringLanguagePsi/LbraceSubscription.txt: -------------------------------------------------------------------------------- 1 | FILE 2 | PsiElement(LBRACE)('{') 3 | SmkSLSubscriptionExpressionImpl(SUBSCRIPTION_EXPRESSION) 4 | SmkSLReferenceExpressionImpl: foo 5 | PsiElement(Py:IDENTIFIER)('foo') 6 | PsiElement(LBRACKET)('[') 7 | SmkSLSubscriptionKeyExpression: [0] 8 | PsiElement(ACCESS_KEY)('0') 9 | PsiElement(RBRACKET)(']') 10 | PsiErrorElement:Expected '}' 11 | -------------------------------------------------------------------------------- /src/main/resources/inspectionDescriptions/SmkUnresolvedImportedRuleNameInspection.html: -------------------------------------------------------------------------------- 1 | 2 | 3 | This inspection highlights a rule reference in 'use' definition section or after 'rules.<>' 4 | keyword using weak warning if the name matches one of remote module rule patterns. 5 | For modules imported from a local *.smk file the rule reference will be highlighted as error 6 | if the corresponding target rule is missing in the module. 7 | 8 | -------------------------------------------------------------------------------- /src/main/resources/inspectionDescriptions/SmkSectionUnexpectedCallableArgsInspection.html: -------------------------------------------------------------------------------- 1 | 2 | 3 | Not all rule/checkpoint sections accept a function name as a parameter (e.g input functions) that will be called by Snakemake with wildcards and 4 | other parameters. E.g.: input, params, threads, resources, group sections support this feature. See lambda_args section 5 | in `snakemake_api.yaml` for more details. 6 | 7 | -------------------------------------------------------------------------------- /testData/folding/multilineRulesDoNotCollapse.smk: -------------------------------------------------------------------------------- 1 | rule rule_314_2: 2 | input: key1="value", key2="value", key3="value" 3 | output: 4 | "value1", 5 | "value2" 6 | log: 7 | key1="value" 8 | message: 9 | "aaaa" 10 | "aaaa" 11 | "aaaa" 12 | "aaaa" 13 | params: 14 | key1="value", 15 | key2="value" 16 | conda: "foo.yaml" 17 | -------------------------------------------------------------------------------- /testData/psi/RuleInvalidNoParamBodyEof.txt: -------------------------------------------------------------------------------- 1 | SnakemakeFile: RuleInvalidNoParamBodyEof.smk 2 | SmkRule 3 | PsiElement(Py:RULE_KEYWORD)('rule') 4 | PsiElement(Py:COLON)(':') 5 | PyStatementList 6 | PsiWhiteSpace('\n ') 7 | SmkRuleOrCheckpointArgsSection 8 | PsiElement(Py:IDENTIFIER)('input') 9 | PyArgumentList 10 | PsiElement(Py:COLON)(':') 11 | PsiErrorElement:Indent expected 12 | -------------------------------------------------------------------------------- /src/main/kotlin/com/jetbrains/snakecharm/lang/psi/stubs/SmkStubs.kt: -------------------------------------------------------------------------------- 1 | package com.jetbrains.snakecharm.lang.psi.stubs 2 | 3 | import com.intellij.psi.stubs.NamedStub 4 | import com.jetbrains.snakecharm.lang.psi.* 5 | 6 | interface SmkRuleStub : NamedStub 7 | interface SmkCheckpointStub : NamedStub 8 | interface SmkSubworkflowStub : NamedStub 9 | interface SmkModuleStub : NamedStub 10 | interface SmkUseStub : NamedStub -------------------------------------------------------------------------------- /src/test/resources/features/stringLanguage/issue380.feature: -------------------------------------------------------------------------------- 1 | Feature: SOE, issue 380 2 | Scenario: SOE not happens 3 | Given a snakemake project 4 | Given I open a file "foo.smk" with text 5 | """ 6 | def foo(): 7 | rule: 8 | shell: "{config[methtool][proportion]}" 9 | pass 10 | """ 11 | When I put the caret after propo 12 | Then I expect language injection on "{config[methtool][proportion]}" 13 | And validate issue 380 -------------------------------------------------------------------------------- /testData/psi/WorkflowTopLevelDecoratorsInRuleAsKeywordParams.smk: -------------------------------------------------------------------------------- 1 | rule aaa: 2 | output: "foo" 3 | params: 4 | configfile = "foo4", 5 | report = "foo1", 6 | singularity = "foo2", 7 | include = "foo5", 8 | workdir = "foo6", 9 | wildcard_constraints = "foo7", 10 | onstart = "foo8", 11 | onsuccess = "foo9", 12 | onerror = "foo10", 13 | localrules = "foo10", 14 | ruleorder = "foo10", 15 | -------------------------------------------------------------------------------- /testData/psi/CrazyDocstrings.smk: -------------------------------------------------------------------------------- 1 | # only first section doc is taken 2 | 3 | rule NAME: """Docstring 1""" 4 | """Docstring 2""" """Docstring 3""" 5 | """Docstring 4""" input: "input.txt" 6 | """Docstring 5"""output: "output.txt" 7 | 8 | rule boo: 9 | 'doc-2' 10 | f'doc-{1}' 11 | "doc-3" 12 | """doc-4""" 13 | run: 14 | for rule in workflow.rules: 15 | print("RULE", rule.name) 16 | print("DOCSTRING", rule.docstring) 17 | -------------------------------------------------------------------------------- /testData/psi/RuleNoName.txt: -------------------------------------------------------------------------------- 1 | SnakemakeFile: RuleNoName.smk 2 | SmkRule 3 | PsiElement(Py:RULE_KEYWORD)('rule') 4 | PsiElement(Py:COLON)(':') 5 | PyStatementList 6 | PsiWhiteSpace('\n ') 7 | SmkRuleOrCheckpointArgsSection 8 | PsiElement(Py:IDENTIFIER)('input') 9 | PyArgumentList 10 | PsiElement(Py:COLON)(':') 11 | PsiWhiteSpace(' ') 12 | PyStringLiteralExpression: foo 13 | PsiElement(Py:SINGLE_QUOTED_STRING)(''foo'') -------------------------------------------------------------------------------- /testData/psi/RuleParamsListArgsStringMultilineIncorrectUnindent.smk: -------------------------------------------------------------------------------- 1 | rule rule1: 2 | input: 3 | "file" 4 | "15" 5 | "_copy" 6 | "1" 7 | ".txt" 8 | , "another" "file" 9 | ".txt" 10 | 11 | rule rule2: 12 | input: "file" 13 | "15" 14 | "_copy" 15 | "1" 16 | ".txt" 17 | , "another" "file" 18 | ".txt" -------------------------------------------------------------------------------- /src/main/resources/inspectionDescriptions/SmkSLWildcardNameIsConfusingInspection.html: -------------------------------------------------------------------------------- 1 | 2 | 3 | This inspection warns if wildcard name is same as section name. It isn't an error but could be confusing in some cases. 4 | E.g. 'output' in 'shell' section is list of paths from 'output:' section, use 'wildcard.output' if you need access to 5 | the wildcard. On the other hand 'output' in 'params' section is a wildcard name. Also, wildcard name shouldn't 6 | contain dot character. 7 | 8 | -------------------------------------------------------------------------------- /testData/stringLanguagePsi/RegexpOnly.txt: -------------------------------------------------------------------------------- 1 | FILE 2 | PsiElement(LBRACE)('{') 3 | PsiErrorElement:Expected identifier name 4 | 5 | PsiElement(COMMA)(',') 6 | SmkSLElementImpl(REGEXP) 7 | RegExpPatternImpl: <\d+> 8 | RegExpBranchImpl: <\d+> 9 | RegExpClosureImpl: <\d+> 10 | RegExpSimpleClassImpl: <\d> 11 | PsiElement(CHAR_CLASS)('\d') 12 | RegExpQuantifierImpl: <+> 13 | PsiElement(PLUS)('+') 14 | PsiElement(RBRACE)('}') -------------------------------------------------------------------------------- /src/main/kotlin/com/jetbrains/snakecharm/stringLanguage/SmkSLanguage.kt: -------------------------------------------------------------------------------- 1 | package com.jetbrains.snakecharm.stringLanguage 2 | 3 | import com.intellij.lang.Language 4 | import com.intellij.psi.PsiElement 5 | import com.jetbrains.snakecharm.lang.psi.impl.SmkPsiUtil 6 | 7 | object SmkSLanguage : Language("SnakemakeSL") { 8 | private fun readResolve(): Any = SmkSLanguage 9 | fun isInsideSmkSLFile(foothold: PsiElement?) = 10 | SmkPsiUtil.isInsideFileWithLanguage(foothold, SmkSLanguage) 11 | } 12 | -------------------------------------------------------------------------------- /testData/psi/Issue275.smk: -------------------------------------------------------------------------------- 1 | files = {"file1.txt": ["file1_a.pdf", "file1_b.pdf"], 2 | "file2.txt": ["file2_a.pdf"]} 3 | 4 | rule all: 5 | input: files.values() 6 | 7 | for input_files, output_files in files.items(): 8 | rule: 9 | input: input_files 10 | output: output_files 11 | shell: "python scripy.py " 12 | "--input {input} " 13 | "--output {output} " 14 | "--many " 15 | "--other " 16 | "--flags " -------------------------------------------------------------------------------- /src/main/kotlin/com/jetbrains/snakecharm/codeInsight/completion/wrapper/SmkWrapperCompletionContributor.kt: -------------------------------------------------------------------------------- 1 | package com.jetbrains.snakecharm.codeInsight.completion.wrapper 2 | 3 | import com.intellij.codeInsight.completion.* 4 | 5 | class SmkWrapperCompletionContributor : CompletionContributor() { 6 | init { 7 | extend( 8 | CompletionType.BASIC, 9 | SmkWrapperCompletionProvider.CAPTURE, 10 | SmkWrapperCompletionProvider 11 | ) 12 | } 13 | } 14 | -------------------------------------------------------------------------------- /src/main/kotlin/com/jetbrains/snakecharm/stringLanguage/lang/psi/SmkSLFile.kt: -------------------------------------------------------------------------------- 1 | package com.jetbrains.snakecharm.stringLanguage.lang.psi 2 | 3 | import com.intellij.extapi.psi.PsiFileBase 4 | import com.intellij.psi.FileViewProvider 5 | import com.jetbrains.snakecharm.stringLanguage.SmkSLFileType 6 | import com.jetbrains.snakecharm.stringLanguage.SmkSLanguage 7 | 8 | class SmkSLFile(viewProvider: FileViewProvider) : PsiFileBase(viewProvider, SmkSLanguage) { 9 | override fun getFileType() = SmkSLFileType 10 | } 11 | -------------------------------------------------------------------------------- /testData/MockSdk2.7/Lib/abc.py: -------------------------------------------------------------------------------- 1 | # Stubs 2 | 3 | class ABCMeta: 4 | pass 5 | 6 | 7 | def abstractmethod(foo): 8 | pass 9 | 10 | 11 | def abstractproperty(foo): 12 | pass 13 | 14 | 15 | # Important: 16 | # classes below are not presented in Python 2 17 | # they were added just for PyDeprecationTest#testAbcDeprecatedAbstracts 18 | # to not create separate test case for them 19 | class abstractstaticmethod(staticmethod): 20 | pass 21 | 22 | 23 | class abstractclassmethod(classmethod): 24 | pass -------------------------------------------------------------------------------- /src/main/kotlin/com/jetbrains/snakecharm/stringLanguage/lang/highlighter/AbstractSmkSLAnnotator.kt: -------------------------------------------------------------------------------- 1 | package com.jetbrains.snakecharm.stringLanguage.lang.highlighter 2 | 3 | import com.jetbrains.python.psi.PyElementVisitor 4 | import com.jetbrains.python.validation.PyAnnotator 5 | import com.jetbrains.snakecharm.stringLanguage.lang.SmkSLElementVisitor 6 | 7 | abstract class AbstractSmkSLAnnotator : PyAnnotator(), SmkSLElementVisitor { 8 | override val pyElementVisitor: PyElementVisitor 9 | get() = this 10 | } -------------------------------------------------------------------------------- /testData/wrappers_storage/bio/pear/meta.yaml: -------------------------------------------------------------------------------- 1 | name: pear 2 | description: PEAR is an ultrafast, memory-efficient and highly accurate pair-end read merger 3 | authors: 4 | - N. Tessa Pierce 5 | input: 6 | - paired fastq files 7 | output: 8 | - merged fastq 9 | citations: 10 | - "`Jiajie Zhang, Kassian Kobert, Tomáš Flouri, Alexandros Stamatakis; PEAR: a fast and accurate Illumina Paired-End reAd mergeR, Bioinformatics, Volume 30, Issue 5, 1 March 2014, Pages 614–620 `_" 11 | -------------------------------------------------------------------------------- /testData/wrappers_storage/bio/bcftools/call/wrapper.py: -------------------------------------------------------------------------------- 1 | __author__ = "Johannes Köster" 2 | __copyright__ = "Copyright 2016, Johannes Köster" 3 | __email__ = "koester@jimmy.harvard.edu" 4 | __license__ = "MIT" 5 | 6 | 7 | from snakemake.shell import shell 8 | 9 | 10 | shell( 11 | "(samtools mpileup {snakemake.params.mpileup} {snakemake.input.samples} " 12 | "--fasta-ref {snakemake.input.ref} --BCF --uncompressed | " 13 | "bcftools call -m {snakemake.params.call} -o {snakemake.output[0]} -v -) 2> {snakemake.log}" 14 | ) -------------------------------------------------------------------------------- /src/main/kotlin/com/jetbrains/snakecharm/lang/validation/SmkAnnotator.kt: -------------------------------------------------------------------------------- 1 | package com.jetbrains.snakecharm.lang.validation 2 | 3 | import com.jetbrains.python.psi.PyElementVisitor 4 | import com.jetbrains.python.validation.PyAnnotator 5 | import com.jetbrains.snakecharm.lang.psi.SmkElementVisitor 6 | 7 | /** 8 | * @author Roman.Chernyatchik 9 | * @date 2019-01-09 10 | */ 11 | abstract class SmkAnnotator: PyAnnotator(), SmkElementVisitor { 12 | override val pyElementVisitor: PyElementVisitor 13 | get() = this 14 | } 15 | -------------------------------------------------------------------------------- /src/main/kotlin/com/jetbrains/snakecharm/stringLanguage/SmkSLFileType.kt: -------------------------------------------------------------------------------- 1 | package com.jetbrains.snakecharm.stringLanguage 2 | 3 | import com.intellij.openapi.fileTypes.LanguageFileType 4 | import com.jetbrains.snakecharm.SmkFileType 5 | 6 | object SmkSLFileType : LanguageFileType(SmkSLanguage) { 7 | override fun getIcon() = SmkFileType.icon 8 | 9 | override fun getName() = "SmkSL" 10 | 11 | override fun getDefaultExtension() = "smkStringLanguage" 12 | 13 | override fun getDescription() = "Snakemake formatted string" 14 | } 15 | -------------------------------------------------------------------------------- /src/main/kotlin/com/jetbrains/snakecharm/stringLanguage/lang/highlighter/SmkSLSyntaxHighlighterFactory.kt: -------------------------------------------------------------------------------- 1 | package com.jetbrains.snakecharm.stringLanguage.lang.highlighter 2 | 3 | import com.intellij.openapi.fileTypes.SyntaxHighlighterFactory 4 | import com.intellij.openapi.project.Project 5 | import com.intellij.openapi.vfs.VirtualFile 6 | 7 | class SmkSLSyntaxHighlighterFactory : SyntaxHighlighterFactory() { 8 | override fun getSyntaxHighlighter(project: Project?, virtualFile: VirtualFile?) 9 | = SmkSLSyntaxHighlighter() 10 | } -------------------------------------------------------------------------------- /testData/psi/RuleInvalid.txt: -------------------------------------------------------------------------------- 1 | SnakemakeFile: RuleInvalid.smk 2 | SmkRule 3 | PsiElement(Py:RULE_KEYWORD)('rule') 4 | PsiErrorElement:Rule name identifier or ':' expected 5 | 6 | PyStatementList 7 | PsiWhiteSpace('\n ') 8 | SmkRuleOrCheckpointArgsSection 9 | PsiElement(Py:IDENTIFIER)('input') 10 | PyArgumentList 11 | PsiElement(Py:COLON)(':') 12 | PsiWhiteSpace(' ') 13 | PyStringLiteralExpression: foo 14 | PsiElement(Py:SINGLE_QUOTED_STRING)(''foo'') -------------------------------------------------------------------------------- /testData/stringLanguagePsi/MultipleAccess.txt: -------------------------------------------------------------------------------- 1 | FILE 2 | PsiElement(LBRACE)('{') 3 | SmkSLReferenceExpressionImpl: too 4 | SmkSLReferenceExpressionImpl: doo 5 | SmkSLReferenceExpressionImpl: boo 6 | SmkSLReferenceExpressionImpl: foo 7 | PsiElement(Py:IDENTIFIER)('foo') 8 | PsiElement(DOT)('.') 9 | PsiElement(Py:IDENTIFIER)('boo') 10 | PsiElement(DOT)('.') 11 | PsiElement(Py:IDENTIFIER)('doo') 12 | PsiElement(DOT)('.') 13 | PsiElement(Py:IDENTIFIER)('too') 14 | PsiElement(RBRACE)('}') -------------------------------------------------------------------------------- /testData/wrappers_storage/bio/picard/bedtointervallist/wrapper.py: -------------------------------------------------------------------------------- 1 | __author__ = "Fabian Kilpert" 2 | __copyright__ = "Copyright 2020, Fabian Kilpert" 3 | __email__ = "fkilpert@gmail.com" 4 | __license__ = "MIT" 5 | 6 | 7 | from snakemake.shell import shell 8 | 9 | 10 | log = snakemake.log_fmt_shell() 11 | 12 | 13 | shell( 14 | "picard BedToIntervalList " 15 | "{snakemake.params} " 16 | "INPUT={snakemake.input.bed} " 17 | "SEQUENCE_DICTIONARY={snakemake.input.dict} " 18 | "OUTPUT={snakemake.output} " 19 | "{log} " 20 | ) 21 | -------------------------------------------------------------------------------- /testData/psi/Rule.txt: -------------------------------------------------------------------------------- 1 | SnakemakeFile: Rule.smk 2 | SmkRule 3 | PsiElement(Py:RULE_KEYWORD)('rule') 4 | PsiWhiteSpace(' ') 5 | PsiElement(Py:IDENTIFIER)('all') 6 | PsiElement(Py:COLON)(':') 7 | PyStatementList 8 | PsiWhiteSpace('\n ') 9 | SmkRuleOrCheckpointArgsSection 10 | PsiElement(Py:IDENTIFIER)('input') 11 | PyArgumentList 12 | PsiElement(Py:COLON)(':') 13 | PsiWhiteSpace(' ') 14 | PyStringLiteralExpression: foo 15 | PsiElement(Py:SINGLE_QUOTED_STRING)(''foo'') -------------------------------------------------------------------------------- /testData/wrappers_storage/bio/samtools/bam2fq/interleaved/wrapper.py: -------------------------------------------------------------------------------- 1 | __author__ = "David Laehnemann, Victoria Sack" 2 | __copyright__ = "Copyright 2018, David Laehnemann, Victoria Sack" 3 | __email__ = "david.laehnemann@hhu.de" 4 | __license__ = "MIT" 5 | 6 | 7 | import os 8 | from snakemake.shell import shell 9 | 10 | 11 | prefix = os.path.splitext(snakemake.output[0])[0] 12 | 13 | shell( 14 | "samtools bam2fq {snakemake.params} " 15 | " -@ {snakemake.threads} " 16 | " {snakemake.input[0]}" 17 | " >{snakemake.output[0]} " 18 | ) 19 | -------------------------------------------------------------------------------- /src/main/kotlin/com/jetbrains/snakecharm/SmkFileType.kt: -------------------------------------------------------------------------------- 1 | package com.jetbrains.snakecharm 2 | 3 | import com.jetbrains.python.PythonFileType 4 | import com.jetbrains.snakecharm.lang.SnakemakeLanguageDialect 5 | 6 | /** 7 | * @author Roman.Chernyatchik 8 | * @date 2018-12-30 9 | */ 10 | object SmkFileType : PythonFileType(SnakemakeLanguageDialect) { 11 | override fun getIcon() = SnakemakeIcons.FILE 12 | override fun getName() = "Snakemake" 13 | override fun getDefaultExtension() = "smk" 14 | override fun getDescription() = "Snakemake Pipeline" 15 | } -------------------------------------------------------------------------------- /src/main/kotlin/com/jetbrains/snakecharm/lang/psi/SmkArgsSection.kt: -------------------------------------------------------------------------------- 1 | package com.jetbrains.snakecharm.lang.psi 2 | 3 | import com.jetbrains.python.psi.PyArgumentList 4 | import com.jetbrains.python.psi.PyKeywordArgument 5 | 6 | interface SmkArgsSection: SmkSection { 7 | val argumentList: PyArgumentList? 8 | get() = children.firstOrNull { it is PyArgumentList } as PyArgumentList? 9 | 10 | @Suppress("unused") 11 | val keywordArguments: List? 12 | get() = argumentList?.arguments?.filterIsInstance() 13 | } -------------------------------------------------------------------------------- /testData/psi/Issue313_2.smk: -------------------------------------------------------------------------------- 1 | # noinspection PyUnresolvedReferences 2 | ruleorder: rule_313 > rule_313_1 3 | 4 | # noinspection PyUnresolvedReferences 5 | ruleorder: 6 | rule_313 > rule_313_1 7 | 8 | # noinspection PyUnresolvedReferences 9 | ruleorder: 10 | rule_313 > rule_313_1 11 | 12 | 13 | # noinspection PyUnresolvedReferences 14 | localrules: rule_313, rule_313_1 15 | 16 | # noinspection PyUnresolvedReferences 17 | localrules: 18 | rule_313, rule_313_1 19 | 20 | # noinspection PyUnresolvedReferences 21 | localrules: 22 | rule_313, rule_313_1 -------------------------------------------------------------------------------- /src/main/kotlin/com/jetbrains/snakecharm/stringLanguage/lang/highlighter/SmkSLAnnotatingVisitor.kt: -------------------------------------------------------------------------------- 1 | package com.jetbrains.snakecharm.stringLanguage.lang.highlighter 2 | 3 | import com.intellij.lang.annotation.AnnotationHolder 4 | import com.intellij.lang.annotation.Annotator 5 | import com.intellij.openapi.project.DumbAware 6 | import com.intellij.psi.PsiElement 7 | 8 | class SmkSLAnnotatingVisitor : Annotator, DumbAware { 9 | override fun annotate(element: PsiElement, holder: AnnotationHolder) { 10 | SmkSLWildcardsAnnotator.annotateElement(element, holder) 11 | } 12 | } 13 | -------------------------------------------------------------------------------- /testData/stringLanguagePsi/OrdinaryRegexp.txt: -------------------------------------------------------------------------------- 1 | FILE 2 | PsiElement(LBRACE)('{') 3 | SmkSLReferenceExpressionImpl: foo 4 | PsiElement(Py:IDENTIFIER)('foo') 5 | PsiElement(COMMA)(',') 6 | SmkSLElementImpl(REGEXP) 7 | RegExpPatternImpl: < \d+> 8 | RegExpBranchImpl: < \d+> 9 | RegExpCharImpl: < > 10 | PsiElement(CHARACTER)(' ') 11 | RegExpClosureImpl: <\d+> 12 | RegExpSimpleClassImpl: <\d> 13 | PsiElement(CHAR_CLASS)('\d') 14 | RegExpQuantifierImpl: <+> 15 | PsiElement(PLUS)('+') 16 | PsiElement(RBRACE)('}') -------------------------------------------------------------------------------- /testData/wrappers_storage/bio/samtools/depth/wrapper.py: -------------------------------------------------------------------------------- 1 | """Snakemake wrapper for running samtools depth.""" 2 | 3 | __author__ = "Dayne L Filer" 4 | __copyright__ = "Copyright 2020, Dayne L Filer" 5 | __email__ = "dayne.filer@gmail.com" 6 | __license__ = "MIT" 7 | 8 | from snakemake.shell import shell 9 | 10 | params = snakemake.params.get("extra", "") 11 | 12 | # check for optional bed file 13 | bed = snakemake.input.get("bed", "") 14 | if bed: 15 | bed = "-b " + bed 16 | 17 | shell( 18 | "samtools depth {params} {bed} " "-o {snakemake.output[0]} {snakemake.input.bams}" 19 | ) 20 | -------------------------------------------------------------------------------- /testData/stringLanguagePsi/RbracketInName.txt: -------------------------------------------------------------------------------- 1 | FILE 2 | PsiElement(LBRACE)('{') 3 | SmkSLReferenceExpressionImpl: foo 4 | PsiElement(Py:IDENTIFIER)('foo') 5 | PsiErrorElement:Unexpected character 6 | PsiElement(BAD_CHARACTER)(']') 7 | PsiElement(COMMA)(',') 8 | SmkSLElementImpl(REGEXP) 9 | RegExpPatternImpl: <\d+> 10 | RegExpBranchImpl: <\d+> 11 | RegExpClosureImpl: <\d+> 12 | RegExpSimpleClassImpl: <\d> 13 | PsiElement(CHAR_CLASS)('\d') 14 | RegExpQuantifierImpl: <+> 15 | PsiElement(PLUS)('+') 16 | PsiElement(RBRACE)('}') -------------------------------------------------------------------------------- /src/main/kotlin/com/jetbrains/snakecharm/codeInsight/completion/wrapper/SmkWrapperArgsCompletionContributor.kt: -------------------------------------------------------------------------------- 1 | package com.jetbrains.snakecharm.codeInsight.completion.wrapper 2 | 3 | import com.intellij.codeInsight.completion.CompletionContributor 4 | import com.intellij.codeInsight.completion.CompletionType 5 | 6 | class SmkWrapperArgsCompletionContributor : CompletionContributor() { 7 | init { 8 | extend( 9 | CompletionType.BASIC, 10 | SmkWrapperArgsCompletionProvider.CAPTURE, 11 | SmkWrapperArgsCompletionProvider 12 | ) 13 | } 14 | } -------------------------------------------------------------------------------- /src/test/resources/features/highlighting/inspections/avoid_tab_whitespaces.feature: -------------------------------------------------------------------------------- 1 | Feature: Inspection warns about using TAB as whitespace. 2 | 3 | Scenario: Using TAB whitespace 4 | Given a snakemake project 5 | And I open a file "foo.smk" with text 6 | """ 7 | rule boo: 8 | input: "in" 9 | """ 10 | When SmkAvoidTabWhitespace inspection is enabled 11 | Then I expect inspection weak warning on pattern <\n\t> with message 12 | """ 13 | Tab character detected. PEP-8 recommends to use spaces in Python like code. 14 | """ 15 | When I check highlighting weak warnings -------------------------------------------------------------------------------- /testData/stringLanguagePsi/SpacesInIdentifierName.txt: -------------------------------------------------------------------------------- 1 | FILE 2 | PsiElement(LBRACE)('{') 3 | PsiErrorElement:Unexpected character 4 | PsiElement(BAD_CHARACTER)(' ') 5 | SmkSLReferenceExpressionImpl: foo 6 | PsiElement(Py:IDENTIFIER)('foo') 7 | PsiElement(COMMA)(',') 8 | SmkSLElementImpl(REGEXP) 9 | RegExpPatternImpl: <\d+> 10 | RegExpBranchImpl: <\d+> 11 | RegExpClosureImpl: <\d+> 12 | RegExpSimpleClassImpl: <\d> 13 | PsiElement(CHAR_CLASS)('\d') 14 | RegExpQuantifierImpl: <+> 15 | PsiElement(PLUS)('+') 16 | PsiElement(RBRACE)('}') -------------------------------------------------------------------------------- /testData/wrappers_storage/bio/picard/bedtointervallist/meta.yaml: -------------------------------------------------------------------------------- 1 | name: picard BedToIntervalList 2 | description: | 3 | `picard BedToIntervalList `_ converts a BED file to Picard Interval List format. 4 | authors: 5 | - Fabian Kilpert 6 | input: 7 | - bed: region file 8 | - dict: genome dictionary file (from samtools dict or `picard CreateSequenceDictionary `_ ) 9 | output: 10 | - interval_list Picard format 11 | 12 | -------------------------------------------------------------------------------- /testData/psi/FormattedStringAfterToplevelSection.smk: -------------------------------------------------------------------------------- 1 | df = [] 2 | 3 | onstart: 4 | print(f"Total files: {len(df)}") 5 | 6 | rule a: 7 | output: "out" 8 | 9 | include: 10 | f"{os.path.join(tt1, tt2)}" 11 | 12 | rule b: 13 | output: "out" 14 | 15 | rule: 16 | f"text {print(30)}" # this is a docstring, snakemake accepts such syntax 17 | 18 | rule c: 19 | output: "out" 20 | 21 | rule foo: f"text: { {latitude: a, longitude: b} }" 22 | input: expand(f"sorted_reads/{os.path.join(dir1, dir2, file2)}", sample=config["samples"]) 23 | shell: "echo hello" 24 | 25 | rule foo: input: "fjkd" -------------------------------------------------------------------------------- /testData/psi/RuleSectionNotebook.txt: -------------------------------------------------------------------------------- 1 | SnakemakeFile: RuleSectionNotebook.smk 2 | SmkRule 3 | PsiElement(Py:RULE_KEYWORD)('rule') 4 | PsiWhiteSpace(' ') 5 | PsiElement(Py:IDENTIFIER)('hello') 6 | PsiElement(Py:COLON)(':') 7 | PyStatementList 8 | PsiWhiteSpace('\n ') 9 | SmkRuleOrCheckpointArgsSection 10 | PsiElement(Py:IDENTIFIER)('notebook') 11 | PyArgumentList 12 | PsiElement(Py:COLON)(':') 13 | PsiWhiteSpace('\n ') 14 | PyStringLiteralExpression: hello.py.ipynb 15 | PsiElement(Py:SINGLE_QUOTED_STRING)('"hello.py.ipynb"') -------------------------------------------------------------------------------- /testData/wrappers_storage/bio/last/lastal/meta.yaml: -------------------------------------------------------------------------------- 1 | name: lastal 2 | description: "LAST finds similar regions between sequences, and aligns them. It is designed for comparing large datasets to each other (e.g. vertebrate genomes and/or large numbers of DNA reads)" 3 | authors: 4 | - N. Tessa Pierce 5 | inputs: 6 | - indexed db for mapping with last 7 | - sequences to align 8 | outputs: 9 | - sequence alignments 10 | citations: 11 | - "`Adaptive seeds tame genomic sequence comparison. Kiełbasa SM, Wan R, Sato K, Horton P, Frith MC. Genome Res. 2011 21(3):487-93. `_" 12 | -------------------------------------------------------------------------------- /src/main/kotlin/com/jetbrains/snakecharm/lang/psi/impl/SmkExcludedRulesNamesListImpl.kt: -------------------------------------------------------------------------------- 1 | package com.jetbrains.snakecharm.lang.psi.impl 2 | 3 | import com.intellij.lang.ASTNode 4 | import com.intellij.psi.util.childrenOfType 5 | import com.jetbrains.python.psi.PyExpression 6 | import com.jetbrains.python.psi.impl.PyElementImpl 7 | import com.jetbrains.snakecharm.lang.psi.SmkExcludedRulesNamesList 8 | 9 | class SmkExcludedRulesNamesListImpl(node: ASTNode) : PyElementImpl(node), SmkExcludedRulesNamesList { 10 | override fun namesPsi() = childrenOfType() 11 | override fun names() = namesPsi().map { it.text } 12 | } -------------------------------------------------------------------------------- /testData/folding/multilineRulesCollapse.smk: -------------------------------------------------------------------------------- 1 | rule rule_314_1: 2 | input: 3 | key1="value", 4 | key2="value", 5 | key3="value", 6 | key4="value" 7 | log: 8 | key1="value", key2="value", key3="value" 9 | output: 10 | "value1", 11 | "value2", 12 | "value3", 13 | message: 14 | "aaaa" 15 | "aaaa" 16 | "aaaa" 17 | params: 18 | key1="value", 19 | key2="value", 20 | key3="value" -------------------------------------------------------------------------------- /testData/psi/RuleSectionTemplateEngine.txt: -------------------------------------------------------------------------------- 1 | SnakemakeFile: RuleSectionTemplateEngine.smk 2 | SmkRule 3 | PsiElement(Py:RULE_KEYWORD)('rule') 4 | PsiWhiteSpace(' ') 5 | PsiElement(Py:IDENTIFIER)('hello') 6 | PsiElement(Py:COLON)(':') 7 | PyStatementList 8 | PsiWhiteSpace('\n ') 9 | SmkRuleOrCheckpointArgsSection 10 | PsiElement(Py:IDENTIFIER)('template_engine') 11 | PyArgumentList 12 | PsiElement(Py:COLON)(':') 13 | PsiWhiteSpace('\n ') 14 | PyStringLiteralExpression: hello.py.ipynb 15 | PsiElement(Py:SINGLE_QUOTED_STRING)('"hello.py.ipynb"') -------------------------------------------------------------------------------- /src/main/kotlin/com/jetbrains/snakecharm/lang/psi/impl/SmkUseNewNamePatternImpl.kt: -------------------------------------------------------------------------------- 1 | package com.jetbrains.snakecharm.lang.psi.impl 2 | 3 | import com.intellij.lang.ASTNode 4 | import com.intellij.psi.PsiElement 5 | import com.jetbrains.python.psi.impl.PyElementImpl 6 | import com.jetbrains.snakecharm.lang.psi.SmkUseNewNamePattern 7 | 8 | class SmkUseNewNamePatternImpl(node: ASTNode) : PyElementImpl(node), SmkUseNewNamePattern { 9 | override fun isWildcard(): Boolean = text.contains('*') 10 | 11 | override fun getNameBeforeWildcard(): PsiElement = firstChild 12 | 13 | override fun getValue(): String = text.replace(" ", "") 14 | } -------------------------------------------------------------------------------- /src/main/kotlin/com/jetbrains/snakecharm/stringLanguage/lang/psi/elementTypes/SmkSLElementTypes.kt: -------------------------------------------------------------------------------- 1 | package com.jetbrains.snakecharm.stringLanguage.lang.psi.elementTypes 2 | 3 | import com.intellij.psi.tree.TokenSet 4 | import com.jetbrains.snakecharm.stringLanguage.lang.psi.SmkSLElementType 5 | 6 | object SmkSLElementTypes { 7 | val REFERENCE_EXPRESSION = SmkSLElementType("REFERENCE_EXPRESSION") 8 | val SUBSCRIPTION_EXPRESSION = SmkSLElementType("SUBSCRIPTION_EXPRESSION") 9 | val KEY_EXPRESSION = SmkSLElementType("KEY_EXPRESSION") 10 | 11 | val EXPRESSION_TOKENS = TokenSet.create(REFERENCE_EXPRESSION, SUBSCRIPTION_EXPRESSION) 12 | } -------------------------------------------------------------------------------- /testData/wrappers_storage/bio/bwa/mem/meta.yaml: -------------------------------------------------------------------------------- 1 | name: "bwa mem" 2 | description: Map reads using bwa mem, with optional sorting using 3 | samtools or picard. 4 | url: http://bio-bwa.sourceforge.net/bwa.shtml 5 | authors: 6 | - Johannes Köster 7 | - Julian de Ruiter 8 | - Filipe G. Vieira 9 | input: 10 | - FASTQ file(s) 11 | - reference genome 12 | output: 13 | - SAM/BAM/CRAM file 14 | notes: | 15 | * The `extra` param allows for additional arguments for bwa-mem. 16 | * The `sorting` param allows to enable sorting, and can be either 'none', 'samtools', 'fgbio' or 'picard'. 17 | * The `sort_extra` allows for extra arguments for samtools/picard 18 | -------------------------------------------------------------------------------- /testData/wrappers_storage/utils/cairosvg/wrapper.py: -------------------------------------------------------------------------------- 1 | __author__ = "Johannes Köster" 2 | __copyright__ = "Copyright 2017, Johannes Köster" 3 | __email__ = "johannes.koester@protonmail.com" 4 | __license__ = "MIT" 5 | 6 | import os 7 | from snakemake.shell import shell 8 | 9 | extra = snakemake.params.get("extra", "") 10 | log = snakemake.log_fmt_shell(stdout=True, stderr=True) 11 | 12 | _, ext = os.path.splitext(snakemake.output[0]) 13 | 14 | if ext not in (".png", ".pdf", ".ps", ".svg"): 15 | raise ValueError("invalid file extension: '{}'".format(ext)) 16 | fmt = ext[1:] 17 | 18 | shell("cairosvg -f {fmt} {snakemake.input[0]} -o {snakemake.output[0]}") 19 | -------------------------------------------------------------------------------- /src/main/kotlin/com/jetbrains/snakecharm/lang/formatter/SmkCustomCodeStyleSettings.kt: -------------------------------------------------------------------------------- 1 | package com.jetbrains.snakecharm.lang.formatter 2 | 3 | import com.intellij.psi.codeStyle.CodeStyleSettings 4 | import com.intellij.psi.codeStyle.CustomCodeStyleSettings 5 | import com.jetbrains.snakecharm.lang.SnakemakeLanguageDialect 6 | 7 | class SmkCustomCodeStyleSettings(settings: CodeStyleSettings): 8 | CustomCodeStyleSettings(SnakemakeLanguageDialect.id, settings) { 9 | 10 | // TODO: add useful options and implement in formatter, use PythonCodeStyleSettings 11 | // or MarkdownCodeStyleSettings as Example 12 | // @JvmField 13 | // var MAX_LINES_AROUND_HEADER: Int = 1 14 | } -------------------------------------------------------------------------------- /src/main/resources/inspectionDescriptions/SmkDepreciatedKeywordsInspection.html: -------------------------------------------------------------------------------- 1 | 2 | 3 | Snakecharm provides information on keywords and functions that have been depreciated, 4 | deleted or introduced in particular snakemake versions. 5 |
6 | To properly process deprecation information, the language version in the snakemake settings should be set to the version 7 | that should be used for making checks. 8 |
9 | For example, if specified version is 2.0.0, using any keyword that was introduced after that version will cause error. 10 | Similarly, using keywords or functions that were removed before version 2.0.0 will cause corresponding error. 11 | 12 | -------------------------------------------------------------------------------- /src/test/resources/features/refactoring/rename_section.feature: -------------------------------------------------------------------------------- 1 | Feature: Rename Sections 2 | 3 | Scenario Outline: Rename is forbidden 4 | Given a snakemake project 5 | Given I open a file "foo.smk" with text 6 | """ 7 | foo: 8 |
: "foo" 9 | message: "{
}" 10 | run: 11 | print(
) 12 | """ 13 | When I put the caret at
: "foo" 14 | When I invoke rename with name "doo" and get error "Section keyword rename not allowed." 15 | Examples: 16 | | rule_like | section | 17 | | rule | output | 18 | | rule | input | 19 | | checkpoint | input | -------------------------------------------------------------------------------- /src/main/kotlin/com/jetbrains/snakecharm/inspections/SnakemakeInspectionVisitor.kt: -------------------------------------------------------------------------------- 1 | package com.jetbrains.snakecharm.inspections 2 | 3 | import com.intellij.codeInspection.ProblemsHolder 4 | import com.jetbrains.python.inspections.PyInspectionVisitor 5 | import com.jetbrains.python.psi.PyElementVisitor 6 | import com.jetbrains.python.psi.types.TypeEvalContext 7 | import com.jetbrains.snakecharm.lang.psi.SmkElementVisitor 8 | 9 | abstract class SnakemakeInspectionVisitor( 10 | holder: ProblemsHolder, 11 | context: TypeEvalContext, 12 | ) : SmkElementVisitor, PyInspectionVisitor(holder, context) { 13 | override val pyElementVisitor: PyElementVisitor 14 | get() = this 15 | } -------------------------------------------------------------------------------- /src/test/resources/features/controlflow/snakemake_controlflow.feature: -------------------------------------------------------------------------------- 1 | @ignore 2 | Feature: Controlflow issue 14 3 | 4 | # TODO: Required for https://github.com/JetBrains-Research/snakecharm/issues/14 5 | # Scenario: Control flow for onerror 6 | # Given a snakemake project 7 | # Given I open a file "foo.smk" with text 8 | # """ 9 | # onerror: 10 | # return 1 11 | # print() 12 | # """ 13 | # Then I expect controlflow 14 | # """ 15 | # 0(1) element: null 16 | # 1(2) element: SMKWorkflowPythonBlockParameter 17 | # 2(3) WRITE ACCESS: null 18 | # 3(4) element: PyExpressionStatement 19 | # 4(5) READ ACCESS: print 20 | # 5() element: null 21 | # """ -------------------------------------------------------------------------------- /testData/wrappers_storage/bio/gatk/applybqsr/meta.yaml: -------------------------------------------------------------------------------- 1 | name: gatk ApplyBQSR 2 | description: | 3 | Run gatk ApplyBQSR. 4 | authors: 5 | - Christopher Schröder 6 | - Johannes Köster 7 | - Jake VanCampen 8 | output: 9 | - bam file 10 | - recalibration table for the bam 11 | output: 12 | - recalibrated bam 13 | notes: | 14 | * The `java_opts` param allows for additional arguments to be passed to the java compiler, e.g. "-Xmx4G" for one, and "-Xmx4G -XX:ParallelGCThreads=10" for two options. 15 | * The `extra` param allows for additional program arguments for ApplyBSQR. 16 | * For more information see, https://gatk.broadinstitute.org/hc/en-us/articles/360037055712-ApplyBQSR 17 | -------------------------------------------------------------------------------- /testData/wrappers_storage/bio/gatk/applybqsr/wrapper.py: -------------------------------------------------------------------------------- 1 | __author__ = "Christopher Schröder" 2 | __copyright__ = "Copyright 2020, Christopher Schröder" 3 | __email__ = "christopher.schroeder@tu-dortmund.de" 4 | __license__ = "MIT" 5 | 6 | 7 | from snakemake.shell import shell 8 | 9 | extra = snakemake.params.get("extra", "") 10 | java_opts = snakemake.params.get("java_opts", "") 11 | 12 | log = snakemake.log_fmt_shell(stdout=True, stderr=True, append=True) 13 | shell( 14 | "gatk --java-options '{java_opts}' ApplyBQSR {extra} -R {snakemake.input.ref} -I {snakemake.input.bam} " 15 | "--bqsr-recal-file {snakemake.input.recal_table} " 16 | "-O {snakemake.output.bam} {log}" 17 | ) 18 | -------------------------------------------------------------------------------- /src/main/kotlin/com/jetbrains/snakecharm/inspections/smksl/SmkSLInspectionVisitor.kt: -------------------------------------------------------------------------------- 1 | package com.jetbrains.snakecharm.inspections.smksl 2 | 3 | import com.intellij.codeInspection.ProblemsHolder 4 | import com.jetbrains.python.inspections.PyInspectionVisitor 5 | import com.jetbrains.python.psi.PyElementVisitor 6 | import com.jetbrains.python.psi.types.TypeEvalContext 7 | import com.jetbrains.snakecharm.stringLanguage.lang.SmkSLElementVisitor 8 | 9 | abstract class SmkSLInspectionVisitor( 10 | holder: ProblemsHolder, 11 | context: TypeEvalContext, 12 | ) : SmkSLElementVisitor, PyInspectionVisitor(holder, context) { 13 | override val pyElementVisitor: PyElementVisitor 14 | get() = this 15 | } -------------------------------------------------------------------------------- /src/main/kotlin/com/jetbrains/snakecharm/lang/parser/SnakemakeParser.kt: -------------------------------------------------------------------------------- 1 | package com.jetbrains.snakecharm.lang.parser 2 | 3 | import com.intellij.lang.SyntaxTreeBuilder 4 | import com.intellij.openapi.project.Project 5 | import com.jetbrains.python.parsing.ParsingContext 6 | import com.jetbrains.python.parsing.PyParser 7 | import com.jetbrains.python.psi.LanguageLevel 8 | 9 | /** 10 | * @author Roman.Chernyatchik 11 | * @date 2018-12-31 12 | */ 13 | class SnakemakeParser(val project: Project) : PyParser() { 14 | override fun createParsingContext( 15 | builder: SyntaxTreeBuilder?, 16 | languageLevel: LanguageLevel? 17 | ): ParsingContext = SmkParserContext(builder!!, languageLevel!!, project) 18 | } -------------------------------------------------------------------------------- /src/main/kotlin/com/jetbrains/snakecharm/lang/psi/types/SmkRulesType.kt: -------------------------------------------------------------------------------- 1 | package com.jetbrains.snakecharm.lang.psi.types 2 | 3 | import com.jetbrains.snakecharm.lang.SnakemakeNames.SMK_VARS_RULES 4 | import com.jetbrains.snakecharm.lang.psi.SmkFile 5 | import com.jetbrains.snakecharm.lang.psi.SmkRule 6 | import com.jetbrains.snakecharm.lang.psi.stubs.SmkRuleNameIndexCompanion.KEY 7 | 8 | class SmkRulesType( 9 | containingRule: SmkRule?, 10 | smkFile: SmkFile 11 | ) : AbstractSmkRuleOrCheckpointType( 12 | containingRule, SMK_VARS_RULES, KEY, SmkRule::class.java 13 | ) { 14 | override val currentFileDeclarations: List by lazy { 15 | smkFile.filterRulesPsi().map { it.second } 16 | } 17 | } -------------------------------------------------------------------------------- /src/main/resources/com/jetbrains/snakecharm/lang/formatter/default.smk: -------------------------------------------------------------------------------- 1 | rule formatter_preview: 2 | input: 3 | "f1", 4 | "f2", 5 | "f2", 6 | "reads/{sample}_1_1.fastq", 7 | "reads/{sample}_1_2.fastq", 8 | "reads/{sample}_2_1.fastq", "reads/{sample}_2_2.fastq", "reads/{sample}_3_1.fastq", "reads/{sample}_3_2.fastq", 9 | output: 10 | html="qc/fastqc/{sample}.html", 11 | zip="qc/fastqc/{sample}_smth.zip" # the suffix _smth.zip is necessary for multiqc to find the file. If not using multiqc, you are free to choose an arbitrary filename 12 | params: "" 13 | log: 14 | "logs/smth/{sample}.log" 15 | threads: 1 16 | wrapper: 17 | "0.68.0/bio/smth" -------------------------------------------------------------------------------- /testData/stringLanguagePsi/DotsInsteadOfIdentifiers.txt: -------------------------------------------------------------------------------- 1 | FILE 2 | PsiElement(LBRACE)('{') 3 | PsiErrorElement:Unexpected character 4 | PsiElement(BAD_CHARACTER)('.') 5 | PsiErrorElement:Unexpected character 6 | PsiElement(BAD_CHARACTER)('[') 7 | SmkSLReferenceExpressionImpl: null 8 | SmkSLReferenceExpressionImpl: foo 9 | PsiElement(Py:IDENTIFIER)('foo') 10 | PsiElement(DOT)('.') 11 | PsiErrorElement:Unexpected character 12 | PsiElement(BAD_CHARACTER)('.') 13 | SmkSLReferenceExpressionImpl: null 14 | SmkSLReferenceExpressionImpl: boo 15 | PsiElement(Py:IDENTIFIER)('boo') 16 | PsiElement(DOT)('.') 17 | PsiErrorElement:Expected identifier name 18 | 19 | PsiElement(RBRACE)('}') -------------------------------------------------------------------------------- /testData/wrappers_storage/bio/samtools/sort/wrapper.py: -------------------------------------------------------------------------------- 1 | __author__ = "Johannes Köster" 2 | __copyright__ = "Copyright 2016, Johannes Köster" 3 | __email__ = "koester@jimmy.harvard.edu" 4 | __license__ = "MIT" 5 | 6 | 7 | import os 8 | from snakemake.shell import shell 9 | 10 | 11 | prefix = os.path.splitext(snakemake.output[0])[0] 12 | 13 | # Samtools takes additional threads through its option -@ 14 | # One thread for samtools 15 | # Other threads are *additional* threads passed to the argument -@ 16 | threads = "" if snakemake.threads <= 1 else " -@ {} ".format(snakemake.threads - 1) 17 | 18 | shell( 19 | "samtools sort {snakemake.params} {threads} -o {snakemake.output[0]} " 20 | "-T {prefix} {snakemake.input[0]}" 21 | ) 22 | -------------------------------------------------------------------------------- /src/test/resources/features/resolve/subworkflow_name_resolve.feature: -------------------------------------------------------------------------------- 1 | Feature: Resolve subworkflow name to its corresponding declaration 2 | Scenario: Resolve for a particular rule name when 'rules' is used inside a rule section 3 | Given a snakemake project 4 | Given I open a file "foo.smk" with text 5 | """ 6 | subworkflow otherworkflow: 7 | workdir: 8 | "../path/to/otherworkflow" 9 | snakefile: 10 | "../path/to/otherworkflow/Snakefile" 11 | configfile: 12 | "path/to/custom_configfile.yaml" 13 | 14 | rule a: 15 | input: 16 | otherworkflow() 17 | """ 18 | When I put the caret at otherworkflow() 19 | Then reference should resolve to "otherworkflow" in "foo.smk" -------------------------------------------------------------------------------- /testData/wrappers_storage/bio/gatk3/printreads/meta.yaml: -------------------------------------------------------------------------------- 1 | name: gatk3 PrintReads 2 | description: | 3 | Run gatk3 PrintReads 4 | authors: 5 | - Patrik Smeds 6 | input: 7 | - bam file 8 | - recalibration table 9 | - reference genome 10 | output: 11 | - bam file 12 | notes: | 13 | * The `java_opts` param allows for additional arguments to be passed to the java compiler, e.g. "-Xmx4G" for one, and "-Xmx4G -XX:ParallelGCThreads=10" for two options. 14 | * The `extra` param alllows for additional program arguments. 15 | * For more inforamtion see, https://software.broadinstitute.org/gatk/documentation/article?id=11050 16 | * Gatk3.jar is not included in the bioconda package, i.e it need to be added to the conda environment manually. 17 | -------------------------------------------------------------------------------- /src/main/kotlin/com/jetbrains/snakecharm/lang/formatter/SmkCodeStyleSettingsPanel.kt: -------------------------------------------------------------------------------- 1 | package com.jetbrains.snakecharm.lang.formatter 2 | 3 | import com.intellij.application.options.TabbedLanguageCodeStylePanel 4 | import com.intellij.psi.codeStyle.CodeStyleSettings 5 | import com.jetbrains.snakecharm.lang.SnakemakeLanguageDialect 6 | 7 | class SmkCodeStyleSettingsPanel (currentSettings: CodeStyleSettings, settings:CodeStyleSettings) 8 | : TabbedLanguageCodeStylePanel(SnakemakeLanguageDialect, currentSettings, settings) { 9 | 10 | override fun initTabs(settings: CodeStyleSettings?) { 11 | addWrappingAndBracesTab(settings) 12 | addIndentOptionsTab(settings) 13 | addBlankLinesTab(settings) 14 | //addSpacesTab(settings) 15 | } 16 | } 17 | -------------------------------------------------------------------------------- /src/main/kotlin/com/jetbrains/snakecharm/inspections/SnakemakeInspection.kt: -------------------------------------------------------------------------------- 1 | package com.jetbrains.snakecharm.inspections 2 | 3 | import com.intellij.codeInspection.LocalInspectionTool 4 | import com.jetbrains.snakecharm.SnakemakeBundle 5 | import org.intellij.lang.annotations.Pattern 6 | import org.jetbrains.annotations.Nls 7 | 8 | abstract class SnakemakeInspection : LocalInspectionTool() { 9 | @Pattern(VALID_ID_PATTERN) 10 | override fun getID(): String = getShortName(super.getID()) 11 | 12 | @Nls 13 | override fun getGroupDisplayName(): String = SnakemakeBundle.message("INSP.GROUP.snakemake") 14 | 15 | override fun getShortName(): String = javaClass.simpleName 16 | 17 | override fun isEnabledByDefault(): Boolean = true 18 | } 19 | -------------------------------------------------------------------------------- /src/main/kotlin/com/jetbrains/snakecharm/lang/formatter/SmkCodeStyleConfigurable.kt: -------------------------------------------------------------------------------- 1 | package com.jetbrains.snakecharm.lang.formatter 2 | 3 | import com.intellij.application.options.CodeStyleAbstractConfigurable 4 | import com.intellij.application.options.CodeStyleAbstractPanel 5 | import com.intellij.psi.codeStyle.CodeStyleSettings 6 | import com.jetbrains.snakecharm.SnakemakeBundle 7 | 8 | class SmkCodeStyleConfigurable(settings: CodeStyleSettings, originalSettings: CodeStyleSettings) 9 | : CodeStyleAbstractConfigurable(settings, originalSettings, SnakemakeBundle.message("snakemake.settings.name")) { 10 | 11 | override fun createPanel(settings: CodeStyleSettings): CodeStyleAbstractPanel = 12 | SmkCodeStyleSettingsPanel(currentSettings, settings) 13 | } -------------------------------------------------------------------------------- /src/main/kotlin/com/jetbrains/snakecharm/lang/psi/impl/SmkSubworkflowArgsSectionImpl.kt: -------------------------------------------------------------------------------- 1 | package com.jetbrains.snakecharm.lang.psi.impl 2 | 3 | import com.intellij.lang.ASTNode 4 | import com.jetbrains.python.psi.PyElementVisitor 5 | import com.jetbrains.snakecharm.lang.psi.SmkElementVisitor 6 | import com.jetbrains.snakecharm.lang.psi.SmkSubworkflowArgsSection 7 | 8 | class SmkSubworkflowArgsSectionImpl(node: ASTNode): SmkArgsSectionImpl(node), SmkSubworkflowArgsSection { 9 | override fun acceptPyVisitor(pyVisitor: PyElementVisitor) { 10 | when (pyVisitor) { 11 | is SmkElementVisitor -> pyVisitor.visitSmkSubworkflowArgsSection(this) 12 | else -> super.acceptPyVisitor(pyVisitor) 13 | } 14 | } 15 | } -------------------------------------------------------------------------------- /src/main/kotlin/com/jetbrains/snakecharm/lang/structureView/SmkStructureViewFactory.kt: -------------------------------------------------------------------------------- 1 | package com.jetbrains.snakecharm.lang.structureView 2 | 3 | import com.intellij.ide.structureView.TreeBasedStructureViewBuilder 4 | import com.intellij.lang.PsiStructureViewFactory 5 | import com.intellij.openapi.editor.Editor 6 | import com.intellij.psi.PsiFile 7 | import com.jetbrains.snakecharm.lang.psi.SmkFile 8 | 9 | class SmkStructureViewFactory : PsiStructureViewFactory { 10 | override fun getStructureViewBuilder(psiFile: PsiFile) = 11 | object : TreeBasedStructureViewBuilder() { 12 | override fun createStructureViewModel(editor: Editor?) = 13 | SmkStructureViewModel(psiFile as SmkFile, editor) 14 | } 15 | } 16 | -------------------------------------------------------------------------------- /testData/psi/RuleSectionName.smk: -------------------------------------------------------------------------------- 1 | rule all: 2 | input: 3 | txt = 'out2.txt' 4 | 5 | some_var: str = 'generate_out' 6 | 7 | rule: 8 | name: some_var 9 | output: 'out1.txt' 10 | shell: '''echo {rule} > {output}''' 11 | 12 | 13 | rule name1: 14 | name: "name2" 15 | input: rules.generate_out.output 16 | output: 'out2.txt' 17 | shell: '''echo {rule} > {output}''' 18 | 19 | # NameError in ...: name 'not_defined_var' is not defined 20 | rule: 21 | name: not_defined_var 22 | 23 | # TypeError in ... : attribute name must be string, not 'builtin_function_or_method' 24 | rule: 25 | name: print 26 | 27 | # TypeError in ... : attribute name must be string, not 'function' 28 | rule name1: 29 | name: lambda x: "name2" 30 | 31 | -------------------------------------------------------------------------------- /testData/psi/UnbalancedBracesRecovery.smk: -------------------------------------------------------------------------------- 1 | foo(fo 2 | 3 | rule ffff: input: foo(fo 4 | rule ffff: 5 | input: foo(fo 6 | run: 7 | print(30 8 | 9 | checkpoint ffff: 10 | input: foo(fo 11 | 12 | subworkflow ffff: 13 | snakefile: foo(fo 14 | 15 | rule ffff: input: foo(fo 16 | configfile: "" 17 | 18 | rule ffff: input: foo(fo 19 | workdir: "" 20 | 21 | rule ffff: input: foo(fo 22 | singularity: "" 23 | 24 | rule ffff: input: foo(fo 25 | report: "" 26 | 27 | rule ffff: input: foo(fo 28 | wildcard_constraints: fpp="" 29 | 30 | rule ffff: input: foo(fo 31 | ruleorder: d > d 32 | 33 | rule ffff: input: foo(fo 34 | localrules: d,d 35 | 36 | onstart: 37 | foo(fo 38 | 39 | onsuccess: 40 | foo(fo 41 | 42 | onerror: 43 | foo(fo 44 | 45 | -------------------------------------------------------------------------------- /src/test/resources/features/actions/goto_symbol.feature: -------------------------------------------------------------------------------- 1 | Feature: Goto feature test 2 | 3 | Scenario Outline: Go to rule/checkpoint name 4 | Given a snakemake project 5 | Given a file "foo1.smk" with text 6 | """ 7 | name11: 8 | input: "path/to/input" 9 | 10 | name12: 11 | input: "path/to/input" 12 | """ 13 | And a file "foo2.smk" with text 14 | """ 15 | name21: 16 | input: "path/to/input" 17 | 18 | name22: 19 | input: "path/to/input" 20 | """ 21 | Then go to symbol should contain: 22 | | name11 | 23 | | name12 | 24 | | name21 | 25 | | name22 | 26 | Examples: 27 | | rule_like | 28 | | rule | 29 | | checkpoint | -------------------------------------------------------------------------------- /src/main/kotlin/com/jetbrains/snakecharm/SnakemakePluginUtil.kt: -------------------------------------------------------------------------------- 1 | package com.jetbrains.snakecharm 2 | 3 | import com.intellij.openapi.application.PathManager 4 | import java.nio.file.Path 5 | import kotlin.io.path.Path 6 | 7 | object SnakemakePluginUtil { 8 | fun getPluginSandboxPath(klass: Class<*>): Path { 9 | val resourceName = "/${klass.name.replace('.', '/')}.class" 10 | val resourceRootPath = PathManager.getResourceRoot(klass, resourceName) 11 | requireNotNull(resourceRootPath) { 12 | "Missing '$resourceName' in plugin bundle" 13 | } 14 | val jarPath = Path(resourceRootPath) 15 | val libsPath = jarPath.parent 16 | val pluginSandboxPath = libsPath.parent 17 | return pluginSandboxPath 18 | } 19 | } -------------------------------------------------------------------------------- /testData/wrappers_storage/bio/vcftools/filter/wrapper.py: -------------------------------------------------------------------------------- 1 | __author__ = "Patrik Smeds" 2 | __copyright__ = "Copyright 2018, Patrik Smeds" 3 | __email__ = "patrik.smeds@gmail.com" 4 | __license__ = "MIT" 5 | 6 | 7 | from snakemake.shell import shell 8 | 9 | input_flag = "--vcf" 10 | if snakemake.input[0].endswith(".gz"): 11 | input_flag = "--gzvcf" 12 | 13 | output = " > " + snakemake.output[0] 14 | if output.endswith(".gz"): 15 | output = " | gzip" + output 16 | 17 | log = snakemake.log_fmt_shell(stdout=False, stderr=True) 18 | 19 | extra = snakemake.params.get("extra", "") 20 | 21 | shell( 22 | "vcftools " 23 | "{input_flag} " 24 | "{snakemake.input} " 25 | "{extra} " 26 | "--recode " 27 | "--stdout " 28 | "{output} " 29 | "{log}" 30 | ) 31 | -------------------------------------------------------------------------------- /testData/psi/RuleInvalidNoParamBody.txt: -------------------------------------------------------------------------------- 1 | SnakemakeFile: RuleInvalidNoParamBody.smk 2 | SmkRule 3 | PsiElement(Py:RULE_KEYWORD)('rule') 4 | PsiElement(Py:COLON)(':') 5 | PyStatementList 6 | PsiWhiteSpace('\n ') 7 | SmkRuleOrCheckpointArgsSection 8 | PsiElement(Py:IDENTIFIER)('input') 9 | PyArgumentList 10 | PsiElement(Py:COLON)(':') 11 | PsiErrorElement:Indent expected 12 | 13 | PsiWhiteSpace('\n ') 14 | PsiElement(Py:IDENTIFIER)('output') 15 | PsiElement(Py:COLON)(':') 16 | PsiErrorElement:Statement expected, found Py:COLON 17 | 18 | PsiWhiteSpace(' ') 19 | PyExpressionStatement 20 | PyStringLiteralExpression: foo 21 | PsiElement(Py:SINGLE_QUOTED_STRING)(''foo'') -------------------------------------------------------------------------------- /testData/wrappers_storage/bio/gatk3/printreads/wrapper.py: -------------------------------------------------------------------------------- 1 | __author__ = "Patrik Smeds" 2 | __copyright__ = "Copyright 2019, Patrik Smeds" 3 | __email__ = "patrik.smeds@gmail.com.com" 4 | __license__ = "MIT" 5 | 6 | import os 7 | 8 | from snakemake.shell import shell 9 | 10 | extra = snakemake.params.get("extra", "") 11 | java_opts = snakemake.params.get("java_opts", "") 12 | 13 | input_bam = snakemake.input.bam 14 | input_recal_data = snakemake.input.recal_data 15 | input_ref = snakemake.input.ref 16 | 17 | log = snakemake.log_fmt_shell(stdout=True, stderr=True) 18 | 19 | shell( 20 | "gatk3 {java_opts} -T PrintReads" 21 | " {extra}" 22 | " -I {input_bam}" 23 | " -R {input_ref}" 24 | " -BQSR {input_recal_data}" 25 | " -o {snakemake.output}" 26 | " {log}" 27 | ) 28 | -------------------------------------------------------------------------------- /testData/wrappers_storage/bio/multiqc/wrapper.py: -------------------------------------------------------------------------------- 1 | """Snakemake wrapper for trimming paired-end reads using cutadapt.""" 2 | 3 | __author__ = "Julian de Ruiter" 4 | __copyright__ = "Copyright 2017, Julian de Ruiter" 5 | __email__ = "julianderuiter@gmail.com" 6 | __license__ = "MIT" 7 | 8 | 9 | from os import path 10 | 11 | from snakemake.shell import shell 12 | 13 | 14 | input_dirs = set(path.dirname(fp) for fp in snakemake.input) 15 | output_dir = path.dirname(snakemake.output[0]) 16 | output_name = path.basename(snakemake.output[0]) 17 | log = snakemake.log_fmt_shell(stdout=True, stderr=True) 18 | 19 | shell( 20 | "multiqc" 21 | " {snakemake.params}" 22 | " --force" 23 | " -o {output_dir}" 24 | " -n {output_name}" 25 | " {input_dirs}" 26 | " {log}" 27 | ) 28 | -------------------------------------------------------------------------------- /src/test/resources/features/highlighting/inspections/module_redeclaration.feature: -------------------------------------------------------------------------------- 1 | Feature: SmkModuleRedeclarationInspection inspection 2 | Scenario: A single SmkModuleRedeclarationInspection 3 | Given a snakemake project 4 | Given I open a file "foo.smk" with text 5 | """ 6 | module NAME: 7 | snakefile: "snake.smk" 8 | 9 | module ANOTHER_NAME: 10 | snakefile: "foo.smk" 11 | 12 | module NAME: #overrides 13 | snakefile: "boo.smk" 14 | """ 15 | And SmkModuleRedeclarationInspection inspection is enabled 16 | Then I expect inspection weak warning with message "Only last module with the same name will be used" on 17 | """ 18 | module NAME: 19 | snakefile: "snake.smk" 20 | """ 21 | When I check highlighting weak warnings -------------------------------------------------------------------------------- /src/main/kotlin/com/jetbrains/snakecharm/lang/psi/SmkRuleLike.kt: -------------------------------------------------------------------------------- 1 | package com.jetbrains.snakecharm.lang.psi 2 | 3 | import com.intellij.psi.PsiNameIdentifierOwner 4 | import com.jetbrains.python.psi.PyElementType 5 | import com.jetbrains.python.psi.PyStatement 6 | import com.jetbrains.python.psi.PyStatementListContainer 7 | import com.jetbrains.python.psi.PyStringLiteralExpression 8 | 9 | interface SmkRuleLike: SmkSection, SmkToplevelSection, PyStatementListContainer, 10 | PyStatement, 11 | //ScopeOwner, 12 | PsiNameIdentifierOwner { 13 | 14 | val sectionTokenType: PyElementType 15 | fun getSections(): List 16 | fun getSectionByName(sectionName: String): S? 17 | fun getStringLiteralExpressions(): List 18 | } -------------------------------------------------------------------------------- /src/main/kotlin/com/jetbrains/snakecharm/lang/structureView/SmkStructureViewModel.kt: -------------------------------------------------------------------------------- 1 | package com.jetbrains.snakecharm.lang.structureView 2 | 3 | import com.intellij.ide.util.treeView.smartTree.Sorter 4 | import com.intellij.openapi.editor.Editor 5 | import com.jetbrains.python.structureView.PyStructureViewModel 6 | import com.jetbrains.snakecharm.lang.psi.SmkFile 7 | import com.jetbrains.snakecharm.lang.psi.SmkSection 8 | 9 | class SmkStructureViewModel( 10 | smkFile: SmkFile, 11 | editor: Editor? 12 | ): PyStructureViewModel(smkFile, editor, SmkStructureViewElement(smkFile)) { 13 | init { 14 | withSorters(Sorter.ALPHA_SORTER) 15 | 16 | // rule like & rule like sections & workflow sections 17 | withSuitableClasses(SmkSection::class.java) 18 | } 19 | } -------------------------------------------------------------------------------- /src/test/resources/features/resolve/py_code_resolve.feature: -------------------------------------------------------------------------------- 1 | Feature: Resolve in python part of snakemake file 2 | 3 | Scenario: Resolve any python method 4 | Given a snakemake project 5 | Given I open a file "foo.smk" with text 6 | """ 7 | repr("foo") 8 | """ 9 | When I put the caret at repr 10 | Then reference should resolve to "repr" in "builtins.pyi" 11 | 12 | 13 | Scenario: Do not warn about unresolved snakemake variable in python scripts and wrappers 14 | Given a snakemake project 15 | Given I open a file "foo.smk" with text 16 | """ 17 | assert snakemake.input.get("sort", "missing") == "missing" 18 | """ 19 | And PyUnresolvedReferencesInspection inspection is enabled 20 | Then I expect no inspection errors 21 | When I check highlighting errors -------------------------------------------------------------------------------- /src/main/kotlin/com/jetbrains/snakecharm/lang/psi/impl/SmkArgsSectionImpl.kt: -------------------------------------------------------------------------------- 1 | package com.jetbrains.snakecharm.lang.psi.impl 2 | 3 | import com.intellij.lang.ASTNode 4 | import com.jetbrains.python.psi.impl.PyElementImpl 5 | import com.jetbrains.snakecharm.lang.psi.SmkArgsSection 6 | import com.jetbrains.snakecharm.lang.psi.getIcon 7 | import com.jetbrains.snakecharm.lang.psi.getPresentation 8 | import com.jetbrains.snakecharm.lang.psi.impl.SmkPsiUtil.getIdentifierNode 9 | 10 | abstract class SmkArgsSectionImpl(node: ASTNode): PyElementImpl(node), SmkArgsSection { 11 | override fun getName() = sectionKeyword 12 | 13 | override fun getSectionKeywordNode() = getIdentifierNode(node) 14 | 15 | override fun getPresentation() = getPresentation(this) 16 | override fun getIcon(flags: Int) = getIcon(this, flags) 17 | } -------------------------------------------------------------------------------- /src/test/resources/features/highlighting/inspections/weak_warning_for_pep_without_pepfile.feature: -------------------------------------------------------------------------------- 1 | Feature: Weak warning for pep.config without config file 2 | # TODO Feature not implemented 3 | @ignore 4 | Scenario: Weak warning if no config for pep.config 5 | Given a snakemake project 6 | Given I open a file "config.yaml" with text 7 | """ 8 | custom_key1: value 9 | custom_key2: value 10 | """ 11 | Given I open a file "foo.smk" with text 12 | """ 13 | a = pep.config.custom_key3 14 | """ 15 | And PyUnresolvedReferencesInspection inspection is enabled 16 | Then I expect inspection warning on in with message 17 | """ 18 | Cannot find reference 'custom_key3' in 'pep.config' 19 | """ 20 | When I check highlighting warnings 21 | -------------------------------------------------------------------------------- /src/test/resources/features/highlighting/inspections/subworkflow_redeclaration.feature: -------------------------------------------------------------------------------- 1 | Feature: SmkSubworkflowRedeclarationInspection inspection 2 | Scenario: A single SmkSubworkflowRedeclarationInspection 3 | Given a snakemake project 4 | Given I open a file "foo.smk" with text 5 | """ 6 | subworkflow NAME: 7 | snakefile: "snake.smk" 8 | 9 | subworkflow ANOTHER_NAME: 10 | snakefile: "foo.smk" 11 | 12 | subworkflow NAME: #overrides 13 | snakefile: "boo.smk" 14 | """ 15 | And SmkSubworkflowRedeclarationInspection inspection is enabled 16 | Then I expect inspection weak warning with message "Only last subworkflow with the same name will be executed" on 17 | """ 18 | subworkflow NAME: 19 | snakefile: "snake.smk" 20 | """ 21 | When I check highlighting weak warnings -------------------------------------------------------------------------------- /testData/psi/DocstringAtEndOfFile.txt: -------------------------------------------------------------------------------- 1 | SnakemakeFile: DocstringAtEndOfFile.smk 2 | SmkRule 3 | PsiElement(Py:RULE_KEYWORD)('rule') 4 | PsiWhiteSpace(' ') 5 | PsiElement(Py:IDENTIFIER)('boo') 6 | PsiElement(Py:COLON)(':') 7 | PyStatementList 8 | PsiWhiteSpace('\n ') 9 | SmkRuleOrCheckpointArgsSection 10 | PsiElement(Py:IDENTIFIER)('shell') 11 | PyArgumentList 12 | PsiElement(Py:COLON)(':') 13 | PsiWhiteSpace(' ') 14 | PyStringLiteralExpression: echo hello 15 | PsiElement(Py:SINGLE_QUOTED_STRING)('"echo hello"') 16 | PsiWhiteSpace('\n ') 17 | PyStringLiteralExpression: world 18 | PsiElement(Py:SINGLE_QUOTED_STRING)('"world"') 19 | PsiErrorElement:Docstring at end of file does not precede any statement 20 | -------------------------------------------------------------------------------- /testData/MockPackages3_smk_9.3.0/snakemake/ioutils/evaluate.py: -------------------------------------------------------------------------------- 1 | from snakemake.logging import format_dict 2 | from snakemake_interface_common.exceptions import WorkflowError 3 | 4 | 5 | def evaluate(expr: str): 6 | """Evaluate a python expression while replacing any wildcards given as 7 | {wildcardname} with the wildcard value represented as a string.""" 8 | 9 | def inner(wildcards): 10 | formatted = expr.format(**{w: repr(v) for w, v in wildcards.items()}) 11 | try: 12 | return eval(formatted, globals()) 13 | except Exception as e: 14 | raise WorkflowError( 15 | f"Failed to evaluate expression {expr} with wildcards {format_dict(wildcards)}. " 16 | f"Formatted expression: {formatted}", 17 | e, 18 | ) 19 | 20 | return inner 21 | -------------------------------------------------------------------------------- /testData/psi/RuleIncomplete1.txt: -------------------------------------------------------------------------------- 1 | SnakemakeFile: RuleIncomplete1.smk 2 | SmkRule 3 | PsiElement(Py:RULE_KEYWORD)('rule') 4 | PsiErrorElement:Rule name identifier or ':' expected 5 | 6 | PyStatementList 7 | 8 | PsiWhiteSpace('\n') 9 | SmkRule 10 | PsiElement(Py:RULE_KEYWORD)('rule') 11 | PsiWhiteSpace(' ') 12 | PsiElement(Py:IDENTIFIER)('my_rule') 13 | PsiElement(Py:COLON)(':') 14 | PyStatementList 15 | PsiWhiteSpace('\n ') 16 | SmkRuleOrCheckpointArgsSection 17 | PsiElement(Py:IDENTIFIER)('output') 18 | PyArgumentList 19 | PsiElement(Py:COLON)(':') 20 | PsiWhiteSpace(' ') 21 | PyStringLiteralExpression: out.txt 22 | PsiElement(Py:SINGLE_QUOTED_STRING)(''out.txt'') 23 | PsiElement(Py:COMMA)(',') -------------------------------------------------------------------------------- /testData/wrappers_storage/bio/bedtools/coveragebed/wrapper.py: -------------------------------------------------------------------------------- 1 | __author__ = "Patrik Smeds" 2 | __copyright__ = "Copyright 2019, Patrik Smeds" 3 | __email__ = "patrik.smeds@gmail.com" 4 | __license__ = "MIT" 5 | 6 | 7 | from snakemake.shell import shell 8 | 9 | shell.executable("bash") 10 | 11 | log = snakemake.log_fmt_shell(stdout=False, stderr=True) 12 | 13 | extra_params = snakemake.params.get("extra", "") 14 | 15 | input_a = snakemake.input.a 16 | input_b = snakemake.input.b 17 | 18 | output_file = snakemake.output[0] 19 | 20 | if not isinstance(output_file, str) and len(snakemake.output) != 1: 21 | raise ValueError("Output should be one file: " + str(output_file) + "!") 22 | 23 | shell( 24 | "coverageBed" 25 | " -a {input_a}" 26 | " -b {input_b}" 27 | " {extra_params}" 28 | " > {output_file}" 29 | " {log}" 30 | ) 31 | -------------------------------------------------------------------------------- /src/main/kotlin/com/jetbrains/snakecharm/lang/parser/SmkParsingScope.kt: -------------------------------------------------------------------------------- 1 | package com.jetbrains.snakecharm.lang.parser 2 | 3 | import com.jetbrains.python.parsing.ParsingScope 4 | 5 | /** 6 | * @author Roman.Chernyatchik 7 | * @date 2018-12-31 8 | */ 9 | class SmkParsingScope : ParsingScope() { 10 | // in onstart/onsuccess/onerror/run sections 11 | var inPythonicSection: Boolean = false 12 | private set 13 | 14 | override fun createInstance() = SmkParsingScope() 15 | 16 | fun withPythonicSection(): SmkParsingScope { 17 | val result = copy() 18 | result.inPythonicSection = true 19 | return result 20 | } 21 | 22 | override fun copy(): SmkParsingScope { 23 | val copy = super.copy() as SmkParsingScope 24 | copy.inPythonicSection = inPythonicSection 25 | return copy 26 | } 27 | } -------------------------------------------------------------------------------- /testData/psi/RuleMultipleSingleLineWithRuleSectionIndent.smk: -------------------------------------------------------------------------------- 1 | rule all1: input: foo1, 2 | foo0 3 | rule all2: input: foo1 4 | ,foo0 5 | rule all3: input: foo1, 6 | foo0, 7 | rule all4: input: foo1 8 | foo0 9 | rule all5: input: rule, 10 | rule 11 | rule all6: input: rule 12 | ,rule 13 | rule all7: input: rule, 14 | rule, 15 | rule all8: input: rule 16 | rule 17 | rule all9: input: foo1, 18 | foo0 19 | 5 + 5 20 | 21 | rule all10: input: foo1, 22 | foo0 23 | onsuccess: 24 | foo = 2 25 | 26 | rule all11: input: foo1, 27 | foo0 28 | wildcard_constraints: 29 | dataset="\d+" 30 | -------------------------------------------------------------------------------- /testData/stringLanguagePsi/MissingDot.txt: -------------------------------------------------------------------------------- 1 | FILE 2 | PsiElement(LBRACE)('{') 3 | SmkSLReferenceExpressionImpl: foo 4 | PsiElement(Py:IDENTIFIER)('foo') 5 | PsiErrorElement:Unexpected character 6 | PsiElement(BAD_CHARACTER)(' ') 7 | PsiErrorElement:Unexpected character 8 | PsiElement(BAD_CHARACTER)('boo') 9 | PsiElement(RBRACE)('}') 10 | SmkSLElementImpl(STRING_CONTENT) 11 | PsiElement(STRING_CONTENT)('\n') 12 | PsiElement(LBRACE)('{') 13 | SmkSLSubscriptionExpressionImpl(SUBSCRIPTION_EXPRESSION) 14 | SmkSLReferenceExpressionImpl: foo1 15 | PsiElement(Py:IDENTIFIER)('foo1') 16 | PsiElement(LBRACKET)('[') 17 | SmkSLSubscriptionKeyExpression: [key] 18 | PsiElement(ACCESS_KEY)('key') 19 | PsiElement(RBRACKET)(']') 20 | PsiErrorElement:Unexpected character 21 | PsiElement(BAD_CHARACTER)('foo2') 22 | PsiElement(RBRACE)('}') -------------------------------------------------------------------------------- /testData/psi/RuleIncomplete2.txt: -------------------------------------------------------------------------------- 1 | SnakemakeFile: RuleIncomplete2.smk 2 | SmkRule 3 | PsiElement(Py:RULE_KEYWORD)('rule') 4 | PsiWhiteSpace(' ') 5 | PsiElement(Py:IDENTIFIER)('foo') 6 | PsiErrorElement:':' expected 7 | 8 | PyStatementList 9 | 10 | PsiWhiteSpace('\n') 11 | SmkRule 12 | PsiElement(Py:RULE_KEYWORD)('rule') 13 | PsiWhiteSpace(' ') 14 | PsiElement(Py:IDENTIFIER)('my_rule') 15 | PsiElement(Py:COLON)(':') 16 | PyStatementList 17 | PsiWhiteSpace('\n ') 18 | SmkRuleOrCheckpointArgsSection 19 | PsiElement(Py:IDENTIFIER)('output') 20 | PyArgumentList 21 | PsiElement(Py:COLON)(':') 22 | PsiWhiteSpace(' ') 23 | PyStringLiteralExpression: out.txt 24 | PsiElement(Py:SINGLE_QUOTED_STRING)(''out.txt'') 25 | PsiElement(Py:COMMA)(',') -------------------------------------------------------------------------------- /testData/psi/Use.smk: -------------------------------------------------------------------------------- 1 | use rule a from my_module as b 2 | use rule a from my_module as b c d 3 | 4 | use rule f from other_module as f_z with: 5 | input: "data.csv" 6 | 7 | use rule f_z as x_z with: 8 | output: "dir/file.svg" 9 | use rule * from last_module1 as *_other 10 | use rule * from last_module2 as other_* 11 | use rule * from last_module3 as other_*_other 12 | use rule * from last_module4 13 | use rule * from last_module5 as other_* a b 14 | use rule * from last_module6 as *a*b*c 15 | use rule * from last_module7 as new* exclude a 16 | use rule a, b from m 17 | use rule a,b,c from m as *_other with: 18 | 19 | use rule rule from module as with: 20 | input: "text" 21 | 22 | use rule a as b with: output: "dataset" 23 | 24 | use rule * from M exclude a 25 | use rule * from M exclude a, b 26 | use rule * from M exclude a as new_* 27 | use rule * from M exclude a, b as new_* 28 | -------------------------------------------------------------------------------- /testData/wrappers_storage/bio/bcftools/reheader/wrapper.py: -------------------------------------------------------------------------------- 1 | __author__ = "Jan Forster" 2 | __copyright__ = "Copyright 2020, Jan Forster" 3 | __email__ = "j.forster@dkfz.de" 4 | __license__ = "MIT" 5 | 6 | 7 | from snakemake.shell import shell 8 | 9 | ## Extract arguments 10 | header = snakemake.input.get("header", "") 11 | if header: 12 | header_cmd = "-h " + header 13 | else: 14 | header_cmd = "" 15 | 16 | samples = snakemake.input.get("samples", "") 17 | if samples: 18 | samples_cmd = "-s " + samples 19 | else: 20 | samples_cmd = "" 21 | 22 | extra = snakemake.params.get("extra", "") 23 | view_extra = snakemake.params.get("view_extra", "") 24 | 25 | shell( 26 | "bcftools reheader " 27 | "{extra} " 28 | "{header_cmd} " 29 | "{samples_cmd} " 30 | "{snakemake.input.vcf} " 31 | "| bcftools view " 32 | "{view_extra} " 33 | "> {snakemake.output}" 34 | ) 35 | -------------------------------------------------------------------------------- /src/test/kotlin/com/jetbrains/snakecharm/SnakeFileTypeTest.kt: -------------------------------------------------------------------------------- 1 | package com.jetbrains.snakecharm 2 | 3 | import com.jetbrains.snakecharm.lang.psi.SmkFile 4 | 5 | /** 6 | * @author Roman.Chernyatchik 7 | * @date 2019-02-02 8 | */ 9 | class SnakeFileTypeTest : SnakemakeTestCase() { 10 | fun testSnakefile() { 11 | doTest("Snakefile") 12 | } 13 | 14 | fun testSmk() { 15 | doTest("file.smk") 16 | } 17 | 18 | fun testRule() { 19 | doTest("file.rule") 20 | } 21 | 22 | private fun doTest(fileName: String) { 23 | fixture!!.addFileToProject(fileName, "") 24 | fixture!!.configureByFile(fileName) 25 | val psiFile = fixture!!.file 26 | requireNotNull(psiFile) 27 | assertTrue(psiFile is SmkFile) 28 | 29 | val virtualFile = psiFile.virtualFile 30 | assertEquals(SmkFileType, virtualFile.fileType) 31 | } 32 | } -------------------------------------------------------------------------------- /src/main/kotlin/com/jetbrains/snakecharm/lang/parser/SmkParserDefinition.kt: -------------------------------------------------------------------------------- 1 | package com.jetbrains.snakecharm.lang.parser 2 | 3 | import com.intellij.lang.PsiParser 4 | import com.intellij.openapi.project.Project 5 | import com.intellij.psi.FileViewProvider 6 | import com.jetbrains.python.PythonParserDefinition 7 | import com.jetbrains.snakecharm.lang.SnakemakeLanguageDialect 8 | import com.jetbrains.snakecharm.lang.psi.SmkFile 9 | 10 | /** 11 | * @author Roman.Chernyatchik 12 | * @date 2018-12-31 13 | */ 14 | class SmkParserDefinition: PythonParserDefinition() { 15 | override fun createLexer(project: Project) = SnakemakeLexer() 16 | 17 | override fun createParser(project: Project): PsiParser = SnakemakeParser(project) 18 | 19 | override fun getFileNodeType() = SnakemakeLanguageDialect.fileElementType 20 | 21 | override fun createFile(viewProvider: FileViewProvider) = SmkFile(viewProvider) 22 | } -------------------------------------------------------------------------------- /src/test/resources/features/highlighting/pythonregexp_highlighting_in_wildcard_constraints_section.feature: -------------------------------------------------------------------------------- 1 | Feature: This feature checks reference highlighting in wildcard_constraints sections 2 | 3 | Scenario Outline: Highlight in 'wildcard_constraints' sections 4 | Given a snakemake project 5 | Given I open a file "foo.smk" with text 6 | """ 7 | 8 | wildcard_constraints: 9 | ="" 10 | """ 11 | When I put the caret after 12 | Then I expect language PythonRegExp injection on "" 13 | Examples: 14 | | rule_block | arg | pyredexp | 15 | | rule NAME: | dataset | \d+ | 16 | | rule NAME: | seqfile | \d+ | 17 | | rule NAME: | wildcard | \d+ | 18 | | | dataset | \d+ | 19 | | | seqfile | \d+ | 20 | | | wildcard | \d+ | -------------------------------------------------------------------------------- /src/main/kotlin/com/jetbrains/snakecharm/codeInsight/SmkCodeInsightScope.kt: -------------------------------------------------------------------------------- 1 | package com.jetbrains.snakecharm.codeInsight 2 | 3 | import com.intellij.psi.PsiElement 4 | import com.intellij.psi.util.PsiTreeUtil 5 | import com.jetbrains.snakecharm.lang.psi.SmkRunSection 6 | 7 | enum class SmkCodeInsightScope { 8 | TOP_LEVEL, 9 | RULELIKE_RUN_SECTION; 10 | // TODO: new scope for onstart/onsuccess/onerror handlers (3.6.0) ? or just implement 11 | 12 | fun includes(second: SmkCodeInsightScope) = when (this) { 13 | TOP_LEVEL -> second == TOP_LEVEL 14 | RULELIKE_RUN_SECTION -> second == TOP_LEVEL || second == RULELIKE_RUN_SECTION 15 | } 16 | 17 | companion object { 18 | operator fun get(anchor: PsiElement) = when { 19 | PsiTreeUtil.getParentOfType(anchor, SmkRunSection::class.java) != null -> RULELIKE_RUN_SECTION 20 | else -> TOP_LEVEL 21 | } 22 | } 23 | } -------------------------------------------------------------------------------- /testData/psi/RuleParamsListArgs.txt: -------------------------------------------------------------------------------- 1 | SnakemakeFile: RuleParamsListArgs.smk 2 | SmkRule 3 | PsiElement(Py:RULE_KEYWORD)('rule') 4 | PsiWhiteSpace(' ') 5 | PsiElement(Py:IDENTIFIER)('samtools_sort') 6 | PsiElement(Py:COLON)(':') 7 | PyStatementList 8 | PsiWhiteSpace('\n ') 9 | SmkRuleOrCheckpointArgsSection 10 | PsiElement(Py:IDENTIFIER)('input') 11 | PyArgumentList 12 | PsiElement(Py:COLON)(':') 13 | PsiWhiteSpace('\n ') 14 | PyStringLiteralExpression: foo 15 | PsiElement(Py:SINGLE_QUOTED_STRING)('"foo"') 16 | PsiWhiteSpace('\n ') 17 | SmkRuleOrCheckpointArgsSection 18 | PsiElement(Py:IDENTIFIER)('output') 19 | PyArgumentList 20 | PsiElement(Py:COLON)(':') 21 | PsiWhiteSpace(' ') 22 | PyStringLiteralExpression: boo 23 | PsiElement(Py:SINGLE_QUOTED_STRING)('"boo"') -------------------------------------------------------------------------------- /src/test/resources/features/findUsages/rules_and_checkpoints_find_usages.feature: -------------------------------------------------------------------------------- 1 | Feature: Find Usages for rules/checkpoints 2 | 3 | Scenario Outline: Usages for rule/checkpoint declaration name 4 | Given a snakemake project 5 | Given I open a file "foo.smk" with text 6 | """ 7 | foo: 8 | output: "out.txt" 9 | 10 | boo: 11 | input: s.foo 12 | 13 | localrules: foo 14 | """ 15 | When I put the caret after fo 16 | And I invoke find usages 17 | Then find usages shows me following references: 18 | | file | offset | length | 19 | | foo.smk | | | 20 | | foo.smk | | | 21 | Examples: 22 | | rule_like | offset1 | length1 | offset2 | length2 | 23 | | rule | 50 | 9 | 73 | 3 | 24 | | checkpoint | 62 | 15 | 91 | 3 | -------------------------------------------------------------------------------- /testData/psi/RuleInPythonBlock.txt: -------------------------------------------------------------------------------- 1 | SnakemakeFile: RuleInPythonBlock.smk 2 | PyFunction('foo') 3 | PsiElement(Py:DEF_KEYWORD)('def') 4 | PsiWhiteSpace(' ') 5 | PsiElement(Py:IDENTIFIER)('foo') 6 | PyParameterList 7 | PsiElement(Py:LPAR)('(') 8 | PsiElement(Py:RPAR)(')') 9 | PsiElement(Py:COLON)(':') 10 | PsiWhiteSpace('\n ') 11 | PyStatementList 12 | SmkRule 13 | PsiElement(Py:RULE_KEYWORD)('rule') 14 | PsiWhiteSpace(' ') 15 | PsiElement(Py:IDENTIFIER)('aa') 16 | PsiElement(Py:COLON)(':') 17 | PyStatementList 18 | PsiWhiteSpace('\n ') 19 | SmkRuleOrCheckpointArgsSection 20 | PsiElement(Py:IDENTIFIER)('output') 21 | PyArgumentList 22 | PsiElement(Py:COLON)(':') 23 | PsiWhiteSpace(' ') 24 | PyStringLiteralExpression: bb 25 | PsiElement(Py:SINGLE_QUOTED_STRING)('"bb"') -------------------------------------------------------------------------------- /src/main/kotlin/com/jetbrains/snakecharm/stringLanguage/lang/SmkSLBraceMatcher.kt: -------------------------------------------------------------------------------- 1 | package com.jetbrains.snakecharm.stringLanguage.lang 2 | 3 | import com.intellij.lang.BracePair 4 | import com.intellij.lang.PairedBraceMatcher 5 | import com.intellij.psi.PsiFile 6 | import com.intellij.psi.tree.IElementType 7 | import com.jetbrains.snakecharm.stringLanguage.lang.parser.SmkSLTokenTypes 8 | 9 | class SmkSLBraceMatcher : PairedBraceMatcher { 10 | override fun getCodeConstructStart(file: PsiFile?, openingBraceOffset: Int) = openingBraceOffset 11 | 12 | override fun getPairs() = myBraces 13 | 14 | override fun isPairedBracesAllowedBeforeType( 15 | lbraceType: IElementType, 16 | contextType: IElementType?) = true 17 | 18 | private val myBraces = arrayOf( 19 | BracePair(SmkSLTokenTypes.LBRACE, SmkSLTokenTypes.RBRACE, true), 20 | BracePair(SmkSLTokenTypes.LBRACKET, SmkSLTokenTypes.RBRACKET, true) 21 | ) 22 | 23 | } -------------------------------------------------------------------------------- /src/main/java/com/jetbrains/snakecharm/lang/psi/elementTypes/SmkStubElementTypes.java: -------------------------------------------------------------------------------- 1 | package com.jetbrains.snakecharm.lang.psi.elementTypes; 2 | 3 | import com.intellij.psi.stubs.IStubElementType; 4 | import com.jetbrains.snakecharm.lang.psi.*; 5 | import com.jetbrains.snakecharm.lang.psi.impl.stubs.*; 6 | import com.jetbrains.snakecharm.lang.psi.stubs.*; 7 | 8 | public interface SmkStubElementTypes { 9 | IStubElementType RULE_DECLARATION_STATEMENT = new SmkRuleElementType(); 10 | IStubElementType CHECKPOINT_DECLARATION_STATEMENT = new SmkCheckpointElementType(); 11 | IStubElementType SUBWORKFLOW_DECLARATION_STATEMENT = new SmkSubworkflowElementType(); 12 | IStubElementType MODULE_DECLARATION_STATEMENT = new SmkModuleElementType(); 13 | IStubElementType USE_DECLARATION_STATEMENT = new SmkUseElementType(); 14 | } 15 | -------------------------------------------------------------------------------- /src/main/kotlin/com/jetbrains/snakecharm/lang/validation/SmkReturnAnnotator.kt: -------------------------------------------------------------------------------- 1 | package com.jetbrains.snakecharm.lang.validation 2 | 3 | import com.intellij.psi.util.PsiTreeUtil 4 | import com.jetbrains.python.psi.PyElementVisitor 5 | import com.jetbrains.python.psi.PyReturnStatement 6 | import com.jetbrains.python.validation.ReturnAnnotator 7 | import com.jetbrains.snakecharm.lang.psi.SmkElementVisitor 8 | import com.jetbrains.snakecharm.lang.psi.SmkRunSection 9 | import com.jetbrains.snakecharm.lang.psi.SmkWorkflowPythonBlockSection 10 | 11 | 12 | object SmkReturnAnnotator : ReturnAnnotator(), SmkElementVisitor { 13 | override val pyElementVisitor: PyElementVisitor 14 | get() = this 15 | 16 | override fun visitPyReturnStatement(node: PyReturnStatement) { 17 | PsiTreeUtil.getParentOfType( 18 | node, SmkRunSection::class.java, SmkWorkflowPythonBlockSection::class.java 19 | ) ?: super.visitPyReturnStatement(node) 20 | } 21 | } -------------------------------------------------------------------------------- /src/test/resources/features/completion/subworkflow_name_completion.feature: -------------------------------------------------------------------------------- 1 | Feature: Completion for subworkflow name 2 | 3 | Scenario: Complete subworkflow name 4 | Given a snakemake project 5 | Given I open a file "foo.smk" with text 6 | """ 7 | subworkflow otherworkflow: 8 | workdir: 9 | "../path/to/otherworkflow" 10 | snakefile: 11 | "../path/to/otherworkflow/Snakefile" 12 | configfile: 13 | "path/to/custom_configfile.yaml" 14 | 15 | rule a: 16 | input: 17 | othe#here 18 | """ 19 | When I put the caret at #here 20 | Then I invoke autocompletion popup and see a text: 21 | """ 22 | subworkflow otherworkflow: 23 | workdir: 24 | "../path/to/otherworkflow" 25 | snakefile: 26 | "../path/to/otherworkflow/Snakefile" 27 | configfile: 28 | "path/to/custom_configfile.yaml" 29 | 30 | rule a: 31 | input: 32 | otherworkflow#here 33 | """ -------------------------------------------------------------------------------- /src/test/resources/features/actions/smk_code_block_provider.feature: -------------------------------------------------------------------------------- 1 | Feature: Code block provider test 2 | # See moveCaretToCodeBlockStart/moveCaretToCodeBlockEnd 3 | 4 | Scenario: Go to start of block 5 | Given a snakemake project 6 | Given I open a file "foo1.smk" with text 7 | """ 8 | rule shell_name: 9 | input: repeat("", 5) 10 | wildcard_constraints: wildcard="/d+1" 11 | """ 12 | When I put the caret after input: repeat("", 13 | When I invoke EditorCodeBlockStart action 14 | When I expect caret at input: repeat("", 5) 15 | 16 | 17 | Scenario: Go to end of block 18 | Given a snakemake project 19 | Given I open a file "foo1.smk" with text 20 | """ 21 | rule shell_name: 22 | input: repeat("", 5) 23 | wildcard_constraints: wildcard="/d+1" 24 | """ 25 | When I put the caret after wildcard_constraints: 26 | When I invoke EditorCodeBlockEnd action 27 | When I expect caret after wildcard="/d+1" -------------------------------------------------------------------------------- /testData/psi/Issue275_1.txt: -------------------------------------------------------------------------------- 1 | SnakemakeFile: Issue275_1.smk 2 | PyIfStatement 3 | PyIfPartIf 4 | PsiElement(Py:IF_KEYWORD)('if') 5 | PsiWhiteSpace(' ') 6 | PyBoolLiteralExpression 7 | PsiElement(Py:TRUE_KEYWORD)('True') 8 | PsiElement(Py:COLON)(':') 9 | PsiWhiteSpace('\n ') 10 | PyStatementList 11 | SmkRule 12 | PsiElement(Py:RULE_KEYWORD)('rule') 13 | PsiElement(Py:COLON)(':') 14 | PyStatementList 15 | PsiWhiteSpace('\n ') 16 | SmkRuleOrCheckpointArgsSection 17 | PsiElement(Py:IDENTIFIER)('shell') 18 | PyArgumentList 19 | PsiElement(Py:COLON)(':') 20 | PsiWhiteSpace(' ') 21 | PyStringLiteralExpression: 23 22 | PsiElement(Py:SINGLE_QUOTED_STRING)('"2"') 23 | PsiWhiteSpace('\n ') 24 | PsiElement(Py:SINGLE_QUOTED_STRING)('"3"') -------------------------------------------------------------------------------- /testData/psi/RuleParamsListArgsIncorrectIndentation.smk: -------------------------------------------------------------------------------- 1 | rule rule1: 2 | input: 3 | "file1.txt", 4 | "file2.txt" 5 | , "file3.txt", 6 | "file4.txt", 7 | "file5.txt" # correct indentation 8 | shell: "text" 9 | 10 | rule rule2: 11 | input: 12 | "file1.txt", 13 | "file2.txt" 14 | , "file3.txt" 15 | "file4.txt", 16 | "file5.txt" # incorrect indentation 17 | shell: "text" 18 | 19 | 20 | rule rule3: 21 | input: 22 | "file1.txt", 23 | "file2.txt" 24 | , "file3.txt" 25 | "file4.txt", 26 | "file5.txt" # parsed as a docstring 27 | shell: "text" 28 | 29 | rule rule4: 30 | input: 31 | "file1.txt", 32 | "file2.txt" 33 | , "file3.txt" 34 | "file4.txt", 35 | "file5.txt" # incorrect indentation 36 | shell: "text" 37 | -------------------------------------------------------------------------------- /src/test/resources/features/completion/py_code_completion.feature: -------------------------------------------------------------------------------- 1 | Feature: Completion in python part of snakemake file 2 | 3 | Scenario: Complete any python method 4 | Given a snakemake project 5 | Given I open a file "foo.smk" with text 6 | """ 7 | foo = 1; 8 | """ 9 | When I put the caret after foo = 1; 10 | And I invoke autocompletion popup 11 | Then completion list should contain: 12 | | print | 13 | 14 | Scenario Outline: Issue 8 15 | Given a snakemake project 16 | Given I open a file "foo.smk" with text 17 | """ 18 | def fa_files(wildcards): 19 | return ','.join(glob("{}/*.fa".format(config.fa_dir))) 20 | """ 21 | When I put the caret at 22 | And I invoke autocompletion popup 23 | Then completion list should contain: 24 | |