This document provides guidelines for maintaining high-quality Rust code. These rules MUST be followed by all AI coding agents and contributors.
All code you write MUST be fully optimized.
"Fully optimized" includes:
| import itertools, pathlib, sys, time | |
| THIS_DIR = pathlib.Path(__file__).parent | |
| SRC_IMAGE_PATH = THIS_DIR / "dragon5.png" | |
| BRIGHTNESS_ENHANCE_FACTOR = 1.0 | |
| CONTRAST_ENHANCE_FACTOR = 1.1 | |
| # from draftsman.env import update | |
| # update(verbose=True, path=r"C:\Users\david\AppData\Roaming\Factorio\mods") | |
| # ^busted because custom loader struggles mit Krastorio2 lua lib directory layout... f |
| import xml.etree.ElementTree as XmlET | |
| from pathlib import Path | |
| STEAMLIB_DIR = "C:/Program Files (x86)/Steam" | |
| RWR_INSTALL_DIR = Path(STEAMLIB_DIR) / "steamapps/common/RunningWithRifles" | |
| VANILLA_PKG_DIR = RWR_INSTALL_DIR / f"media/packages/vanilla" | |
| VANILLA_PKG_VEHICLES_DIR = VANILLA_PKG_DIR / "vehicles" | |
| CRATE_COLLECTIONS = ["special_crates*.xml", "airdrop_supply_crates.xml"] |
| import xml.etree.ElementTree as XmlET | |
| from pathlib import Path | |
| STEAMLIB_DIR = "C:/Program Files (x86)/Steam" | |
| RWR_INSTALL_DIR = Path(STEAMLIB_DIR) / "steamapps/common/RunningWithRifles" | |
| VANILLA_PKG_DIR = RWR_INSTALL_DIR / f"media/packages/vanilla" | |
| VANILLA_PKG_WEAPONS_DIR = VANILLA_PKG_DIR / "weapons" |
| from dataclasses import dataclass | |
| from pathlib import Path | |
| import xml.etree.ElementTree as XmlET | |
| import bpy | |
| STEAMLIB_DIR = """C:\Program Files (x86)\Steam""" | |
| PACKAGE_NAME = "vanilla" |
| from dataclasses import dataclass | |
| from pathlib import Path | |
| import xml.etree.ElementTree as XmlET | |
| import bpy | |
| STEAMLIB_DIR = """C:\Program Files (x86)\Steam""" | |
| PACKAGE_NAME = "vanilla" |
| import sys | |
| import xml.etree.ElementTree as XmlET | |
| from pathlib import Path | |
| from statistics import fmean | |
| if __name__ == '__main__': | |
| if (l := len(sys.argv)) != 2: | |
| print(f"Error: incorrect number of parameters provided: expected 1, got {l-1}") | |
| sys.exit(1) |
map.png to mark potential special crate locations, possible ice cream spawns, cargo vehicle locations, etc| import sys, time, hashlib, zipfile | |
| from collections import Counter | |
| from pathlib import Path | |
| import xml.etree.ElementTree as XmlET | |
| script_dir = Path(__file__).parent | |
| salt_file = script_dir / "salt.txt" | |
| salt_info = "A salt is required for the hash function used to protect the player SIDs.\n" \ | |
| "This salt must remain constant once set in order for alts to be coalesced " \ |
| pyside6-genpyi all --feature snake_case true_property |