Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

[Merged by Bors] - Enable mdlint in CI #278

Closed
Closed
Show file tree
Hide file tree
Changes from all commits
Commits
Show all changes
38 commits
Select commit Hold shift + click to select a range
98197ec
Add markdownlint to CI
alice-i-cecile Feb 11, 2022
8737cfe
Add dead-link checking to CI
alice-i-cecile Feb 11, 2022
2aa6680
Clean up CI logic to adapt from bevyengine/bevy context
alice-i-cecile Feb 11, 2022
55dd01c
Ignore some mdlint rules
alice-i-cecile Feb 11, 2022
d973184
Ignore mdlint 40 due to presence of untyped error code blocks
alice-i-cecile Feb 11, 2022
f78bc51
Update CI to target master rather than main
alice-i-cecile Feb 11, 2022
d8eafdd
Allow trailing punctuation in headers to support Cart's enthusiasm
alice-i-cecile Feb 11, 2022
cacf645
Lint news posts
alice-i-cecile Feb 14, 2022
ad1471a
Merge branch 'new-book' into lints-and-links
alice-i-cecile Feb 14, 2022
c5de625
Lint 0.6 blog post
alice-i-cecile Feb 14, 2022
47268ef
Try alternate style for ignoring lints
alice-i-cecile Feb 14, 2022
34578a3
Move lint file into correct folder
alice-i-cecile Feb 14, 2022
dfdc4b5
Lint Bevy's first birthday
alice-i-cecile Feb 14, 2022
d4f4a92
Assorted linting
alice-i-cecile Feb 14, 2022
18ec461
Copy markdown-link rules from bevy repo
alice-i-cecile Feb 15, 2022
9246185
Lint for fenced-code-language
alice-i-cecile Feb 15, 2022
5b670cb
Add markdownlint to CI
alice-i-cecile Feb 11, 2022
59b99a7
Add dead-link checking to CI
alice-i-cecile Feb 11, 2022
63c18e0
Clean up CI logic to adapt from bevyengine/bevy context
alice-i-cecile Feb 11, 2022
57f0c9f
Ignore some mdlint rules
alice-i-cecile Feb 11, 2022
640fcbb
Ignore mdlint 40 due to presence of untyped error code blocks
alice-i-cecile Feb 11, 2022
9a03568
Update CI to target master rather than main
alice-i-cecile Feb 11, 2022
16339f5
Allow trailing punctuation in headers to support Cart's enthusiasm
alice-i-cecile Feb 11, 2022
2a4a9be
Lint news posts
alice-i-cecile Feb 14, 2022
dfa2d15
Lint 0.6 blog post
alice-i-cecile Feb 14, 2022
d1fae70
Try alternate style for ignoring lints
alice-i-cecile Feb 14, 2022
1ef57c2
Move lint file into correct folder
alice-i-cecile Feb 14, 2022
319de76
Lint Bevy's first birthday
alice-i-cecile Feb 14, 2022
9cba18b
Assorted linting
alice-i-cecile Feb 14, 2022
0463506
Copy markdown-link rules from bevy repo
alice-i-cecile Feb 15, 2022
6a46e2c
Lint for fenced-code-language
alice-i-cecile Feb 15, 2022
ccd3163
Remove dead-link checking from this PR
alice-i-cecile Mar 11, 2022
eb48f3f
Merge remote-tracking branch 'origin/lints-and-links' into lints-and-…
alice-i-cecile Mar 11, 2022
7df8203
Add language to fenced code blocks
alice-i-cecile Mar 11, 2022
05cb8e4
Disable linting rules in local IDEs
alice-i-cecile Mar 11, 2022
ef3e9a5
Remove link-checking config
alice-i-cecile Mar 11, 2022
669804a
markdownlint must pass before bors will allow merging
alice-i-cecile Mar 11, 2022
496f7ac
Merge branch 'new-book' into lints-and-links
alice-i-cecile Mar 11, 2022
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
1 change: 1 addition & 0 deletions .github/bors.toml
Original file line number Diff line number Diff line change
@@ -1,5 +1,6 @@
status = [
"build",
"markdownlint",
]

use_squash_merge = true
7 changes: 7 additions & 0 deletions .github/linters/.markdown-lint.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,7 @@
# Keep synced with duplicate in project root

{
"line-length": false,
"no-inline-html": false,
"no-trailing-punctuation": false,
}
16 changes: 16 additions & 0 deletions .github/workflows/ci.yml
Original file line number Diff line number Diff line change
Expand Up @@ -35,6 +35,22 @@ jobs:
BUILD_ONLY: true
TOKEN: fake-secret

markdownlint:
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v2
with:
# Full git history is needed to get a proper list of changed files within `super-linter`
fetch-depth: 0
- name: Run Markdown Lint
uses: docker://ghcr.io/github/super-linter:slim-v4
env:
VALIDATE_ALL_CODEBASE: false
VALIDATE_MARKDOWN: true
DEFAULT_BRANCH: master
# Not needed here as only one Linter is used.
#GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}

test-code:
runs-on: ubuntu-latest
steps:
Expand Down
7 changes: 7 additions & 0 deletions .markdownlint.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,7 @@
# Keep synced with duplicate in .github/linters folder

{
"line-length": false,
"no-inline-html": false,
"no-trailing-punctuation": false,
}
2 changes: 1 addition & 1 deletion content/learn/book/assets/hot-reloading/_index.md
Original file line number Diff line number Diff line change
Expand Up @@ -9,4 +9,4 @@ insert_anchor_links = "right"

TODO: demonstrate how to watch for changes to automatically hot reload assets when modified

Steal from https://github.com/bevyengine/bevy/blob/main/examples/asset/hot_asset_reloading.rs
Steal from [hot reloading example](https://github.com/bevyengine/bevy/blob/main/examples/asset/hot_asset_reloading.rs)
12 changes: 6 additions & 6 deletions content/learn/book/development-practices/fast-compiles/_index.md
Original file line number Diff line number Diff line change
Expand Up @@ -29,15 +29,15 @@ TODO: explain why you might want faster compiles
* **Arch**: `sudo pacman -S lld`
* **Windows**: Ensure you have the latest [cargo-binutils](https://github.com/rust-embedded/cargo-binutils)

```sh
cargo install -f cargo-binutils
rustup component add llvm-tools-preview
```
```sh
cargo install -f cargo-binutils
rustup component add llvm-tools-preview
```

* **MacOS**: Modern LLD does not yet support MacOS, but we can use zld instead: `brew install michaeleisel/zld/zld`
* **MacOS**: Modern LLD does not yet support MacOS, but we can use zld instead: `brew install michaeleisel/zld/zld`
* **Nightly Rust Compiler**: This gives access to the latest performance improvements and "unstable" optimizations

```sh
```sh
# Install the nightly toolchain
rustup toolchain install nightly
# Configure your current project to use nightly (run this command within the project)
Expand Down
2 changes: 1 addition & 1 deletion content/learn/book/game-logic/system-ordering/_index.md
Original file line number Diff line number Diff line change
Expand Up @@ -16,4 +16,4 @@ TODO: explain SystemSets in the context of labels

TODO: explain ambiguities

Steal from https://github.com/bevyengine/bevy/blob/main/examples/ecs/ecs_guide.rs#L282
Steal from [ECS Guide](https://github.com/bevyengine/bevy/blob/main/examples/ecs/ecs_guide.rs#L282)
13 changes: 12 additions & 1 deletion content/learn/book/migration-guides/0.4-0.5/_index.md
Original file line number Diff line number Diff line change
Expand Up @@ -62,6 +62,7 @@ commands.entity(entity).despawn();
`commands.spawn()` no longer accepts any parameters. To spawn bundles, use `commands.spawn_bundle(bundle)`.

Similarly, rather than using `with(some_component)` to spawn an object with multiple components, you must now use `insert(some_component)`:

```rust
// 0.4
commands.spawn(some_bundle)
Expand All @@ -78,6 +79,7 @@ commands.spawn()
```

Removing and adding components on entities has also been changed:

```rust
// 0.4
commands.insert_one(some_entity, SomeComponent);
Expand Down Expand Up @@ -130,9 +132,11 @@ fn event_reader_system(mut my_event_reader: EventReader<MyEvent>) {
}
}
```

You no longer need two system parameters to read your events. One `EventReader` is sufficient.

Following the above example of using an `EventReader` to read events, you can now use `EventWriter` to create new ones.

```rust
// 0.4
fn event_writer_system(
Expand Down Expand Up @@ -188,7 +192,9 @@ TextBundle {
```

### Scene must now be specified when loading a GLTF scene

Previously, you were able to load a GLTF scene asset with only a path. Now, you must include a fragment specifying the scene you want to load. If you only have one scene in the file, it's `#Scene0`.

```rust
// 0.4
asset_server.load("models/foo.glb");
Expand Down Expand Up @@ -266,19 +272,23 @@ fn some_system(
```

### Cameras

`Camera3dBundle` is now known as `PerspectiveCameraBundle`, and `Camera2dBundle` is now known as `OrthographicCameraBundle`.

`OrthographicCameraBundle` does not implement `Default`, so to change its transform at spawn while keeping everything else the same, consider something like the following:

```rust
let mut camera = OrthographicCameraBundle::new_2d();
camera.transform = Transform::from_translation(Vec3::new(0.0, 0.0, 5.0));
commands.spawn_bundle(camera);
```

### Render API changes

`RasterizationStateDescriptor` no longer exists. Much of its functionality has been moved to other fields on `PipelineDescriptor`. `cull_mode`, for example, is now found in the `primitive: PrimitiveState` field.

Buffers of type `Vec<Color>` can no longer be uploaded to the GPU directly due to limitations with `RenderResources` and the new `Byteable` requirement. Consider using a `Vec<Vec4>` instead, and inserting colors with `as_rgba_f32()` and `.into()` instead:

```rust
#[derive(RenderResources, Default, TypeUuid)]
struct SomeShader {
Expand All @@ -292,6 +302,7 @@ fn add_some_color(shader: SomeShader, color: Color) {
```

### Shaders should now use `CameraViewProj`

The `ViewProj` matrix is now set via the name `CameraViewProj` rather than `Camera`. If you don't update this, bevy will fail silently and you won't be able to see anything!

```glsl
Expand All @@ -307,8 +318,8 @@ layout(set = 0, binding = 0) uniform CameraViewProj {
```

### Diagnostics
`PrintDiagnosticsPlugin` is now `LogDiagnosticsPlugin`.

`PrintDiagnosticsPlugin` is now `LogDiagnosticsPlugin`.

### System Ordering

Expand Down
5 changes: 3 additions & 2 deletions content/learn/book/migration-guides/0.5-0.6/_index.md
Original file line number Diff line number Diff line change
Expand Up @@ -284,7 +284,7 @@ This was done to accommodate the new [`SystemState`] which allows easier cached

### Vector casting functions are now named to match return type

The casting functions for [`IVec2`], [`DVec2`], [`UVec2`], and [`Vec2`] have all been changed from being named after their inner elements' cast target to what the entire "Vec" is being casted into. This affects all the different dimensions of the math vectors (i.e., [`Vec2`], [`Vec3` ]and [`Vec4`]).
The casting functions for [`IVec2`], [`DVec2`], [`UVec2`], and [`Vec2`] have all been changed from being named after their inner elements' cast target to what the entire "Vec" is being casted into. This affects all the different dimensions of the math vectors (i.e., [`Vec2`], [`Vec3`] and [`Vec4`]).

```rust
// 0.5
Expand Down Expand Up @@ -343,7 +343,8 @@ SpriteBundle {
[`SpriteBundle`]: https://docs.rs/bevy/0.6.0/bevy/sprite/struct.SpriteBundle.html
[`Sprite`]: https://docs.rs/bevy/0.6.0/bevy/sprite/struct.Sprite.html

### Visible is now Visibility
### Visible is now Visibility

The [`Visible`] struct, which is used in a number of components to set visibility, was renamed to [`Visibility`]. Additionally, the field `is_transparent` was removed from the struct. For 3D, transparency can be set using the `alpha_mode` field on a material. Transparency is now automatically enabled for all objects in 2D.

```rust
Expand Down
Loading