Azure / Azure/azure-sdk-tools

Order API elements alphabetically by name

Open
#3,063 0 comments 0 reactions 0 assignees View on GitHub
APIView feature-request Go
Dominant language
C#
Stars
135
Forks
260
Avg merge
1d 22h
Merged PRs (30d)
115

Description

`apiviewgo` orders API elements first by kind, then alphabetically by name. For example, `type A interface` appears before `type Z interface` but both appear before `type A struct` because interfaces appear before structs. Ordering elements by name alone would make reviews easier to navigate.

Making it so isn't trivial and will entail reconsidering some `apiviewgo` architecture. My first thought is to introduce a common interface to the various `apiviewgo` types representing review elements. If this interface had methods for getting an element's name and its APIView tokens, it would be straightforward to collect all a module's elements, sort them by name, and output them while ignoring distinctions like `interface` vs `struct`.

Contributor guide

Open the contributing guide

Research direction

Start by tracing how apiviewgo represents review elements and how a module currently orders and emits them. Examine whether a common interface can expose each element's name and APIView tokens. Done means all module elements are output alphabetically by name, without ordering interfaces, structs, or other kinds separately.

Written by the indexing model from the issue text.

Assessment

Tech stack
csharp
Domain
api, tooling
Issue type
Feature
Difficulty
4/5
Estimated time
3-5 days
Activity status
Stale
Clarity
Mostly clear
Newbie friendliness
45/100

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.