xpd new project
Create sgconfig.yml, xpd.yml and the rules, rule-tests and utils folders
Use xpd new project to start a folder of your own rules. It writes sgconfig.yml, xpd.yml,
and the rules, rule-tests and utils folders, with relative paths. Each --pack declares a
pack whose rules run on the files that import the module, or on every Python file with
--every-file. It stops when the folder already has sgconfig.yml.
With --format json it prints the files it wrote. In a folder named /tmp/project, that looks
like this.
$ xpd new project --pack team --yes --format json{"item":"project","createdFiles":["/tmp/project/sgconfig.yml","/tmp/project/xpd.yml","/tmp/project/rules/.gitkeep","/tmp/project/rule-tests/.gitkeep","/tmp/project/utils/.gitkeep","/tmp/project/rules/team/.gitkeep"],"modifiedFiles":[]}xpd new project [OPTIONS]Options
Section titled “Options”--pack
Section titled “--pack”--pack <MODULE>
A rule pack to declare, named after the module its rules are about.
Give it more than once to pass several values.
--every-file
Section titled “--every-file”--every-file
Run the new packs' rules on every Python file, not only on files that import the module.
--directory
Section titled “--directory”--directory <DIR>
The project folder, which holds sgconfig.yml. Nothing is written outside it. Default: the nearest folder at or above the current one with sgconfig.yml, or the current folder for a new project.
-y, --yes
Never ask. Fail when a required flag is missing.
--format
Section titled “--format”--format <FORMAT>
Print the result as text, or as JSON with createdFiles and modifiedFiles.
Default: text.
Values: text, json.