diff --git a/README.md b/README.md index 5ab0e58a3..89e75a02e 100644 --- a/README.md +++ b/README.md @@ -298,7 +298,7 @@ Also check out the sister project, [awesome-dynamic-analysis](https://github.com - [Gendarme](https://www.mono-project.com/docs/tools+libraries/tools/gendarme) — Gendarme inspects programs and libraries that contain code in ECMA CIL format (Mono and .NET). -- [Infer#](https://github.com/microsoft/infersharp) :warning: — InferSharp (also referred to as Infer#) is an interprocedural and scalable static code analyzer for C#. Via the capabilities of Facebook's Infer, this tool detects null pointer dereferences and resource leaks. +- [Infer#](https://github.com/microsoft/infersharp) — InferSharp (also referred to as Infer#) is an interprocedural and scalable static code analyzer for C#. Via the capabilities of Facebook's Infer, this tool detects null pointer dereferences and resource leaks. - [Meziantou.Analyzer](https://github.com/meziantou/Meziantou.Analyzer) — A Roslyn analyzer to enforce some good practices in C# in terms of design, usage, security, performance, and style. @@ -1698,7 +1698,7 @@ Loading address: binbloom can parse a raw binary firmware and determine its load - [Ghidra](https://ghidra-sre.org) — A software reverse engineering (SRE) suite of tools developed by NSA's Research Directorate in support of the Cybersecurity mission -- [Hopper](https://www.hopperapp.com/) :copyright: — macOS and Linux reverse engineering tool that lets you disassemble, decompile and debug applications. Hopper displays the code using different representations, e.g. the Control Flow Graph, and the pseudo-code of a procedure. Supports Apple Silicon. +- [Hopper](https://www.hopperapp.com/) :warning: :copyright: — macOS and Linux reverse engineering tool that lets you disassemble, decompile and debug applications. Hopper displays the code using different representations, e.g. the Control Flow Graph, and the pseudo-code of a procedure. Supports Apple Silicon. - [IDA Free](https://www.hex-rays.com/products/ida/support/download_freeware) :copyright: — Binary code analysis tool. diff --git a/data/render/src/bin/main.rs b/data/render/src/bin/main.rs index 31838f30b..8c20ad51b 100644 --- a/data/render/src/bin/main.rs +++ b/data/render/src/bin/main.rs @@ -3,6 +3,7 @@ use askama::Template; use pico_args::Arguments; use render::types::{Entry, ParsedEntry, Tag, Tags, Type}; use render::{check_deprecated, create_api, create_catalog}; +use slug::slugify; use std::collections::BTreeMap; use std::env; use std::ffi::OsStr; @@ -49,6 +50,24 @@ fn read_tools(path: PathBuf) -> Result> { .collect::, _>>() } +/// Backfills the deprecated field in the tools data from the old tools data. +fn backfill_deprecated(tools: &mut Vec) -> Result<()> { + let tools_raw = match fs::read_to_string("data/api/tools.json") { + Ok(content) => content, + Err(_) => return Ok(()), // No old data to backfill from. Skip silently. + }; + + let old_tools_data: BTreeMap = serde_json::from_str(&tools_raw)?; + + for tool in tools { + let id = slugify(&tool.name); + if let Some(old_tool) = old_tools_data.get(&id) { + tool.deprecated = old_tool.get("deprecated").and_then(|d| d.as_bool()); + } + } + Ok(()) +} + fn main() -> Result<()> { let mut args = Arguments::from_env(); let args = Args { @@ -69,10 +88,16 @@ fn main() -> Result<()> { let mut tools = tools?; tools.sort(); - if !args.skip_deprecated { - if let Ok(token) = env::var("GITHUB_TOKEN") { - check_deprecated(token, &mut tools)?; + let should_check_deprecation = !args.skip_deprecated; + let github_token = env::var("GITHUB_TOKEN"); + + match (should_check_deprecation, github_token) { + (true, Ok(token)) => check_deprecated(token, &mut tools)?, + (true, Err(_)) => { + eprintln!("No GITHUB_TOKEN environment variable found. Reusing old deprecation data."); + backfill_deprecated(&mut tools)?; } + (false, _) => backfill_deprecated(&mut tools)?, } let languages: Vec = tags diff --git a/data/render/src/types.rs b/data/render/src/types.rs index 312fe4510..82e58faf4 100644 --- a/data/render/src/types.rs +++ b/data/render/src/types.rs @@ -61,6 +61,8 @@ pub enum Category { Linter, #[serde(rename = "formatter")] Formatter, + #[serde(rename = "performance")] + Performance, #[serde(rename = "meta")] Meta, }