Thanks to visit codestin.com
Credit goes to github.com

Skip to content

Commit f8d5510

Browse files
Joseph Damibanicolaskruchten
Joseph Damiba
authored andcommitted
order ci script runs on proper set of r files
1 parent 59c6fe9 commit f8d5510

File tree

2 files changed

+9
-10
lines changed

2 files changed

+9
-10
lines changed

.circleci/config.yml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -60,7 +60,7 @@ jobs:
6060
python front-matter-ci.py _posts
6161
python check-or-enforce-order.py _posts/python
6262
python check-or-enforce-order.py _posts/python-v3
63-
python check-or-enforce-order.py _posts/r
63+
python check-or-enforce-order.py _posts/r/md/r
6464
python check-or-enforce-order.py _posts/plotly_js
6565
bundle exec jekyll build
6666
mkdir snapshots

front-matter-ci.py

Lines changed: 8 additions & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -53,11 +53,9 @@ def check_indexOverflow(meta_to_check):
5353
failures = []
5454
for meta in meta_to_check:
5555
# Check #4 - are there posts with order > 5 and 'page_type: example_index'?
56-
if "display_as" in meta and meta["display_as"] in categories:
57-
if "language" in meta and meta["language"] in languages:
58-
if "order" in meta and meta["order"] > 5:
59-
if "page_type" in meta and meta["page_type"] == "example_index":
60-
failures.append(meta["permalink"])
56+
if "order" in meta and meta["order"] > 5:
57+
if "page_type" in meta and meta["page_type"] == "example_index":
58+
failures.append(meta["permalink"])
6159
return "are there posts with order > 5 and 'page_type: example_index'?", failures
6260

6361

@@ -66,9 +64,7 @@ def check_postsWithNoThumbnail(meta_to_check):
6664
for meta in meta_to_check:
6765
# Check #5 - does every post have a thumbnail?
6866
if "thumbnail" not in meta:
69-
if "display_as" in meta and meta["display_as"] in categories:
70-
if "language" in meta and meta["language"] in languages:
71-
failures.append(meta["permalink"])
67+
failures.append(meta["permalink"])
7268
return "does every post have a thumbnail?", failures
7369

7470

@@ -108,7 +104,10 @@ def check_noTrailingSlash(meta_to_check):
108104
for path in paths:
109105
post = frontmatter.load(str(path))
110106
if len(post.metadata.keys()) > 0 and "jupyter" not in post.metadata:
111-
meta_to_check.append(post.metadata)
107+
meta = post.metadata
108+
if "display_as" in meta and meta["display_as"] in categories:
109+
if "language" in meta and meta["language"] in languages:
110+
meta_to_check.append(meta)
112111

113112

114113
print("Begin CI Checks!\n")

0 commit comments

Comments
 (0)