Skip to content

Commit b123500

Browse files
committed
1 parent d510432 commit b123500

File tree

3 files changed

+60
-2
lines changed

3 files changed

+60
-2
lines changed

.github/workflows/lint.yml

+4-2
Original file line numberDiff line numberDiff line change
@@ -2,9 +2,11 @@ name: Tool linting
22

33
on:
44
push:
5-
branches: [ master ]
5+
branches: [ main ]
66
pull_request:
7-
branches: [ master ]
7+
branches: [ main ]
8+
# Allows you to run this workflow manually from the Actions tab
9+
workflow_dispatch:
810

911
jobs:
1012
build:

Makefile

+52
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,52 @@
1+
YAML_FILES := $(wildcard *.yaml)
2+
LOCK_FILES := $(wildcard *.yaml.lock)
3+
LINTED_YAMLS := $(YAML_FILES:=.lint)
4+
UPDATED_YAMLS := $(YAML_FILES:=.update)
5+
CORRECT_YAMLS := $(YAML_FILES:=.fix)
6+
INSTALL_YAMLS := $(LOCK_FILES:=.install)
7+
UPDATE_TRUSTED_IUC := $(LOCK_FILES:.lock=.update_trusted_iuc)
8+
9+
GALAXY_SERVER :=
10+
11+
12+
help:
13+
@egrep '^[a-zA-Z_-]+:.*?## .*$$' $(MAKEFILE_LIST) | awk 'BEGIN {FS = ":.*?## "}; {printf "\033[36m%-16s\033[0m %s\n", $$1, $$2}'
14+
15+
lint: $(LINTED_YAMLS) ## Lint the yaml files
16+
fix: $(CORRECT_YAMLS) ## Fix any issues (missing hashes, missing lockfiles, etc.)
17+
install: $(INSTALL_YAMLS) ## Install the tools in our galaxy
18+
19+
%.lint: %
20+
python3 scripts/fix-lockfile.py $<
21+
pykwalify -d $< -s .schema.yaml
22+
python3 scripts/identify-unpinned.py $<
23+
24+
%.fix: %
25+
@# Generates the lockfile or updates it if it is missing tools
26+
python3 scripts/fix-lockfile.py $<
27+
@# --without says only add those hashes for those missing hashes (i.e. new tools)
28+
python3 scripts/update-tool.py $< --without
29+
30+
%.install: %
31+
@echo "Installing any updated versions of $<"
32+
@-shed-tools install --install_resolver_dependencies --toolsfile $< --galaxy $(GALAXY_SERVER) --api_key $(GALAXY_API_KEY) 2>&1 | tee -a report.log
33+
34+
pr_check:
35+
for changed_yaml in `git diff remotes/origin/master --name-only | grep .yaml$$`; do python scripts/pr-check.py $${changed_yaml} && pykwalify -d $${changed_yaml} -s .schema.yaml ; done
36+
37+
update_trusted: $(UPDATE_TRUSTED_IUC) ## Run the update script
38+
@# Missing --without, so this updates all tools in the file.
39+
python3 scripts/update-tool.py tools_iuc.yaml
40+
41+
update_all: $(UPDATED_YAMLS)
42+
43+
%.update: ## Update all of the tools
44+
@# Missing --without, so this updates all tools in the file.
45+
python3 scripts/update-tool.py $<
46+
47+
%.update_trusted_iuc: %
48+
@# Update any tools owned by IUC in any other yaml file
49+
python3 scripts/update-tool.py --owner iuc $<
50+
51+
52+
.PHONY: pr_check lint update_trusted help

requirements.txt

+4
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,4 @@
1+
bioblend
2+
ephemeris
3+
pykwalify==1.7.0
4+
PyYAML>=4.2b1

0 commit comments

Comments
 (0)