-
Notifications
You must be signed in to change notification settings - Fork 2
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Rewrite in the Rust programming language (#27)
- Loading branch information
Showing
171 changed files
with
11,737 additions
and
2,736 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,37 +1,14 @@ | ||
{ | ||
"name": "Photos.network Core", | ||
"context": "..", | ||
"dockerFile": "../Dockerfile.dev", | ||
"forwardPorts": [3000], | ||
"postCreateCommand": "mkdir -p config && pip3 install -e .", | ||
"runArgs": ["-e", "GIT_EDITOR=code --wait"], | ||
"extensions": [ | ||
"ms-python.vscode-pylance", | ||
"visualstudioexptteam.vscodeintellicode", | ||
"ms-azure-devops.azure-pipelines", | ||
"redhat.vscode-yaml", | ||
"esbenp.prettier-vscode" | ||
], | ||
"settings": { | ||
"python.pythonPath": "/usr/local/bin/python", | ||
"python.linting.pylintEnabled": true, | ||
"python.linting.enabled": true, | ||
"python.formatting.provider": "black", | ||
"python.testing.pytestArgs": ["--no-cov"], | ||
"python.testing.pytestEnabled": true, | ||
"editor.formatOnPaste": false, | ||
"editor.formatOnSave": true, | ||
"editor.formatOnType": true, | ||
"files.trimTrailingWhitespace": true, | ||
"terminal.integrated.shell.linux": "/bin/bash", | ||
"yaml.customTags": [ | ||
"!input scalar", | ||
"!secret scalar", | ||
"!include_dir_named scalar", | ||
"!include_dir_list scalar", | ||
"!include_dir_merge_list scalar", | ||
"!include_dir_merge_named scalar" | ||
] | ||
} | ||
} | ||
|
||
"name": "Photos.network core", | ||
"image": "mcr.microsoft.com/devcontainers/rust:0-1-bullseye", | ||
"appPort": [ | ||
"7777:7777" | ||
], | ||
"extensions": [ | ||
"rust-lang.rust-analyzer", | ||
"swellaby.vscode-rust-test-adapter", | ||
"ms-vscode.test-adapter-converter" | ||
], | ||
"postCreateCommand": "rustc --version", | ||
"remoteUser": "vscode" | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,34 @@ | ||
# Include any files or directories that you don't want to be copied to your | ||
# container here (e.g., local build artifacts, temporary files, etc.). | ||
# | ||
# For more help, visit the .dockerignore file reference guide at | ||
# https://docs.docker.com/engine/reference/builder/#dockerignore-file | ||
|
||
**/.DS_Store | ||
**/__pycache__ | ||
**/.venv | ||
**/.classpath | ||
**/.dockerignore | ||
**/.env | ||
**/.git | ||
**/.gitignore | ||
**/.project | ||
**/.settings | ||
**/.toolstarget | ||
**/.vs | ||
**/.vscode | ||
**/*.*proj.user | ||
**/*.dbmdl | ||
**/*.jfm | ||
**/bin | ||
**/charts | ||
**/docker-compose* | ||
**/compose* | ||
**/Dockerfile* | ||
**/node_modules | ||
**/npm-debug.log | ||
**/obj | ||
**/secrets.dev.yaml | ||
**/values.dev.yaml | ||
LICENSE | ||
README.md |
Validating CODEOWNERS rules …
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,2 @@ | ||
output-type: lcov | ||
output-file: ./lcov.info |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,21 @@ | ||
# ref: https://docs.codecov.com/docs/codecovyml-reference | ||
coverage: | ||
# Hold ourselves to a high bar | ||
range: 85..100 | ||
round: down | ||
precision: 1 | ||
status: | ||
# ref: https://docs.codecov.com/docs/commit-status | ||
project: | ||
default: | ||
# Avoid false negatives | ||
threshold: 1% | ||
|
||
# Test files aren't important for coverage | ||
ignore: | ||
- "tests" | ||
|
||
# Make comments less noisy | ||
comment: | ||
layout: "files" | ||
require_changes: yes |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,17 @@ | ||
version: 2 | ||
updates: | ||
- package-ecosystem: github-actions | ||
directory: / | ||
schedule: | ||
interval: weekly | ||
- package-ecosystem: cargo | ||
directory: / | ||
schedule: | ||
interval: weekly | ||
ignore: | ||
- dependency-name: "*" | ||
# patch and minor updates don't matter for libraries | ||
# remove this ignore rule if your package has binaries | ||
update-types: | ||
- "version-update:semver-patch" | ||
- "version-update:semver-minor" |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,24 @@ | ||
# Configuration file for [stale](https://github.com/apps/stale) | ||
|
||
# Number of days of inactivity before an issue becomes stale | ||
daysUntilStale: 60 | ||
|
||
# Number of days of inactivity before a stale issue is closed | ||
daysUntilClose: 7 | ||
|
||
# Issues with these labels will never be considered stale | ||
exemptLabels: | ||
- pinned | ||
- security | ||
|
||
# Label to use when marking an issue as stale | ||
staleLabel: wontfix | ||
|
||
# Comment to post when marking an issue as stale. Set to `false` to disable | ||
markComment: > | ||
This issue has been automatically marked as stale because it has not had | ||
recent activity. It will be closed if no further activity occurs. Thank you | ||
for your contributions. | ||
# Comment to post when closing a stale issue. Set to `false` to disable | ||
closeComment: false |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,87 @@ | ||
name: check code quality | ||
|
||
on: [push] | ||
|
||
jobs: | ||
check: | ||
name: Check | ||
runs-on: ubuntu-latest | ||
steps: | ||
- name: Checkout sources | ||
uses: actions/checkout@v3 | ||
|
||
- name: Install stable toolchain | ||
uses: actions-rs/toolchain@v1 | ||
with: | ||
profile: minimal | ||
toolchain: stable | ||
override: true | ||
|
||
- name: Run cargo check | ||
uses: actions-rs/cargo@v1 | ||
with: | ||
command: check | ||
|
||
test: | ||
name: Tests | ||
runs-on: ubuntu-latest | ||
steps: | ||
- name: Checkout sources | ||
uses: actions/checkout@v3 | ||
|
||
- name: Install stable toolchain | ||
uses: actions-rs/toolchain@v1 | ||
with: | ||
profile: minimal | ||
toolchain: stable | ||
override: true | ||
|
||
- name: Run cargo test | ||
uses: actions-rs/cargo@v1 | ||
with: | ||
command: test | ||
args: --workspace --all-targets | ||
# env: | ||
# CARGO_INCREMENTAL: '0' | ||
# RUSTFLAGS: '-Zprofile -Ccodegen-units=1 -Cinline-threshold=0 -Clink-dead-code -Coverflow-checks=off -Cpanic=abort -Zpanic_abort_tests' | ||
# RUSTDOCFLAGS: '-Zprofile -Ccodegen-units=1 -Cinline-threshold=0 -Clink-dead-code -Coverflow-checks=off -Cpanic=abort -Zpanic_abort_tests' | ||
|
||
# - name: rust-grcov | ||
# # You may pin to the exact commit or the version. | ||
# # uses: actions-rs/grcov@bb47b1ed7883a1502fa6875d562727ace2511248 | ||
# uses: actions-rs/grcov@v0.1 | ||
|
||
# - name: Upload coverage reports to Codecov | ||
# uses: codecov/codecov-action@v3 | ||
# env: | ||
# CODECOV_TOKEN: ${{ secrets.CODECOV_TOKEN }} | ||
# with: | ||
# verbose: true | ||
# fail_ci_if_error: false | ||
|
||
lints: | ||
name: Lint checks | ||
runs-on: ubuntu-latest | ||
steps: | ||
- name: Checkout sources | ||
uses: actions/checkout@v3 | ||
|
||
- name: Install stable toolchain | ||
uses: actions-rs/toolchain@v1 | ||
with: | ||
profile: minimal | ||
toolchain: stable | ||
override: true | ||
components: rustfmt, clippy | ||
|
||
- name: Run cargo fmt | ||
uses: actions-rs/cargo@v1 | ||
with: | ||
command: fmt | ||
args: --all -- --check | ||
|
||
- name: Run cargo clippy | ||
uses: actions-rs/cargo@v1 | ||
with: | ||
command: clippy | ||
args: -- -D warnings |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,62 +1,22 @@ | ||
# pytest | ||
.pytest_cache | ||
.cache | ||
### Rust ### | ||
debug/ | ||
target/ | ||
|
||
# GITHUB Proposed Python stuff: | ||
*.py[cod] | ||
# These are backup files generated by rustfmt | ||
**/*.rs.bk | ||
|
||
# C extensions | ||
*.so | ||
# MSVC Windows builds of rustc generate these, which store debugging information | ||
*.pdb | ||
|
||
# Packages | ||
*.egg | ||
*.egg-info | ||
dist | ||
build | ||
eggs | ||
.eggs | ||
parts | ||
bin | ||
var | ||
sdist | ||
develop-eggs | ||
.installed.cfg | ||
lib | ||
lib64 | ||
pip-wheel-metadata | ||
|
||
# Logs | ||
*.log | ||
pip-log.txt | ||
### IntelliJ ### | ||
.idea/ | ||
|
||
# Unit test / coverage reports | ||
.coverage | ||
.tox | ||
coverage.xml | ||
nosetests.xml | ||
htmlcov/ | ||
test-reports/ | ||
test-results.xml | ||
test-output.xml | ||
# data directory | ||
/data | ||
|
||
# Translations | ||
*.mo | ||
# config directory | ||
/config | ||
|
||
# venv stuff | ||
pyvenv.cfg | ||
pip-selfcheck.json | ||
venv | ||
.venv | ||
Pipfile* | ||
share/* | ||
/Scripts/ | ||
|
||
# Visual Studio Code | ||
.vscode/* | ||
!.vscode/cSpell.json | ||
!.vscode/extensions.json | ||
!.vscode/tasks.json | ||
.env | ||
|
||
# Built docs | ||
docs/build | ||
# logs directory | ||
/logs |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,3 +1,12 @@ | ||
{ | ||
"recommendations": ["esbenp.prettier-vscode", "ms-python.python"] | ||
"recommendations": [ | ||
"rust-lang.rust-analyzer", | ||
"tamasfe.even-better-toml", | ||
"serayuzgur.crates", | ||
"rangav.vscode-thunder-client", | ||
"usernamehw.errorlens", | ||
"dracula-theme.theme-dracula", | ||
"vadimcn.vscode-lldb", | ||
"ms-vscode.cpptools", | ||
], | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,24 @@ | ||
{ | ||
"version": "0.2.0", | ||
"configurations": [ | ||
{ | ||
"name": "Photos.network (OSX)", | ||
"type": "lldb", | ||
"request": "launch", | ||
"program": "${workspaceRoot}/target/debug/core", | ||
"args": [], | ||
"cwd": "${workspaceRoot}" | ||
}, | ||
{ | ||
"name": "Photos.network (Windows)", | ||
"type": "cppvsdbg", | ||
"request": "launch", | ||
"program": "${workspaceRoot}/target/debug/core.exe", | ||
"args": [], | ||
"stopAtEntry": false, | ||
"cwd": "${workspaceRoot}", | ||
"environment": [], | ||
"externalConsole": true | ||
} | ||
] | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,21 @@ | ||
{ | ||
"terminal.integrated.defaultProfile.osx": "zsh", | ||
"editor.semanticTokenColorCustomizations": { | ||
"rules": { | ||
"*.mutable": { | ||
"fontStyle": "", // set to empty string to disable underline, which is the default | ||
}, | ||
} | ||
}, | ||
"rust-analyzer.linkedProjects": [ | ||
"./crates/accounts/Cargo.toml", | ||
"./crates/activity_pub/Cargo.toml", | ||
"./crates/common/Cargo.toml", | ||
"./crates/media/Cargo.toml", | ||
"./crates/oauth_authentication/Cargo.toml", | ||
"./crates/oauth_authorization_server/Cargo.toml" | ||
], | ||
"rust-analyzer.showUnlinkedFileNotification": false, | ||
"debug.allowBreakpointsEverywhere": true, | ||
"rest-client.followredirect": false | ||
} |
Oops, something went wrong.