Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

[doc] Dir development should not ref other dirs content #9812

Merged
merged 1 commit into from
Apr 27, 2022
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
2 changes: 2 additions & 0 deletions .github/workflows/docs.yml
Original file line number Diff line number Diff line change
Expand Up @@ -39,6 +39,8 @@ jobs:
uses: actions/setup-python@v2
with:
python-version: 3.9
- name: Run Dev Relative Reference
run: python img_utils.py -v dev-syntax
- name: Run Image Check
run: python img_utils.py -v check
dead-link:
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -37,7 +37,7 @@ There are two ways to configure the DolphinScheduler development environment, st

> **_Note:_** Use standalone server only for development and debugging, because it uses H2 Database as default database and Zookeeper Testing Server which may not be stable in production.
> Standalone is only supported in DolphinScheduler 1.3.9 and later versions.
> Standalone server is able to connect to external databases like mysql and postgresql, see [Standalone Deployment](../guide/installation/standalone.md) for instructions.
> Standalone server is able to connect to external databases like mysql and postgresql, see [Standalone Deployment](https://dolphinscheduler.apache.org/en-us/docs/dev/user_doc/guide/installation/standalone.html) for instructions.

### Git Branch Choose

Expand Down
18 changes: 18 additions & 0 deletions docs/img_utils.py
Original file line number Diff line number Diff line change
Expand Up @@ -31,6 +31,8 @@
root_dir: Path = Path(__file__).parent
img_dir: Path = root_dir.joinpath("img")
doc_dir: Path = root_dir.joinpath("docs")
dev_en_dir: Path = doc_dir.joinpath("en", "development")
dev_zh_dir: Path = doc_dir.joinpath("zh", "development")


def get_files_recurse(path: Path) -> Set:
Expand Down Expand Up @@ -122,6 +124,17 @@ def prune() -> None:
del_empty_dir_recurse(img_dir)


def dev_syntax() -> None:
"""Check temp whether temporary do not support syntax in development."""
pattern = re.compile("(\\(\\.\\.[\\w./-]+\\))")
dev_files_path = get_files_recurse(dev_en_dir) | get_files_recurse(dev_zh_dir)
get_files_recurse(dev_en_dir)
for path in dev_files_path:
content = path.read_text()
find = pattern.findall(content)
assert not find, f"File {str(path)} contain temporary not support syntax: {find}."


def build_argparse() -> argparse.ArgumentParser:
"""Build argparse.ArgumentParser with specific configuration."""
parser = argparse.ArgumentParser(prog="img_utils")
Expand Down Expand Up @@ -150,6 +163,11 @@ def build_argparse() -> argparse.ArgumentParser:
)
parser_prune.set_defaults(func=prune)

parser_prune = subparsers.add_parser(
"dev-syntax", help="Check whether temporary does not support syntax in development directory."
)
parser_prune.set_defaults(func=dev_syntax)

# TODO Add subcommand `reorder`
return parser

Expand Down