Skip to content

Commit 0cdead1

Browse files
authored
Merge pull request #1 from TheRawMeatball/derive-component-conflict-resolve
2 parents c76b48e + d4ac8fd commit 0cdead1

File tree

303 files changed

+6922
-3768
lines changed

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

303 files changed

+6922
-3768
lines changed

.cargo/config_fast_builds

Lines changed: 4 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -12,9 +12,12 @@ rustflags = ["-Clink-arg=-fuse-ld=lld", "-Zshare-generics=y"]
1212
[target.x86_64-apple-darwin]
1313
rustflags = ["-C", "link-arg=-fuse-ld=/usr/local/bin/zld", "-Zshare-generics=y"]
1414

15+
[target.aarch64-apple-darwin]
16+
rustflags = ["-C", "link-arg=-fuse-ld=/usr/local/bin/zld", "-Zshare-generics=y"]
17+
1518
[target.x86_64-pc-windows-msvc]
1619
linker = "rust-lld.exe"
17-
rustflags = ["-Zshare-generics=y"]
20+
rustflags = ["-Zshare-generics=n"]
1821

1922
# Optional: Uncommenting the following improves compile times, but reduces the amount of debug info to 'line number tables only'
2023
# In most cases the gains are negligible, but if you are on macos and have slow compile times you should see significant gains.

.gitattributes

Lines changed: 18 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,18 @@
1+
# From: https://docs.github.com/en/github/getting-started-with-github/configuring-git-to-handle-line-endings
2+
# Set the default behavior, in case people don't have core.autocrlf set.
3+
* text=auto
4+
5+
# Explicitly declare text files you want to always be normalized and converted
6+
# to native line endings on checkout.
7+
*.rs text eof=lf
8+
*.toml text eof=lf
9+
*.frag text
10+
*.vert text
11+
12+
# Declare files that will always have CRLF line endings on checkout.
13+
*.sln text eol=crlf
14+
15+
# Denote all files that are truly binary and should not be modified.
16+
*.png binary
17+
*.jpg binary
18+
*.ttf binary

.github/CONTRIBUTING.md

Lines changed: 0 additions & 4 deletions
This file was deleted.

.github/ISSUE_TEMPLATE/bug_report.md

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -2,7 +2,7 @@
22
name: Bug Report
33
about: Report a bug to help us improve!
44
title: ''
5-
labels: bug, needs-triage
5+
labels: C-Bug, S-Needs-Triage
66
assignees: ''
77
---
88

.github/ISSUE_TEMPLATE/docs_improvement.md

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -2,7 +2,7 @@
22
name: Docs Improvement
33
about: Help us write better docs to catch common issues!
44
title: ''
5-
labels: documentation, needs-triage
5+
labels: C-Docs, S-Needs-Triage
66
assignees: ''
77
---
88

.github/ISSUE_TEMPLATE/feature_request.md

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -2,7 +2,7 @@
22
name: Feature Request
33
about: Propose a new feature!
44
title: ''
5-
labels: enhancement, needs-triage
5+
labels: C-Enhancement, S-Needs-Triage
66
assignees: ''
77
---
88

.github/bors.toml

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -11,6 +11,10 @@ status = [
1111
"run-examples",
1212
"check-doc",
1313
"check-missing-examples-in-docs",
14+
"check-unused-dependencies",
15+
"ci",
16+
"check-benches",
1417
]
1518

1619
use_squash_merge = true
20+
block_labels = ["S-Pre-Relicense"]
Lines changed: 12 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,12 @@
1+
# Style guide: Engine
2+
3+
For more advice on contributing to the engine, see the [relevant section](../../CONTRIBUTING.md#Contributing-your-own-ideas) of CONTRIBUTING.md.
4+
5+
1. Prefer granular imports over glob imports of `bevy::prelude::*` and `bevy::sub_crate::*`.
6+
2. Use a consistent comment style:
7+
1. `///` doc comments belong above `#[derive(Trait)]` invocations.
8+
2. `//` comments should generally go above the line in question, rather than in-line.
9+
3. Avoid `/* */` block comments, even when writing long comments.
10+
4. Use \`variable_name\` code blocks in comments to signify that you're referring to specific types and variables.
11+
5. Start comments with capital letters. End them with a period if they are sentence-like.
12+
3. Use comments to organize long and complex stretches of code that can't sensibly be refactored into separate functions.
Lines changed: 64 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,64 @@
1+
# Style guide: Examples
2+
3+
For more advice on writing examples, see the [relevant section](../../CONTRIBUTING.md#writing-examples) of CONTRIBUTING.md.
4+
5+
## Organization
6+
7+
1. Examples should live in an appropriate subfolder of `/examples`.
8+
2. Examples should be a single file if possible.
9+
3. Assets live in `./assets`. Try to avoid adding new assets unless strictly necessary to keep the repo small. Don't add "large" asset files.
10+
4. Each example should try to follow this order:
11+
1. Imports
12+
2. A `fn main()` block
13+
3. Example logic
14+
4. \[Optional\] Tests
15+
5. Try to structure app / plugin construction in the same fashion as the actual code.
16+
17+
## Stylistic preferences
18+
19+
1. Use simple, descriptive variable names.
20+
1. Avoid names like `MyComponent` in favor of more descriptive terms like `Events`.
21+
2. Prefer single letter differentiators like `EventsA` and `EventsB` to nonsense words like `EventsFoo` and `EventsBar`.
22+
3. Avoid repeating the type of variables in their name where possible. For example, `Color` should be preferred to `ColorComponent`.
23+
2. Prefer glob imports of `bevy::prelude::*` and `bevy::sub_crate::*` over granular imports (for terseness).
24+
3. Use a consistent comment style:
25+
1. `///` doc comments belong above `#[derive(Trait)]` invocations.
26+
2. `//` comments should generally go above the line in question, rather than in-line.
27+
3. Avoid `/* */` block comments, even when writing long comments.
28+
4. Use \`variable_name\` code blocks in comments to signify that you're referring to specific types and variables.
29+
5. Start comments with capital letters; end them with a period if they are sentence-like.
30+
4. Use comments to organize long and complex stretches of code that can't sensibly be refactored into separate functions.
31+
5. Avoid making variables `pub` unless it is needed for your example.
32+
33+
## Code conventions
34+
35+
1. Refactor configurable values ("magic numbers") out into constants with clear names.
36+
2. Prefer `for` loops over `.for_each`. The latter is faster (for now), but it is less clear for beginners, less idiomatic, and less flexible.
37+
3. Use `.single` and `.single_mut` where appropriate.
38+
4. In Queries, prefer `With<T>` filters over actually fetching unused data with `&T`.
39+
5. Prefer disjoint queries using `With` and `Without` over query sets when you need more than one query in a single system.
40+
6. Prefer structs with named fields over tuple structs except in the case of single-field wrapper types.
41+
7. Use enum-labels over string-labels for system / stage / etc. labels.
42+
43+
## "Feature" examples
44+
45+
These examples demonstrate the usage of specific engine features in clear, minimal ways.
46+
47+
1. Focus on demonstrating exactly one feature in an example
48+
2. Try to keep your names divorced from the context of a specific game, and focused on the feature you are demonstrating.
49+
3. Where they exist, show good alternative approaches to accomplish the same task and explain why you may prefer one over the other.
50+
4. Examples should have a visible effect when run, either in the command line or a graphical window.
51+
52+
## "Game" examples
53+
54+
These examples show how to build simple games in Bevy in a cohesive way.
55+
56+
1. Each of these examples lives in the [/examples/games] folder.
57+
2. Aim for minimum but viable status: the game should be playable and not obviously buggy but does not need to be polished, featureful, or terribly fun.
58+
3. Focus on code quality and demonstrating good, extensible patterns for users.
59+
1. Make good use of enums and states to organize your game logic.
60+
2. Keep components as small as possible but no smaller: all of the data on a component should generally be accessed at once.
61+
3. Keep systems small: they should have a clear single purpose.
62+
4. Avoid duplicating logic across similar entities whenever possible by sharing systems and components.
63+
4. Use `///` doc comments to explain what each function / struct does as if the example were part of a polished production codebase.
64+
5. Arrange your code into modules within the same file to allow for simple code folding / organization.

.github/dependabot.yml

Lines changed: 4 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -4,8 +4,11 @@ updates:
44
directory: /
55
schedule:
66
interval: weekly
7-
7+
labels:
8+
- "C-Dependencies"
89
- package-ecosystem: github-actions
910
directory: /
1011
schedule:
1112
interval: weekly
13+
labels:
14+
- "C-Dependencies"

.github/label-config.yml

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,5 @@
1+
# Config for the label workflow
2+
# Schema: https://github.com/actions/labeler#create-githublabeleryml
3+
4+
S-Needs-Triage:
5+
- "**"

0 commit comments

Comments
 (0)