Skip to content

Commit 3eb1c53

Browse files
author
Hendrik van Antwerpen
authored
Merge pull request #2 from github/add-geo_filters
Add scaffolding and geo_filters crate
2 parents 17709d8 + 6bec7ad commit 3eb1c53

Some content is hidden

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

61 files changed

+4874
-3
lines changed

.devcontainer/Dockerfile

Lines changed: 24 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,24 @@
1+
FROM mcr.microsoft.com/vscode/devcontainers/base:ubuntu as build
2+
3+
ENV DEBIAN_FRONTEND=noninteractive
4+
5+
RUN apt-get update \
6+
&& apt install -y --no-install-recommends \
7+
build-essential \
8+
ca-certificates \
9+
clang \
10+
cmake \
11+
curl \
12+
git \
13+
lldb \
14+
procps \
15+
software-properties-common \
16+
&& apt-get clean -y \
17+
&& apt-get autoremove -y \
18+
&& rm -rf /var/lib/apt/lists/*
19+
20+
COPY install-mold.sh .
21+
22+
RUN ./install-mold.sh
23+
24+
ENV DEBIAN_FRONTEND=readline

.devcontainer/devcontainer.json

Lines changed: 49 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,49 @@
1+
{
2+
"name": "rust-algos",
3+
"build": {
4+
"dockerfile": "Dockerfile",
5+
"context": "."
6+
},
7+
"runArgs": [
8+
"--cap-add=SYS_PTRACE",
9+
"--security-opt",
10+
"seccomp=unconfined",
11+
"--network=host",
12+
"--privileged",
13+
"--init"
14+
],
15+
// Set *default* container specific settings.json values on container create.
16+
"settings": {
17+
"lldb.executable": "/usr/bin/lldb",
18+
// VS Code don't watch files under ./target
19+
"files.watcherExclude": {
20+
"**/target/**": true
21+
}
22+
},
23+
"features": {
24+
"ghcr.io/devcontainers/features/docker-in-docker:2": {
25+
"version": "latest",
26+
"moby": true,
27+
"dockerDashComposeVersion": "v1",
28+
"installDockerBuildx": true
29+
},
30+
"ghcr.io/devcontainers/features/rust:1": {
31+
"version": "latest",
32+
"profile": "minimal"
33+
},
34+
"ghcr.io/devcontainers/features/sshd:1": {
35+
"version": "latest"
36+
},
37+
"ghcr.io/devcontainers/features/github-cli:1": {}
38+
},
39+
// Add the IDs of extensions you want installed when the container is created.
40+
"extensions": [
41+
"tamasfe.even-better-toml",
42+
"matklad.rust-analyzer",
43+
"ms-azuretools.vscode-docker",
44+
"mutantdino.resourcemonitor",
45+
"vadimcn.vscode-lldb",
46+
"visualstudioexptteam.vscodeintellicode",
47+
],
48+
"userEnvProbe": "loginInteractiveShell",
49+
}

.devcontainer/install-mold.sh

Lines changed: 13 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,13 @@
1+
#! /usr/bin/env bash
2+
3+
set -euo pipefail
4+
5+
if [ "$(uname -s)" != "Linux" ]; then
6+
echo "mold is linux only, skipping install."
7+
exit 0
8+
fi
9+
10+
version=$(wget -q -O- https://api.github.com/repos/rui314/mold/releases/latest | jq -r .tag_name | sed 's/^v//'); true
11+
echo "mold $version"
12+
wget -q -O- https://github.com/rui314/mold/releases/download/v$version/mold-$version-"$(uname -m)"-linux.tar.gz | tar -C /usr/local --strip-components=1 -xzf -
13+
ln -sf /usr/local/bin/mold "$(realpath /usr/bin/ld)"; true

.github/dependabot.yaml

Lines changed: 12 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,12 @@
1+
version: 2
2+
3+
updates:
4+
- package-ecosystem: "cargo"
5+
directory: "/"
6+
schedule:
7+
interval: "weekly"
8+
9+
- package-ecosystem: "github-actions"
10+
directory: "/"
11+
schedule:
12+
interval: "weekly"

.github/workflows/ci.yaml

Lines changed: 49 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,49 @@
1+
name: CI
2+
3+
on:
4+
push:
5+
6+
permissions:
7+
contents: read
8+
packages: read
9+
10+
# In the event that there is a new push to the ref, cancel any running jobs because there are now obsolete, and wasting
11+
# resources.
12+
concurrency:
13+
group: ${{ github.workflow }}-${{ github.ref }}
14+
cancel-in-progress: true
15+
16+
jobs:
17+
build:
18+
name: Build
19+
runs-on: ubuntu-latest
20+
steps:
21+
- uses: actions/checkout@v4
22+
23+
- uses: rui314/setup-mold@c9803d2102b7e020ad0ccd687c55b2ad8baf3496
24+
25+
- name: Build
26+
run: make build
27+
28+
lint:
29+
name: Lint
30+
runs-on: ubuntu-latest
31+
needs: build
32+
steps:
33+
- uses: actions/checkout@v4
34+
35+
- uses: rui314/setup-mold@c9803d2102b7e020ad0ccd687c55b2ad8baf3496
36+
37+
- name: Check formatting and clippy
38+
run: make lint
39+
40+
test:
41+
name: Test
42+
runs-on: ubuntu-latest
43+
steps:
44+
- uses: actions/checkout@v4
45+
46+
- uses: rui314/setup-mold@c9803d2102b7e020ad0ccd687c55b2ad8baf3496
47+
48+
- name: Run unit tests
49+
run: make test

.gitignore

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,5 @@
1+
Cargo.lock
2+
/target/
3+
/crates/*/target/
4+
/crates/*/Cargo.lock
5+
.vscode/

CODEOWNERS

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1 @@
1+
* @github/blackbird-reviewers

CODE_OF_CONDUCT.md

Lines changed: 74 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,74 @@
1+
# Contributor Covenant Code of Conduct
2+
3+
## Our Pledge
4+
5+
In the interest of fostering an open and welcoming environment, we as
6+
contributors and maintainers pledge to making participation in our project and
7+
our community a harassment-free experience for everyone, regardless of age, body
8+
size, disability, ethnicity, gender identity and expression, level of experience,
9+
nationality, personal appearance, race, religion, or sexual identity and
10+
orientation.
11+
12+
## Our Standards
13+
14+
Examples of behavior that contributes to creating a positive environment
15+
include:
16+
17+
* Using welcoming and inclusive language
18+
* Being respectful of differing viewpoints and experiences
19+
* Gracefully accepting constructive criticism
20+
* Focusing on what is best for the community
21+
* Showing empathy towards other community members
22+
23+
Examples of unacceptable behavior by participants include:
24+
25+
* The use of sexualized language or imagery and unwelcome sexual attention or
26+
advances
27+
* Trolling, insulting/derogatory comments, and personal or political attacks
28+
* Public or private harassment
29+
* Publishing others' private information, such as a physical or electronic
30+
address, without explicit permission
31+
* Other conduct which could reasonably be considered inappropriate in a
32+
professional setting
33+
34+
## Our Responsibilities
35+
36+
Project maintainers are responsible for clarifying the standards of acceptable
37+
behavior and are expected to take appropriate and fair corrective action in
38+
response to any instances of unacceptable behavior.
39+
40+
Project maintainers have the right and responsibility to remove, edit, or
41+
reject comments, commits, code, wiki edits, issues, and other contributions
42+
that are not aligned to this Code of Conduct, or to ban temporarily or
43+
permanently any contributor for other behaviors that they deem inappropriate,
44+
threatening, offensive, or harmful.
45+
46+
## Scope
47+
48+
This Code of Conduct applies both within project spaces and in public spaces
49+
when an individual is representing the project or its community. Examples of
50+
representing a project or community include using an official project e-mail
51+
address, posting via an official social media account, or acting as an appointed
52+
representative at an online or offline event. Representation of a project may be
53+
further defined and clarified by project maintainers.
54+
55+
## Enforcement
56+
57+
Instances of abusive, harassing, or otherwise unacceptable behavior may be
58+
reported by contacting the project team at [email protected]. All
59+
complaints will be reviewed and investigated and will result in a response that
60+
is deemed necessary and appropriate to the circumstances. The project team is
61+
obligated to maintain confidentiality with regard to the reporter of an incident.
62+
Further details of specific enforcement policies may be posted separately.
63+
64+
Project maintainers who do not follow or enforce the Code of Conduct in good
65+
faith may face temporary or permanent repercussions as determined by other
66+
members of the project's leadership.
67+
68+
## Attribution
69+
70+
This Code of Conduct is adapted from the [Contributor Covenant][homepage], version 1.4,
71+
available at [http://contributor-covenant.org/version/1/4][version]
72+
73+
[homepage]: http://contributor-covenant.org
74+
[version]: http://contributor-covenant.org/version/1/4/

CONTRIBUTING.md

Lines changed: 42 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,42 @@
1+
# Contributing
2+
3+
Hi there! We're thrilled that you'd like to contribute to this project. Your help is essential for keeping it great.
4+
5+
Contributions to this project are [released](https://help.github.com/articles/github-terms-of-service/#6-contributions-under-repository-license) to the public under the [project's open source license][license].
6+
7+
Please note that this project is released with a [Contributor Code of Conduct][code-of-conduct]. By participating in this project you agree to abide by its terms.
8+
9+
## Prerequisites for running and testing code
10+
11+
These are one time installations required to be able to test your changes locally as part of the pull request (PR) submission process.
12+
13+
1. Install Rust [through download](https://www.rust-lang.org/learn/get-started) | [through Homebrew](https://formulae.brew.sh/formula/rustup-init)
14+
15+
## Submitting a pull request
16+
17+
1. [Fork][fork] and clone the repository
18+
1. Make sure the tests pass on your machine: `make test`
19+
1. Make sure linter passes on your machine: `make lint`
20+
1. Create a new branch: `git checkout -b my-branch-name`
21+
1. Make your change, add tests, and make sure the tests and linter still pass
22+
1. Push to your fork and [submit a pull request][pr]
23+
1. Pat yourself on the back and wait for your pull request to be reviewed and merged.
24+
25+
Here are a few things you can do that will increase the likelihood of your pull request being accepted:
26+
27+
- Follow the [style guide][style].
28+
- Write tests.
29+
- Keep your change as focused as possible. If there are multiple changes you would like to make that are not dependent upon each other, consider submitting them as separate pull requests.
30+
- Write a [good commit message](http://tbaggery.com/2008/04/19/a-note-about-git-commit-messages.html).
31+
32+
## Resources
33+
34+
- [How to Contribute to Open Source](https://opensource.guide/how-to-contribute/)
35+
- [Using Pull Requests](https://help.github.com/articles/about-pull-requests/)
36+
- [GitHub Help](https://help.github.com)
37+
38+
[fork]: https://github.com/github/rust-algos/fork
39+
[pr]: https://github.com/github/rust-algos/compare
40+
[style]: https://doc.rust-lang.org/nightly/style-guide/
41+
[code-of-conduct]: CODE_OF_CONDUCT.md
42+
[license]: LICENSE

Cargo.toml

Lines changed: 12 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,12 @@
1+
[workspace]
2+
3+
members = [
4+
"crates/*",
5+
]
6+
resolver = "2"
7+
8+
[profile.bench]
9+
debug = true
10+
11+
[profile.release]
12+
debug = true

0 commit comments

Comments
 (0)