Skip to content

Instantly share code, notes, and snippets.

@mhagrelius
Created September 26, 2019 01:06
Show Gist options
  • Save mhagrelius/c305aa0b793dee4520e8d5edf96fe5a6 to your computer and use it in GitHub Desktop.
Save mhagrelius/c305aa0b793dee4520e8d5edf96fe5a6 to your computer and use it in GitHub Desktop.
Test for adherence to clean architecture guidelines
#!/bin/bash
RESULT=$(grep -r -i --include \*.cs --include \*.cshtml --exclude Startup.cs --exclude /bin/\* --exclude /obj/\* --exclude /Configuration/\*.cs "Infrastructure.Namespace.Here" FolderNameHere)
if [ -z "$RESULT" ]
then
echo $RESULT
exit 1
fi
echo "No issues found."
exit 0
@mhagrelius
Copy link
Author

See Clean Architecture Writeup. This script helps enforce only references to Core interfaces/abstractions instead of concrete Infrastructure classes outside of configuration areas (e.g. when wiring up DI Container, etc)

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment