Skip to content

LanguageTagger is a Semgrep utility that walks every project in a deployment, grabs the latest scan metrics to infer which languages were parsed, and ensures matching tags exist on the project (one tag per language, lowercase). It logs each step and ships with a lightweight EULA plus a README covering setup, token usage, and workflow expectations.

Notifications You must be signed in to change notification settings

r2c-CSE/languageTagger

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

3 Commits
 
 
 
 
 
 

Repository files navigation

languageTagger

Utility for Semgrep deployments that infers the languages used by each project (based on the most recent full scan) and ensures every language appears as a project tag.

Requirements

  • Python 3.10+ (tested on macOS 14)
  • requests library (pip install requests)
  • Valid SEMGREP_APP_TOKEN with permission to read deployments/projects and manage tags

Setup

cd /Users/Documents/GitHub/languageTagger
python3 -m venv .venv
source .venv/bin/activate
pip install --upgrade pip requests

Usage

Run the script with your token scoped to the single command:

SEMGREP_APP_TOKEN=<your-token> python3 language_tagger.py

The script will:

  1. Discover the deployment associated with the token.
  2. Gather every project (with pagination).
  3. Fetch the latest scan metrics per project to infer languages.
  4. Add missing tags using the lowercase language name (e.g., java, yaml).

A log file (language_tagger.log) is written next to the script for auditing.

EULA

Usage of this project is governed by EULA.md, which states that Christopher Morris and GPT-5.1 Codex co-developed the software and assume no responsibility for misuse or resulting issues. Read the EULA before distributing or modifying the project.

Development Notes

  • Adjust logging configuration in _configure_logging if you need different verbosity.
  • Run python3 -m pip install -r requirements.txt if you later add a requirements file.
  • Contributions should include updated docs and, when applicable, sample logs.

About

LanguageTagger is a Semgrep utility that walks every project in a deployment, grabs the latest scan metrics to infer which languages were parsed, and ensures matching tags exist on the project (one tag per language, lowercase). It logs each step and ships with a lightweight EULA plus a README covering setup, token usage, and workflow expectations.

Resources

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published

Languages