®
®
| import os | |
| import re | |
| BASE_DIR = os.path.dirname(os.path.abspath(__file__)) | |
| def find_md_files(base_dir): | |
| for root, dirs, files in os.walk(base_dir): | |
| for file in files: | |
| if file.endswith('.md'): | |
| yield os.path.join(root, file) |
| import os | |
| import re | |
| # 対象ディレクトリ(スクリプトのあるディレクトリ) | |
| BASE_DIR = os.path.dirname(os.path.abspath(__file__)) | |
| # .mdファイルを再帰的に探索 | |
| def find_md_files(base_dir): | |
| for root, dirs, files in os.walk(base_dir): | |
| for file in files: |
®
®
| diff --git forkSrcPrefix/.github/workflows/script/link_check.py forkDstPrefix/.github/workflows/script/link_check.py | |
| index 30c9286ddda25070b410322cbe047aaf6ef5071e..1943400b495f9f0d21b90335fbefe6255a4b6beb 100644 | |
| --- forkSrcPrefix/.github/workflows/script/link_check.py | |
| +++ forkDstPrefix/.github/workflows/script/link_check.py | |
| @@ -8,6 +8,7 @@ import requests | |
| import sys | |
| import time | |
| import random | |
| +import collections | |
| import glob | |
| import re | |
| def split_compiler_line(line: str) -> (bool, str, [str]): | |
| compilers = [ | |
| "- [Clang](/implementation.md#clang):", | |
| "- [GCC](/implementation.md#gcc):", | |
| "- [ICC](/implementation.md#icc):", | |
| "- [Visual C++](/implementation.md#visual_cpp):", | |
| ] |
| #include <string_view> | |
| #include <memory> | |
| #include <utility> | |
| class life_string_view { | |
| std::string_view _data; | |
| std::shared_ptr<void> _life; | |
| public: | |
| life_string_view(std::string_view sv) | |
| : _data{sv}, _life{} {} |
| # TODO : cpprefjp以外にも対応する | |
| import glob | |
| import re | |
| import os | |
| import sys | |
| from subprocess import Popen | |
| point_dict = { | |
| "cpprefjp/typo": 1, | |
| "cpprefjp/link": 2, |
| #include <iostream> | |
| #include <optional> | |
| #include <utility> | |
| #include <map> | |
| #include <vector> | |
| #include <algorithm> | |
| #include <iomanip> | |
| // key : x, y | |
| // value : nullopt:wall, 0:not yet discovered not 0:distance |
| #include <iostream> | |
| #include <string> | |
| template <class T, class F> | |
| auto dispatch(const T&, F&& f) { return f(); } | |
| template <class T, class A, class F, class... Args> | |
| auto dispatch(const T& target, A&& a, F&& f, Args&&... args) { | |
| if (target == a) return f(); | |
| return dispatch(target, std::forward<Args>(args)...); |