Skip to content

Commit

Permalink
Add checking for bad TRS links
Browse files Browse the repository at this point in the history
  • Loading branch information
hexylena committed Apr 16, 2024
1 parent 8cc3b4a commit 2554e94
Show file tree
Hide file tree
Showing 3 changed files with 21 additions and 2 deletions.
19 changes: 19 additions & 0 deletions bin/lint.rb
Original file line number Diff line number Diff line change
Expand Up @@ -611,6 +611,24 @@ def self.check_bad_link(contents)
end
end

def self.check_bad_trs_link(contents)
find_matching_texts(contents, /snippet faqs\/galaxy\/workflows_run_trs.md path="([^"]*)"/i)
.map do |idx, _text, selected|
path = selected[1].to_s.strip
if !File.exist?(path)
ReviewDogEmitter.error(
path: @path,
idx: idx,
match_start: selected.begin(0),
match_end: selected.end(0),
replacement: nil,
message: "The linked file (`#{path}`) could not be found.",
code: 'GTN:036'
)
end
end
end

def self.check_looks_like_heading(contents)
# TODO: we should remove this someday, but, we need to have a good solution
# and we're still a ways from that.
Expand Down Expand Up @@ -806,6 +824,7 @@ def self.fix_md(contents)
*snippets_too_close_together(contents),
*zenodo_api(contents),
*empty_alt_text(contents),
*check_bad_trs_link(contents),
*nonsemantic_list(contents)
]
end
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -62,7 +62,7 @@ We will start by importing this workflow into your Galaxy account:
>
> 1. **Import the workflow** into Galaxy
>
> {% snippet faqs/galaxy/workflows_run_trs.md path="/topics/galaxy-interface/tutorials/workflow-reports/workflows/galaxy-101-everyone.ga" title="Galaxy 101 for Everyone" %}
> {% snippet faqs/galaxy/workflows_run_trs.md path="topics/galaxy-interface/tutorials/workflow-reports/workflows/galaxy-101-everyone.ga" title="Galaxy 101 for Everyone" %}
>
>
{: .hands_on}
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -256,7 +256,7 @@ In this section, you can run the RetroSynthesis Workflow more easily and fastly
>
> 1. Import the workflow into Galaxy
>
> {% snippet faqs/galaxy/workflows_run_trs.md path="topics/synthetic-biology/tutorials/basic_assembly_analysis/workflows/RetroSynthesis.ga" title="RetroSynthesis workflow" %}
> {% snippet faqs/galaxy/workflows_run_trs.md path="topics/synthetic-biology/tutorials/basic_assembly_analysis/workflows/Genetic_Design_BASIC_Assembly.ga" title="RetroSynthesis workflow" %}
>
> 2. Click on *Workflow* on the top menu bar of Galaxy. You will see **RetroSynthesis** workflow.
> 3. Click on the {% icon workflow-run %} (*Run workflow*) button next to your workflow
Expand Down

0 comments on commit 2554e94

Please sign in to comment.