{"id":19379294,"url":"https://github.com/remi-dupre/aoc","last_synced_at":"2026-02-27T07:42:32.120Z","repository":{"id":45433721,"uuid":"318770676","full_name":"remi-dupre/aoc","owner":"remi-dupre","description":"A macro which defines a handful main for the Advent of Code","archived":false,"fork":false,"pushed_at":"2022-12-18T15:30:33.000Z","size":169,"stargazers_count":34,"open_issues_count":7,"forks_count":7,"subscribers_count":3,"default_branch":"main","last_synced_at":"2025-10-06T03:43:50.277Z","etag":null,"topics":["advent","aoc","macro","rust","rust-library"],"latest_commit_sha":null,"homepage":"","language":"Rust","has_issues":true,"has_wiki":null,"has_pages":null,"mirror_url":null,"source_name":null,"license":"apache-2.0","status":null,"scm":"git","pull_requests_enabled":true,"icon_url":"https://github.com/remi-dupre.png","metadata":{"files":{"readme":"README.md","changelog":null,"contributing":null,"funding":null,"license":"LICENSE","code_of_conduct":null,"threat_model":null,"audit":null,"citation":null,"codeowners":null,"security":null,"support":null}},"created_at":"2020-12-05T11:28:03.000Z","updated_at":"2024-12-13T06:45:39.000Z","dependencies_parsed_at":"2023-01-29T19:30:22.373Z","dependency_job_id":null,"html_url":"https://github.com/remi-dupre/aoc","commit_stats":null,"previous_names":[],"tags_count":2,"template":false,"template_full_name":null,"purl":"pkg:github/remi-dupre/aoc","repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/remi-dupre%2Faoc","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/remi-dupre%2Faoc/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/remi-dupre%2Faoc/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/remi-dupre%2Faoc/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/remi-dupre","download_url":"https://codeload.github.com/remi-dupre/aoc/tar.gz/refs/heads/main","sbom_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/remi-dupre%2Faoc/sbom","scorecard":{"id":770208,"data":{"date":"2025-08-18","repo":{"name":"github.com/remi-dupre/aoc","commit":"bb08c555a403e56d86caec7f00bf51ec33187dbc"},"scorecard":{"version":"v5.2.1-41-g40576783","commit":"40576783fda6698350fcbbeaea760ff827433034"},"score":3.1,"checks":[{"name":"Code-Review","score":3,"reason":"Found 7/22 approved changesets -- score normalized to 3","details":null,"documentation":{"short":"Determines if the project requires human code review before pull requests (aka merge requests) are merged.","url":"https://github.com/ossf/scorecard/blob/40576783fda6698350fcbbeaea760ff827433034/docs/checks.md#code-review"}},{"name":"Dangerous-Workflow","score":10,"reason":"no dangerous workflow patterns detected","details":null,"documentation":{"short":"Determines if the project's GitHub Action workflows avoid dangerous patterns.","url":"https://github.com/ossf/scorecard/blob/40576783fda6698350fcbbeaea760ff827433034/docs/checks.md#dangerous-workflow"}},{"name":"Pinned-Dependencies","score":0,"reason":"dependency not pinned by hash detected -- score normalized to 0","details":["Warn: GitHub-owned GitHubAction not pinned by hash: .github/workflows/tests.yml:13: update your workflow using https://app.stepsecurity.io/secureworkflow/remi-dupre/aoc/tests.yml/main?enable=pin","Info:   0 out of   1 GitHub-owned GitHubAction dependencies pinned"],"documentation":{"short":"Determines if the project has declared and pinned the dependencies of its build process.","url":"https://github.com/ossf/scorecard/blob/40576783fda6698350fcbbeaea760ff827433034/docs/checks.md#pinned-dependencies"}},{"name":"Maintained","score":0,"reason":"0 commit(s) and 0 issue activity found in the last 90 days -- score normalized to 0","details":null,"documentation":{"short":"Determines if the project is \"actively maintained\".","url":"https://github.com/ossf/scorecard/blob/40576783fda6698350fcbbeaea760ff827433034/docs/checks.md#maintained"}},{"name":"Binary-Artifacts","score":10,"reason":"no binaries found in the repo","details":null,"documentation":{"short":"Determines if the project has generated executable (binary) artifacts in the source repository.","url":"https://github.com/ossf/scorecard/blob/40576783fda6698350fcbbeaea760ff827433034/docs/checks.md#binary-artifacts"}},{"name":"Packaging","score":-1,"reason":"packaging workflow not detected","details":["Warn: no GitHub/GitLab publishing workflow detected."],"documentation":{"short":"Determines if the project is published as a package that others can easily download, install, easily update, and uninstall.","url":"https://github.com/ossf/scorecard/blob/40576783fda6698350fcbbeaea760ff827433034/docs/checks.md#packaging"}},{"name":"Token-Permissions","score":0,"reason":"detected GitHub workflow tokens with excessive permissions","details":["Warn: no topLevel permission defined: .github/workflows/tests.yml:1","Info: no jobLevel write permissions found"],"documentation":{"short":"Determines if the project's workflows follow the principle of least privilege.","url":"https://github.com/ossf/scorecard/blob/40576783fda6698350fcbbeaea760ff827433034/docs/checks.md#token-permissions"}},{"name":"CII-Best-Practices","score":0,"reason":"no effort to earn an OpenSSF best practices badge detected","details":null,"documentation":{"short":"Determines if the project has an OpenSSF (formerly CII) Best Practices Badge.","url":"https://github.com/ossf/scorecard/blob/40576783fda6698350fcbbeaea760ff827433034/docs/checks.md#cii-best-practices"}},{"name":"Security-Policy","score":0,"reason":"security policy file not detected","details":["Warn: no security policy file detected","Warn: no security file to analyze","Warn: no security file to analyze","Warn: no security file to analyze"],"documentation":{"short":"Determines if the project has published a security policy.","url":"https://github.com/ossf/scorecard/blob/40576783fda6698350fcbbeaea760ff827433034/docs/checks.md#security-policy"}},{"name":"Fuzzing","score":0,"reason":"project is not fuzzed","details":["Warn: no fuzzer integrations found"],"documentation":{"short":"Determines if the project uses fuzzing.","url":"https://github.com/ossf/scorecard/blob/40576783fda6698350fcbbeaea760ff827433034/docs/checks.md#fuzzing"}},{"name":"License","score":10,"reason":"license file detected","details":["Info: project has a license file: LICENSE:0","Info: FSF or OSI recognized license: Apache License 2.0: LICENSE:0"],"documentation":{"short":"Determines if the project has defined a license.","url":"https://github.com/ossf/scorecard/blob/40576783fda6698350fcbbeaea760ff827433034/docs/checks.md#license"}},{"name":"Signed-Releases","score":-1,"reason":"no releases found","details":null,"documentation":{"short":"Determines if the project cryptographically signs release artifacts.","url":"https://github.com/ossf/scorecard/blob/40576783fda6698350fcbbeaea760ff827433034/docs/checks.md#signed-releases"}},{"name":"Branch-Protection","score":-1,"reason":"internal error: error during branchesHandler.setup: internal error: githubv4.Query: Resource not accessible by integration","details":null,"documentation":{"short":"Determines if the default and release branches are protected with GitHub's branch protection settings.","url":"https://github.com/ossf/scorecard/blob/40576783fda6698350fcbbeaea760ff827433034/docs/checks.md#branch-protection"}},{"name":"SAST","score":0,"reason":"SAST tool is not run on all commits -- score normalized to 0","details":["Warn: 0 commits out of 21 are checked with a SAST tool"],"documentation":{"short":"Determines if the project uses static code analysis.","url":"https://github.com/ossf/scorecard/blob/40576783fda6698350fcbbeaea760ff827433034/docs/checks.md#sast"}},{"name":"Vulnerabilities","score":0,"reason":"16 existing vulnerabilities detected","details":["Warn: Project is vulnerable to: RUSTSEC-2021-0145 / GHSA-g98v-hv3f-hcfr","Warn: Project is vulnerable to: RUSTSEC-2024-0375","Warn: Project is vulnerable to: RUSTSEC-2024-0421 / GHSA-h97m-ww89-6jmq","Warn: Project is vulnerable to: RUSTSEC-2024-0384","Warn: Project is vulnerable to: RUSTSEC-2023-0022 / GHSA-3gxf-9r58-2ghg","Warn: Project is vulnerable to: RUSTSEC-2023-0024 / GHSA-6hcf-g6gr-hhcr","Warn: Project is vulnerable to: RUSTSEC-2023-0023 / GHSA-9qwg-crg9-m2vc","Warn: Project is vulnerable to: RUSTSEC-2023-0044 / GHSA-xcf7-rvmh-g6q4","Warn: Project is vulnerable to: RUSTSEC-2023-0072 / GHSA-xphf-cx8h-7q9g","Warn: Project is vulnerable to: GHSA-q445-7m23-qrmw","Warn: Project is vulnerable to: RUSTSEC-2024-0357","Warn: Project is vulnerable to: RUSTSEC-2025-0004 / GHSA-rpmj-rpgj-qmpm","Warn: Project is vulnerable to: GHSA-4fcv-w3qc-ppgg","Warn: Project is vulnerable to: RUSTSEC-2025-0022","Warn: Project is vulnerable to: RUSTSEC-2023-0018 / GHSA-mc8h-8q98-g5hr","Warn: Project is vulnerable to: GHSA-c827-hfw6-qwvm"],"documentation":{"short":"Determines if the project has open, known unfixed vulnerabilities.","url":"https://github.com/ossf/scorecard/blob/40576783fda6698350fcbbeaea760ff827433034/docs/checks.md#vulnerabilities"}}]},"last_synced_at":"2025-08-23T02:00:50.291Z","repository_id":45433721,"created_at":"2025-08-23T02:00:50.291Z","updated_at":"2025-08-23T02:00:50.291Z"},"host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":286080680,"owners_count":29887781,"icon_url":"https://github.com/github.png","version":null,"created_at":"2022-05-30T11:31:42.601Z","updated_at":"2026-02-27T05:38:26.446Z","status":"ssl_error","status_checked_at":"2026-02-27T05:38:25.235Z","response_time":57,"last_error":"SSL_connect returned=1 errno=0 peeraddr=140.82.121.6:443 state=error: unexpected eof while reading","robots_txt_status":"success","robots_txt_updated_at":"2025-07-24T06:49:26.215Z","robots_txt_url":"https://github.com/robots.txt","online":false,"can_crawl_api":true,"host_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub","repositories_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories","repository_names_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repository_names","owners_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners"}},"keywords":["advent","aoc","macro","rust","rust-library"],"created_at":"2024-11-10T09:09:41.878Z","updated_at":"2026-02-27T07:42:32.085Z","avatar_url":"https://github.com/remi-dupre.png","language":"Rust","funding_links":[],"categories":[],"sub_categories":[],"readme":"Advent of Code helper\n=====================\n\nThis crate provides a macro to generate a handful main for your [advent of\ncode][1] participation. The intention is to provide something similar to\n[cargo-aoc][2] through a much simple code base.\n\n![screenshoot](.screenshoot.png)\n\nCurrently this will only provide a few benefits:\n\n  - a somewhat pretty orchestration of your solutions\n  - automatic download and loading of your input files\n  - generation of criterion benchmarks\n\n\nUsage\n-----\n\nThe generator and solutions for a given day must be implemented in a module\ncalled `dayX`. Then you can simply invoke the `aoc_main::main!` macro in your\n`main.rs`:\n\n```rust\nmod day1 {\n    pub fn generator(input: \u0026str) -\u003e Vec\u003cu64\u003e {\n        input\n            .lines()\n            .map(|line| line.parse().unwrap())\n            .collect()\n    }\n\n    pub fn part_1(input: \u0026[u64]) -\u003e u64 {\n        input.iter().map(|\u0026mass| mass / 3 - 2).sum()\n    }\n\n    pub fn part_2(input: \u0026[u64]) -\u003e u64 {\n        fn total_needed_mass(obj: u64) -\u003e u64 {\n            if obj \u003c 9 {\n                0\n            } else {\n                let obj_mass = obj / 3 - 2;\n                obj_mass + total_needed_mass(obj_mass)\n            }\n        }\n\n        input.iter().copied().map(total_needed_mass).sum()\n    }\n}\n\nmod day2;\nmod day3;\n\naoc_main::main! {\n    year 2019;\n    day1 : generator =\u003e part_1, part_2;\n    day2 : generator =\u003e part_1, part_2, part_2_optimized;\n    day3             =\u003e part_1, part_2; // no generator, a \u0026str is passed\n}\n```\n\nThen you can simply run `cargo run`!\n\nNote that your solutions must take a borrowed version of the generator's\noutput. Also, the generator can output a structure that contains borrowed data\nfrom the original input file.\n\n\nBenchmarks\n----------\n\nYou can run Criterion benchmarks by running `cargo run --release -- --bench`,\nbut first you need to enable the `bench` feature in your *cargo.toml*:\n\n```toml\n[dependencies]\naoc-main = { version = \"*\", features = [\"bench\"] }\n```\n\n\nFetching your AOC token\n-----------------------\n\nWhen the command line asks you for your session token, you can apply the\nfollowing procedure (quoted from [cargo-aoc][2]):\n\n  - Firefox: \"Storage\" tab, Cookies, and copy the \"Value\" field of the session\n    cookie.\n  - Google Chrome / Chromium: \"Application\" tab, Cookies, and copy the \"Value\"\n    field of the session cookie.\n\nIf you wish to change or forget your connection token, you will have to remove\n`aoc` in your config directory (eg. `$HOME/.config/aoc` for linux users).\n\n\n[1]: https://adventofcode.com\n[2]: https://github.com/gobanos/cargo-aoc\n","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fremi-dupre%2Faoc","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fremi-dupre%2Faoc","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fremi-dupre%2Faoc/lists"}