diff --git a/CONTRIBUTING.md b/CONTRIBUTING.md index 62119ae9..a0376451 100644 --- a/CONTRIBUTING.md +++ b/CONTRIBUTING.md @@ -63,6 +63,36 @@ We welcome contributions via: - ✅ **Update Documentation:** If your change affects functionality or usage, update relevant documentation. - ✅ **Confirm Licensing:** By submitting a PR, you agree to license your contribution under the project's license. +## Formatting, linting and testing requirements + +1. Build the project and verify internal links: + + ```bash + npm run build + ``` + +2. Run formatting, linting, and type‑checking: + + ```bash + npm run format && npm run lint && npm run typecheck + ``` + +3. Validate external links using [lychee](https://github.com/lycheeverse/lychee): + + ```bash + lychee --config lychee.toml . + ``` + +4. (Optional) If you’ve added or modified scripts under any `examples/developer-hub-*/` directory, navigate into that example’s folder and run its formatter and test suite. + See the example’s `README.md` for more instructions, e.g.: + + ```bash + cd examples/developer-hub-rust/ + cargo build + cargo fmt && cargo clippy --fix + cargo test + ``` + ## Diagrams Style Guide For consistency, follow these styles when creating or updating diagrams: diff --git a/automations/check_new_feed.py b/automations/check_new_feed.py index ab9056f2..a12a990a 100644 --- a/automations/check_new_feed.py +++ b/automations/check_new_feed.py @@ -131,6 +131,13 @@ def prettify_coin(coin: dict[str, Any]) -> str: ) +def parse_volume(vol_str: str) -> int: + """Parse volume string and return it as an integer.""" + if not vol_str[0] == "$": + raise ValueError(f"Invalid volume string: {vol_str}") + return int(vol_str.strip("$").replace(",", "")) + + def write_issue(coins: list[dict[str, Any]]) -> None: """Write the Markdown issue file.""" body = ["Coins matching criteria:\n"] @@ -169,6 +176,7 @@ def main() -> None: c["item"] for c in trending if c["item"].get("market_cap_rank", float("inf")) < MAX_MARKET_CAP_RANK + and parse_volume(c["item"]["data"]["total_volume"]) > 100_000_000 and c["item"]["symbol"] not in current_feeds ] if not candidates: