# Changelog

All notable changes to Asset Naming Manager are documented in this file.

The format is based on [Keep a Changelog](https://keepachangelog.com/en/1.1.0/),
and this project adheres to [Semantic Versioning](https://semver.org/spec/v2.0.0.html).

## [1.0.0] - 2026-09-17

First public release. Unity 2022.3 LTS and newer; verified on 2022.3, Unity 6000.4, 6000.5 and
6000.6. Editor-only assembly, no runtime footprint, no third-party dependencies.

### Added

#### Rule engine

- `NamingRuleSet` ScriptableObject holding the whole project convention in one committable asset,
  created from `Assets ▸ Create ▸ Asset Naming Manager ▸ Naming Rule Set`.
- `NamingRule` rows with three optional matchers, ANDed together, empty meaning wildcard:
  `extensions`, `typeNames` and `pathFilters`.
- Per-rule checks: `requiredPrefix` and `requiredSuffix` with several accepted alternatives,
  `convention`, `minLength`, `maxLength`, `customRegex` with `regexMustMatch`, `allowedFolders`,
  `forbiddenFolders`, `preferredFolder`, `severity`, `allowAutoFix` and a team `note` shown on
  every finding from that rule.
- Casing conventions: `Any`, `PascalCase`, `CamelCase`, `SnakeCase`, `ScreamingSnakeCase`,
  `KebabCase` and `PascalSnakeCase`, checked on the name body after the prefix and suffix are
  stripped. A segment may open with a digit, so `3DGrid` and `Player_Run_02` are accepted rather
  than reported forever.
- Specificity tie-break so exactly one rule owns each asset: path filters score 8, extensions 4,
  type names 4; equal scores go to the rule higher in the list.
- `NamingRuleSet.Validate()` and `NamingRule.Validate()`, reporting invalid regular expressions,
  impossible length ranges, duplicate rule names, a preferred folder with no allowed folders, and
  a CI gate that can never fire.
- Scan scoping through `scanRoots` and `ignoredPaths`, pre-populated to skip the tool's own
  `Editor`, `Documentation` and `Settings` folders, `Assets/Plugins`, `Assets/ThirdParty`,
  `Assets/StreamingAssets`, editor default resources and `.dll`, `.asmdef` and `.asmref` files.
  `Demo` is deliberately left in scope so the first scan has something to show.

#### Project-wide checks

- Illegal characters, configurable through `forbiddenCharacters`, at `Error` by default.
- ASCII-only names, on by default, for the accented file names that break build farms.
- Duplicate names with `NameOnly`, `NameAndExtension` and `NameAndType` scopes.
- Loose assets in the `Assets` root.
- Empty folders, reported and never deleted.
- Junk words — copy, final, new, old, temp, tmp, test, backup, bak, untitled, duplicate, dup,
  wip — with a user-editable list, skipped on single-word names that are deliberately the word.
- Folder naming against a casing convention, off by default.
- Trailing-number zero padding at a configurable width of 2 to 5 digits, off by default.
- Path length against a configurable limit, default 180 characters, for the Windows 260 wall.

#### Scanning

- `NamingScanner.Scan(ruleSet, options)`, read-only and never touching an asset.
- `ScanOptions` with `roots`, `explicitPaths`, `includeFolders`, `includeDuplicates` and a
  cancelable `onProgress` callback.
- Selecting a folder scans everything beneath it, not just the folder's own name — for the window's
  Selection button, for `Assets ▸ Asset Naming Manager ▸ Check Selected` and for `Fix Selected`.
- `ScanReport` with per-severity counts, `AffectedAssetCount`, `AutoFixableCount`, `HealthScore`
  from 0 to 100 weighted by severity and normalised by project size, `HealthLabel`,
  `WorstSeverity`, `CountBy` and `Sorted` aggregation helpers, `FailsGate(severity)` and a
  one-line `Summary()`.
- `AssetNamingViolation` findings carrying the asset GUID, the rule that fired, a one-line
  message, a long explanation, the proposed name and the proposed folder.
- Sixteen violation kinds, each with a human label: missing prefix, missing suffix, wrong casing,
  illegal character, wrong folder, forbidden folder, duplicate name, name too long, name too
  short, pattern mismatch, junk word, number padding, loose in root, empty folder, folder naming
  and path too long.

#### Safe fixing

- `NamingFixer.ComputeIdealName`: strip illegal characters, drop junk words, split the prefix and
  suffix, pad numbers, convert casing, reattach the prefix and suffix, clamp to `maxLength` by
  trimming the body only.
- `NamingFixer.BuildPlans` merging every finding on one asset into a single change, so a wrong
  prefix and a wrong folder become one rename-and-move.
- `NamingFixer.Apply` going through `AssetDatabase.MoveAsset`, so GUIDs survive and every prefab,
  scene and script reference follows the asset.
- Every change validated with `AssetDatabase.ValidateMoveAsset` before it is attempted, with
  per-asset failures collected in `FixResult.problems` rather than aborting the batch.
- Automatic collision resolution with `_01`, `_02` counters, case-insensitive so that Windows and
  macOS file systems cannot collide on case alone.
- Missing destination folders created automatically through `NamingFixer.EnsureFolder`.
- `FixResult` totals for renamed, moved, skipped and failed, plus the journal batch id.

#### Fix Journal

- Every fix batch recorded to `UserSettings/AssetNamingManager/FixJournal.json`, which Unity's default
  `.gitignore` already excludes.
- The last 20 batches kept and revertible, because Unity's own undo does not cover
  `AssetDatabase` moves.
- `FixJournal.All`, `Latest`, `Find`, `Record`, `Revert` and `Clear`, with a revert that walks a
  batch backwards, recreates missing original folders, and reports rather than guesses when an
  asset has since been renamed again.

#### Window

- The "Asset Naming Manager" window, built with UI Toolkit and theme-aware in both the Pro and Light
  editor skins.
- **Report tab**: virtualized list, severity pills, per-row before and after with the changed part
  highlighted, checkbox batch selection (disabled on findings with no concrete fix), click to ping,
  double-click to open, and a details pane with a "Fix this one" action.
- A preflight sheet on every batch: "Preview changes" lists each rename and move before anything is
  written, and the confirm button carries the count — "Apply 17 changes". A failure sheet afterwards
  names anything that could not be done, and an undo bar offers the batch straight back.
- **Dashboard tab**: Health score drawn as a Painter2D arc gauge, a Painter2D severity donut with a
  clickable legend, bar charts for findings per rule, findings per problem and worst folders, and a
  stat strip. Clicking any of them jumps to the Report tab already filtered.
- **Rules tab**: a read-only card per rule showing what it does and does not check, an enable toggle
  per card, one-click preset switching, live validation of the rule set, and "Edit in Inspector" for
  the fields themselves.
- **History tab**: past fix batches, each with Show and Revert, plus Clear history.
- Header with the rule set picker, theme switcher, Selection and Scan; Report toolbar with search,
  severity toggles, "Select fixable", export, and Group by None, Rule, Folder, Type, Severity or
  Problem.
- Swappable USS themes, discovered from the themes folder or picked from disk, overriding colour
  tokens only so a package update still reaches you.

#### Presets

- `Unity Standard`, `Unreal Style` (`T_`, `M_`, `SM_`, `BP_`), `Mobile 2D`, `Minimal` and
  `Strict Studio`. Each seeds both the rule list and the project-wide switches.
- The package ships a rule set asset already applied: `Settings/NamingRules.asset` on **Unity
  Standard** — PascalCase everywhere, no prefixes, scripts raised to `Error` because a C# file name
  has to match its class. There is nothing to create before the first scan.

#### Integrations

- `Tools ▸ Asset Naming Manager ▸ Open Window`, and `Scan Project` bound to `Ctrl+Shift+N`, which opens
  the window and scans.
- `Tools ▸ Asset Naming Manager ▸ Create Rule Set ▸ …`, one entry per preset, each creating a rule set,
  making it active and selecting it so the Inspector is already showing the rules.
- `Assets ▸ Asset Naming Manager ▸ Check Selected / Fix Selected` in the Project window context menu,
  reporting to the Console, greyed out when nothing is selected, and refusing to fix a partial list
  after a cancelled scan.
- Project window overlay drawing a severity-coloured dot on every offending asset from the last full
  scan, in both the list and grid layouts. On by default.
- `Edit ▸ Project Settings ▸ Asset Naming Manager`, split into what the rule set asset carries — the
  active rule set picker and the import check — and what `EditorPrefs` keeps on this machine only:
  the overlay, scan on open, log to console and confirm before fixing, with a reset button. Every
  field says which of the two it is.
- Import hook built on `AssetPostprocessor`, off by default, warning in the Console the moment a
  badly named asset is imported. Report-only, capped at 20 lines per import, skips the sweep that
  follows a domain reload, honours `scanRoots`, and can never abort an import.
- CI entry point `AssetNamingManager.NamingManagerCI.Run` for `-executeMethod`, with `-namingManagerReport`
  (format taken from the file extension, resolved against the project root, defaulting to a
  timestamped HTML file in `reportFolder`) and `-namingManagerFailOn` (`info`, `warning`, `error` or
  `none`, defaulting to the rule set's `ciFailOn`). Exits 0 for clean, 1 for a failed gate and 2 for
  a misconfigured run — including a rule set that does not validate, so a broken job can never look
  like a clean one.

#### Reports

- `ReportExporter.Write(report, format, path)` producing CSV, JSON, Markdown, or a self-contained
  styled HTML page with no external assets, suitable for publishing as a CI build artifact.
- A configurable `reportFolder`, default `NamingManagerReports`, where a CI run with no
  `-namingManagerReport` puts its report. It sits next to `Assets` rather than inside it, so Unity does
  not re-import your reports. The window's own Export uses a save dialog and remembers the last
  folder you chose.

#### Public utilities

- `NameUtility`: tokenizing that handles separators, camelCase humps, acronym runs such as
  `HTTPServer` and letter-to-digit boundaries such as `Run02` while keeping `2D` fused, plus
  convention matching, conversion, acronym-aware capitalisation, illegal-character stripping,
  separator collapsing, junk-word detection and removal, and trailing-number padding. Pure and
  Unity-free — no `UnityEditor` or `UnityEngine` types in or out.
- `GlobMatcher`: `*`, `**` and `?` path matching with a compiled-pattern cache, where a pattern
  with no wildcard is treated as a folder-segment test and a trailing `/**` also matches the folder
  itself.
- Documentation: `README.md`, `QuickStart.md`, `RuleCookbook.md`, `CI-Integration.md` and this
  changelog.
- A `Demo/Examples` folder of deliberately badly named files, so the first scan finds something on
  an otherwise clean project. Delete it, or add it to `ignoredPaths`, once you have seen it work.

[1.0.0]: https://assetstore.unity.com
