Skip to content

Commit f484be8

Browse files
authored
dev: add ignore file matcher (#153)
* dev: add ignore file matcher * fix: lint issue
1 parent dad172a commit f484be8

File tree

22 files changed

+365
-86
lines changed

22 files changed

+365
-86
lines changed

.readmeignore

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,4 @@
1+
!**/node_modules/**/*
2+
!**/horrible/**/*
3+
!/node_modules/**/*
4+
!**/node_modules/nock/.github/**/*

__tests__/util.test.ts

Lines changed: 27 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -244,4 +244,31 @@ describe("Utility test suite", () => {
244244
it("test reason sanitizer replaces newline", () => {
245245
expect(util.sanitizeReason("this test\nhas newline")).toBe("this test has newline");
246246
});
247+
248+
it("test rrlog no crash", () => {
249+
expect(() => {
250+
util.rrlog("test log");
251+
}).not.toThrow();
252+
});
253+
254+
it("test get readme ignore no crash", () => {
255+
const worksapceDir = util.getGitHubWorkspace();
256+
const readmeIgnoreFilename = path.join(worksapceDir, "/horrible/.readmeignore");
257+
expect(() => {
258+
util.getReadmeIgnoreList(readmeIgnoreFilename);
259+
}).not.toThrow();
260+
});
261+
262+
it("test get readme ignore has correct content", () => {
263+
const worksapceDir = util.getGitHubWorkspace();
264+
const readmeIgnoreFilename = path.join(worksapceDir, "/horrible/.readmeignore");
265+
expect(util.getReadmeIgnoreList(readmeIgnoreFilename)).toContain("**/ignore/**/*.md");
266+
});
267+
268+
it("test file list getter no crash", () => {
269+
const worksapceDir = path.join(util.getGitHubWorkspace(), "/horrible");
270+
expect(() => {
271+
util.getLintFileList(worksapceDir);
272+
}).not.toThrow();
273+
});
247274
});

docs/api/assets/js/search.js

Lines changed: 1 addition & 1 deletion
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

docs/api/modules/_en_.html

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -91,7 +91,7 @@ <h3>generate<wbr>English<wbr>Lang<wbr>Report</h3>
9191
<li class="tsd-description">
9292
<aside class="tsd-sources">
9393
<ul>
94-
<li>Defined in en.ts:4</li>
94+
<li>Defined in <a href="https://github.com/tianhaoz95/readable-readme/blob/dad172a/src/en.ts#L4">en.ts:4</a></li>
9595
</ul>
9696
</aside>
9797
<h4 class="tsd-parameters-title">Parameters</h4>

docs/api/modules/_lint_.html

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -91,7 +91,7 @@ <h3>lint<wbr>Workspace</h3>
9191
<li class="tsd-description">
9292
<aside class="tsd-sources">
9393
<ul>
94-
<li>Defined in lint.ts:9</li>
94+
<li>Defined in <a href="https://github.com/tianhaoz95/readable-readme/blob/dad172a/src/lint.ts#L9">lint.ts:9</a></li>
9595
</ul>
9696
</aside>
9797
<h4 class="tsd-returns-title">Returns <span class="tsd-signature-type">Promise</span><span class="tsd-signature-symbol">&lt;</span><span class="tsd-signature-type">undefined</span><span class="tsd-signature-symbol"> | </span><span class="tsd-signature-type">"OK"</span><span class="tsd-signature-symbol">&gt;</span></h4>

docs/api/modules/_main_.html

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -91,7 +91,7 @@ <h3>main</h3>
9191
<li class="tsd-description">
9292
<aside class="tsd-sources">
9393
<ul>
94-
<li>Defined in main.ts:7</li>
94+
<li>Defined in <a href="https://github.com/tianhaoz95/readable-readme/blob/dad172a/src/main.ts#L7">main.ts:7</a></li>
9595
</ul>
9696
</aside>
9797
<div class="tsd-comment tsd-typography">

docs/api/modules/_octo_.html

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -95,7 +95,7 @@ <h3><span class="tsd-flag ts-flagConst">Const</span> octokit</h3>
9595
<div class="tsd-signature tsd-kind-icon">octokit<span class="tsd-signature-symbol">:</span> <span class="tsd-signature-type">GitHub</span><span class="tsd-signature-symbol"> =&nbsp;getOctokit()</span></div>
9696
<aside class="tsd-sources">
9797
<ul>
98-
<li>Defined in octo.ts:14</li>
98+
<li>Defined in <a href="https://github.com/tianhaoz95/readable-readme/blob/dad172a/src/octo.ts#L14">octo.ts:14</a></li>
9999
</ul>
100100
</aside>
101101
</section>
@@ -112,7 +112,7 @@ <h3>get<wbr>Octokit</h3>
112112
<li class="tsd-description">
113113
<aside class="tsd-sources">
114114
<ul>
115-
<li>Defined in octo.ts:5</li>
115+
<li>Defined in <a href="https://github.com/tianhaoz95/readable-readme/blob/dad172a/src/octo.ts#L5">octo.ts:5</a></li>
116116
</ul>
117117
</aside>
118118
<h4 class="tsd-returns-title">Returns <span class="tsd-signature-type">GitHub</span></h4>
@@ -129,7 +129,7 @@ <h3>match<wbr>Issue<wbr>Title</h3>
129129
<li class="tsd-description">
130130
<aside class="tsd-sources">
131131
<ul>
132-
<li>Defined in octo.ts:16</li>
132+
<li>Defined in <a href="https://github.com/tianhaoz95/readable-readme/blob/dad172a/src/octo.ts#L16">octo.ts:16</a></li>
133133
</ul>
134134
</aside>
135135
<h4 class="tsd-parameters-title">Parameters</h4>
@@ -158,7 +158,7 @@ <h3>post<wbr>Git<wbr>Hub<wbr>Issue</h3>
158158
<li class="tsd-description">
159159
<aside class="tsd-sources">
160160
<ul>
161-
<li>Defined in octo.ts:40</li>
161+
<li>Defined in <a href="https://github.com/tianhaoz95/readable-readme/blob/dad172a/src/octo.ts#L40">octo.ts:40</a></li>
162162
</ul>
163163
</aside>
164164
<h4 class="tsd-parameters-title">Parameters</h4>

docs/api/modules/_report_.html

Lines changed: 5 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -95,7 +95,7 @@ <h3>compile<wbr>Snippet</h3>
9595
<li class="tsd-description">
9696
<aside class="tsd-sources">
9797
<ul>
98-
<li>Defined in report.ts:107</li>
98+
<li>Defined in <a href="https://github.com/tianhaoz95/readable-readme/blob/dad172a/src/report.ts#L107">report.ts:107</a></li>
9999
</ul>
100100
</aside>
101101
<div class="tsd-comment tsd-typography">
@@ -144,7 +144,7 @@ <h3>compose<wbr>Report<wbr>Metadata<wbr>ToParagraph</h3>
144144
<li class="tsd-description">
145145
<aside class="tsd-sources">
146146
<ul>
147-
<li>Defined in report.ts:10</li>
147+
<li>Defined in <a href="https://github.com/tianhaoz95/readable-readme/blob/dad172a/src/report.ts#L10">report.ts:10</a></li>
148148
</ul>
149149
</aside>
150150
<div class="tsd-comment tsd-typography">
@@ -176,7 +176,7 @@ <h3>get<wbr>Snippet</h3>
176176
<li class="tsd-description">
177177
<aside class="tsd-sources">
178178
<ul>
179-
<li>Defined in report.ts:75</li>
179+
<li>Defined in <a href="https://github.com/tianhaoz95/readable-readme/blob/dad172a/src/report.ts#L75">report.ts:75</a></li>
180180
</ul>
181181
</aside>
182182
<div class="tsd-comment tsd-typography">
@@ -261,7 +261,7 @@ <h3>get<wbr>Teport<wbr>Issue<wbr>Title</h3>
261261
<li class="tsd-description">
262262
<aside class="tsd-sources">
263263
<ul>
264-
<li>Defined in report.ts:59</li>
264+
<li>Defined in <a href="https://github.com/tianhaoz95/readable-readme/blob/dad172a/src/report.ts#L59">report.ts:59</a></li>
265265
</ul>
266266
</aside>
267267
<div class="tsd-comment tsd-typography">
@@ -284,7 +284,7 @@ <h3>render<wbr>Snippet</h3>
284284
<li class="tsd-description">
285285
<aside class="tsd-sources">
286286
<ul>
287-
<li>Defined in report.ts:137</li>
287+
<li>Defined in <a href="https://github.com/tianhaoz95/readable-readme/blob/dad172a/src/report.ts#L137">report.ts:137</a></li>
288288
</ul>
289289
</aside>
290290
<div class="tsd-comment tsd-typography">

0 commit comments

Comments
 (0)