-
-
Notifications
You must be signed in to change notification settings - Fork 14
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
lint(validators): extract required file checks to modules
The validation that checked if required files were present was done in the `lint.nim` file. To better separate concerns, these file checks have been moved to their own modules. The validation helper proc to check for required files has been moved to the validators module.
- Loading branch information
1 parent
9344646
commit 81df2d5
Showing
5 changed files
with
58 additions
and
57 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,15 @@ | ||
import std/os | ||
import "."/validators | ||
|
||
proc conceptFilesExist*(trackDir: string): bool = | ||
## Returns true if every subdirectory in `trackDir/concepts` has the required | ||
## files. | ||
const | ||
requiredConceptFiles = [ | ||
"about.md", | ||
"introduction.md", | ||
"links.json", | ||
] | ||
|
||
let conceptsDir = trackDir / "concepts" | ||
result = subdirsContain(conceptsDir, requiredConceptFiles) |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters