- Limit lines to 100 characters.
- Order for any entry: same as in the manifest format documentation;
- When using a multi-line block, put the opening and closing braces or brackets on their own lines, and indent with four spaces.
- prefer use double quotes instead of single quotes,
TODO: Why cargo creates tample with single quotes for thepackage.edition
and double quotes for the rest?
- order sections for manifest:
package
,lib
,bin
,example
,test
,bench
,dependencies
,dev-dependencies
,build-dependencies
,target
,badges
,features
,replace
,patch
,profile
,workspace
;
- sections should be separated by a single blank line.
- order for
package
:name
,version
,authors
,edition
,description
,documentation
,readme
,homepage
,repository
,license
,license-file
,keywords
,categories
,workspace
,build
,links
,exclude
,include
,publish
,metadata
,default-run
,autobins
,autoexamples
,autotests
,autobenches
;
description
is single sentence, starts with a capital letter, no dot at the end,- inline level for
metadata
: None.
- order for target tables:
lib
,bin
,example
,test
,bench
;
- order for each target table:
name
,path
,test
,doctest
,bench
,doc
,plugin
,proc-macro
,harness
,edition
,crate-type
,required-features
.
- order for dependencies tables:
dependencies
,dev-dependencies
,build-dependencies
,target
;
- order for each dependency table:
version
,git
orpath
orregistry
,branch
orrev
ortag
,package
,optional
,default-features
,features
.
- order for
badges
:appveyor
,circle-ci
,cirrus-ci
,gitlab
,azure-devops
,travis-ci
,bitbucket-pipelines
,codecov
,coveralls
,is-it-maintained-issue-resolution
,is-it-maintained-open-issues
,maintenance
;
- order for each badge:
repository
orproject
,branch
orpipeline
,service
orbuild
;
- inline level for
badges
: 1.
- order for
features
:Alphabetic
,default
;
- inline level for
features
: 1, - features should never be negative (e.g., foo is good, no-foo is bad),
- features should be named using kebab-case,
- prefer short but descriptive feature names,
- prefer not to have default features.
- order for
profile
:dev
,release
,test
,bench
;
- order for each entry in
profile
:opt-level
,debug
,debug-assertions
,overflow-checks
,lto
,panic
,incremental
,codegen-units
,rpath
;
- order for
workspace
:members
,default-members
,exclude
;
- order for each entry in
workspace
:Alphabetic
.
# This is comment 0 for `a`.
[a]
# This is comment 0 for `a.b`.
# This is comment 1 for `a.b`.
# This is comment 2 for `a.b`.
b = "1.0.0" # This is comment 3 for `a.b`.
c = "0.1.0" # This is comment 0 for `a.c`.