This file contains hidden or 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
| "lib/**/*.ex" | |
| |> Path.wildcard() | |
| |> Enum.filter(&File.regular?/1) | |
| |> Enum.filter(fn contract_path -> | |
| contract = File.read!(contract_path) | |
| legacy = String.contains?(contract, "Legacy") | |
| is_contract = String.contains?(contract, "@owner") | |
| has_callback = String.contains?(contract, "@callback") | |
| not legacy and is_contract and not has_callback |
This file contains hidden or 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
| defmodule Check do | |
| def run(source_file_pattern) do | |
| source_file_pattern | |
| |> get_files_from_wildcard() | |
| |> get_files_mods() | |
| |> filter_one_file_multiple_mods() | |
| |> print_errors() | |
| |> emit_exit_status() | |
| end |