Skip to content

Commit

Permalink
Updated rust-template to version 14
Browse files Browse the repository at this point in the history
  • Loading branch information
Tamschi committed Oct 1, 2021
1 parent 600124a commit ffd936d
Show file tree
Hide file tree
Showing 21 changed files with 396 additions and 52 deletions.
1 change: 1 addition & 0 deletions .gitattributes
Original file line number Diff line number Diff line change
Expand Up @@ -4,6 +4,7 @@
*.md text eol=lf
*.rs text eol=lf
*.toml text eol=lf
*.txt text eol=lf
*.yml text eol=lf

.editorconfig text eol=lf
Expand Down
2 changes: 1 addition & 1 deletion .github/ISSUE_TEMPLATE/bug_report.md
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,7 @@
name: Bug Report
about: Create a report to help this project improve
title: ''
labels: bug
labels: 'type: bug'
assignees: ''

---
Expand Down
2 changes: 1 addition & 1 deletion .github/ISSUE_TEMPLATE/feature_request.md
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,7 @@
name: Feature Request
about: Suggest an idea for this project
title: ''
labels: enhancement
labels: 'type: feature'
assignees: ''

---
Expand Down
12 changes: 8 additions & 4 deletions .github/dependabot.yml
Original file line number Diff line number Diff line change
Expand Up @@ -4,15 +4,19 @@ updates:
directory: "/"
schedule:
interval: "daily"
# versioning-strategy: "increase-if-necessary" # Not yet supported. See <https://github.com/dependabot/dependabot-core/issues/4009>.
assignees:
- "Tamschi"
reviewers:
- "Tamschi"
labels:
- "type: upkeep"
- "domain: Rust"

- package-ecosystem: "github-actions"
directory: "/"
schedule:
interval: "daily"
assignees:
- "Tamschi"
reviewers:
- "Tamschi"
labels:
- "type: upkeep"
- "domain: GitHub Actions"
2 changes: 1 addition & 1 deletion .github/workflows/auto-approve_dependabot.yml
Original file line number Diff line number Diff line change
Expand Up @@ -14,7 +14,7 @@ jobs:
if: github.actor == 'dependabot[bot]'
steps:
- name: auto-approve
uses: actions/github-script@v4.0.2
uses: actions/github-script@v5
with:
# The default token is enough to comment, but Dependabot will only comply if you impersonate a user with write access.
github-token: ${{secrets.AUTO_APPROVE_DEPENDABOT_TOKEN}}
Expand Down
6 changes: 3 additions & 3 deletions .github/workflows/deny_warnings.yml
Original file line number Diff line number Diff line change
Expand Up @@ -17,6 +17,6 @@ jobs:
profile: minimal
components: clippy
- run: cat CI.toml >> Cargo.toml
- run: cargo clippy --workspace --locked --no-default-features -- -D warnings
- run: cargo clippy --workspace --locked -- -D warnings
- run: cargo clippy --workspace --locked --all-features -- -D warnings
- run: cargo clippy --workspace --locked --all-targets --no-default-features -- -D warnings
- run: cargo clippy --workspace --locked --all-targets -- -D warnings
- run: cargo clippy --workspace --locked --all-targets --all-features -- -D warnings
2 changes: 1 addition & 1 deletion .github/workflows/rust_auto_format.yml
Original file line number Diff line number Diff line change
Expand Up @@ -28,7 +28,7 @@ jobs:
- run: cat CI.toml >> Cargo.toml
- run: cargo +nightly fmt --all

- uses: stefanzweifel/git-auto-commit-action@v4.11.0
- uses: stefanzweifel/git-auto-commit-action@v4.12.0
with:
commit_message: Automatic formatting commit (cargo +nightly fmt)
file_pattern: '**/*.rs'
Expand Down
23 changes: 23 additions & 0 deletions .github/workflows/update_labels.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,23 @@
# labels.json adapted from <https://raw.githubusercontent.com/seantrane/github-label-presets/master/labels.json>.
# See also <https://seantrane.com/posts/logical-colorful-github-labels-18230/>.

name: Update Labels
on:
push:
branches: [develop]

jobs:
deny-warnings:
name: Update Labels
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v2
- uses: actions/cache@v2
with:
path: ~/.npm # I'm not entirely sure this is correct.
key: ${{ runner.os }}-npm
- run: npx github-label-sync
--access-token ${{ secrets.GITHUB_TOKEN }}
--labels labels.json
--allow-added-labels
${{ github.repository }}
2 changes: 1 addition & 1 deletion .rust-template.version.txt
Original file line number Diff line number Diff line change
@@ -1 +1 @@
9
14
4 changes: 4 additions & 0 deletions CODEOWNERS
Validating CODEOWNERS rules …
Original file line number Diff line number Diff line change
@@ -0,0 +1,4 @@
# See <https://docs.github.com/en/github/creating-cloning-and-archiving-repositories/creating-a-repository-on-github/about-code-owners>
# or <https://docs.gitlab.com/ee/user/project/code_owners.html>.

* @Tamschi
90 changes: 86 additions & 4 deletions CONTRIBUTING.md
Original file line number Diff line number Diff line change
Expand Up @@ -35,21 +35,31 @@ Please keep your code human-readable.

While there are no formal style requirements, here are some suggestions that might help new code fit in with with the existing:

* Don't use abbreviations unless they are established terms.
- Don't use abbreviations unless they are established terms.

They usually make it harder for me to read the code fluently. You also don't need to worry about alignment; I use a proportional font and likely wouldn't notice.

* Try to keep it simple.
- Try to keep it simple.

I can't properly review code I don't understand, so straightforward implementations are usually preferred.

It's usually fine to use a library to avoid boilerplate, if there's enough documentation so I could replicate it from scratch.

If you do something custom that's tricky, a link to an explanation of the technique would be nice. I'll just ask if this becomes an issue, though.

* If you use macros, put them nearby.
- If you use macros, put them nearby.

I normally place one-off macros directly above the item I need them for.
I normally place one-off macros directly above the item I need them for.

- When writing comments and documentation, try to break lines semantically.

It's more readable than breaking purely by line width this way, in my eyes.

Just after commas tends to be a good place for this, of course,
but please try to also take sentence flow into account when there are none.
If there are multiple sentences in a paragraph, you may want to put them in separate lines.

Please do not manually break lines in the rendered documentation (trailing double-space), unless this strongly improved legibility.

### Meta data

Expand All @@ -58,3 +68,75 @@ Please add yourself to each copyright holders list of [LICENSE-APACHE](LICENSE-A
Nicknames and entries without email addresses are fine, too.

For substantial contributions (basically anything more than typo or grammar fixes), feel free to add yourself to the `authors` list in `Cargo.toml`. This explicitly includes documentation changes, testing and bug fixes that just happen to be not much code.

## Labels

Don't worry about these too much.

You're encouraged to add any that seem applicable where possible,
but I'll otherwise just take care of it.

(Don't undo changes I make to labels without immediate reason.)

See <https://github.com/Tamschi/TODO_CRATE_NAME/issues/labels> for details on individual labels.

### Categories

- Assorted

Labels without prefix like [`breaking`](https://github.com/Tamschi/TODO_CRATE_NAME/labels/breaking),
[`good first issue`](https://github.com/Tamschi/TODO_CRATE_NAME/labels/good%20first%20issue) or
[`help wanted`](https://github.com/Tamschi/TODO_CRATE_NAME/labels/help%20wanted).

- `domain:`

Categorises changes by domain. Mostly not necessary.

- `effort:`

Relative effort required. There's no specific unit of measurement.

- `priority:`

Vaguely informs my schedule, **cross-respository**.

You're welcome to let me know that (and ideally why) you'd like to see a specific change and I'll take that into account.

If you *need* a feature that you're not planning to implement yourself, strongly consider paying me for it.

> This is, of course, subject to side-job restrictions I may be under.
<!---->

> If you'd like to pay me directly, contact me first and we'll figure out how to do this as industry-standard contract work.
>
> Alternatively:
>
> For crowdfunding and escrow, [Bountysource](https://www.bountysource.com/) seems reasonably trustworthy. This also has the advantage of letting someone else work on it, since I'm usually pretty swamped with projects.
>
> Use fiat bounties. Cryptoscam "currencies" are a scourge.
>
> Posting a bounty won't guarantee I'll actually implement a solution, but I'll try to speedily triage relevant issues at least.
>
> I'll try to set up something that automatically announces bounties,
> but if that doesn't happen within a few hours, **do** post a comment about it!
- `state:`

General scheduling categories. See label descriptions for details!

Rarely, more than one may be applicable.

- `type:`

General problem or change domain categories.

Only one of these should be used at a time.

- `work:`

These are inspired by the [Cynefin framework](https://en.wikipedia.org/wiki/Cynefin_framework) to categorise the type of work done or required.

I adjusted the labels to be a bit friendlier and more expressive. See the label descriptions for details.

The unknown category at the centre is not labelled explicitly.
42 changes: 22 additions & 20 deletions Cargo.lock

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

6 changes: 3 additions & 3 deletions Cargo.toml
Original file line number Diff line number Diff line change
Expand Up @@ -27,11 +27,11 @@ publish = false
[badges]
is-it-maintained-issue-resolution = { repository = "Tamschi/TODO_CRATE_NAME" }
is-it-maintained-open-issues = { repository = "Tamschi/TODO_CRATE_NAME" }
maintenance = { status = "experimental" }
maintenance = { status = "experimental" } # This may differ between branches.

[dev-dependencies]
cargo-husky = "1.5.0"
doc-comment = "0.3.3"
git_info = "0.1.2"
version-sync = "0.9.1"
wasm-bindgen-test = "0.3.24"
version-sync = "0.9.3"
wasm-bindgen-test = "0.3.28"
Loading

0 comments on commit ffd936d

Please sign in to comment.