Skip to content

Commit 78f29b1

Browse files
committed
feat: initial implementation of VSCWhere
A CLI tool to locate Visual Studio Code installations on Windows, inspired by vswhere.exe for Visual Studio. Features: - Registry-based discovery of VS Code installations - Support for Stable, Insiders, and Exploration builds - vswhere-compatible CLI flags (-format, -property, -latest, etc.) - Text and JSON output formats - ~220 KB standalone executable
0 parents  commit 78f29b1

20 files changed

Lines changed: 2814 additions & 0 deletions

.commitlintrc.yml

Lines changed: 80 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,80 @@
1+
# Commitlint configuration for conventional commits
2+
# Based on: https://www.conventionalcommits.org/
3+
4+
extends:
5+
- '@commitlint/config-conventional'
6+
7+
rules:
8+
# Type enum - allowed commit types
9+
type-enum:
10+
- 2 # Level: error
11+
- always
12+
- # Allowed types:
13+
- feat # New feature
14+
- fix # Bug fix
15+
- docs # Documentation only changes
16+
- style # Code style changes (formatting, missing semi-colons, etc)
17+
- refactor # Code refactoring (neither fixes a bug nor adds a feature)
18+
- perf # Performance improvements
19+
- test # Adding or updating tests
20+
- build # Changes to build system or dependencies
21+
- ci # CI/CD configuration changes
22+
- chore # Other changes that don't modify src or test files
23+
- revert # Revert a previous commit
24+
25+
# Type case should be lowercase
26+
type-case:
27+
- 2
28+
- always
29+
- lower-case
30+
31+
# Type must not be empty
32+
type-empty:
33+
- 2
34+
- never
35+
36+
# Scope case should be lowercase
37+
scope-case:
38+
- 2
39+
- always
40+
- lower-case
41+
42+
# Subject must not be empty
43+
subject-empty:
44+
- 2
45+
- never
46+
47+
# Subject must not end with a period
48+
subject-full-stop:
49+
- 2
50+
- never
51+
- '.'
52+
53+
# Disable subject-case to allow uppercase abbreviations (PR, API, CLI, etc.)
54+
subject-case:
55+
- 0
56+
57+
# Header (first line) max length
58+
header-max-length:
59+
- 2
60+
- always
61+
- 72
62+
63+
# Body should have a blank line before it
64+
body-leading-blank:
65+
- 1 # Warning level
66+
- always
67+
68+
# Footer should have a blank line before it
69+
footer-leading-blank:
70+
- 1 # Warning level
71+
- always
72+
73+
# Body max line length
74+
body-max-line-length:
75+
- 1 # Warning level
76+
- always
77+
- 100
78+
79+
# Help URL shown in error messages
80+
helpUrl: 'https://www.conventionalcommits.org/'

.editorconfig

Lines changed: 153 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,153 @@
1+
# EditorConfig - https://editorconfig.org
2+
3+
root = true
4+
5+
# All files
6+
[*]
7+
indent_style = space
8+
indent_size = 4
9+
end_of_line = crlf
10+
charset = utf-8
11+
trim_trailing_whitespace = true
12+
insert_final_newline = true
13+
14+
# XML files
15+
[*.{xml,csproj,props,targets,nuspec,slnx}]
16+
indent_size = 2
17+
18+
# JSON/YAML files
19+
[*.{json,yml,yaml}]
20+
indent_size = 2
21+
22+
# Markdown files
23+
[*.md]
24+
trim_trailing_whitespace = false
25+
26+
# C# files
27+
[*.cs]
28+
# Organize usings
29+
dotnet_sort_system_directives_first = true
30+
dotnet_separate_import_directive_groups = false
31+
32+
# this. preferences
33+
dotnet_style_qualification_for_field = false:suggestion
34+
dotnet_style_qualification_for_property = false:suggestion
35+
dotnet_style_qualification_for_method = false:suggestion
36+
dotnet_style_qualification_for_event = false:suggestion
37+
38+
# Language keywords vs BCL types preferences
39+
dotnet_style_predefined_type_for_locals_parameters_members = true:suggestion
40+
dotnet_style_predefined_type_for_member_access = true:suggestion
41+
42+
# Modifier preferences
43+
dotnet_style_require_accessibility_modifiers = for_non_interface_members:suggestion
44+
dotnet_style_readonly_field = true:suggestion
45+
46+
# Parentheses preferences
47+
dotnet_style_parentheses_in_arithmetic_binary_operators = always_for_clarity:silent
48+
dotnet_style_parentheses_in_relational_binary_operators = always_for_clarity:silent
49+
dotnet_style_parentheses_in_other_binary_operators = always_for_clarity:silent
50+
dotnet_style_parentheses_in_other_operators = never_if_unnecessary:silent
51+
52+
# Expression-level preferences
53+
dotnet_style_object_initializer = true:suggestion
54+
dotnet_style_collection_initializer = true:suggestion
55+
dotnet_style_explicit_tuple_names = true:suggestion
56+
dotnet_style_prefer_inferred_tuple_names = true:suggestion
57+
dotnet_style_prefer_inferred_anonymous_type_member_names = true:suggestion
58+
dotnet_style_prefer_auto_properties = true:suggestion
59+
dotnet_style_prefer_conditional_expression_over_assignment = true:suggestion
60+
dotnet_style_prefer_conditional_expression_over_return = true:suggestion
61+
dotnet_style_prefer_compound_assignment = true:suggestion
62+
dotnet_style_prefer_simplified_interpolation = true:suggestion
63+
dotnet_style_prefer_simplified_boolean_expressions = true:suggestion
64+
65+
# Null-checking preferences
66+
dotnet_style_coalesce_expression = true:suggestion
67+
dotnet_style_null_propagation = true:suggestion
68+
dotnet_style_prefer_is_null_check_over_reference_equality_method = true:suggestion
69+
70+
# var preferences
71+
csharp_style_var_for_built_in_types = false:suggestion
72+
csharp_style_var_when_type_is_apparent = true:suggestion
73+
csharp_style_var_elsewhere = false:suggestion
74+
75+
# Expression-bodied members
76+
csharp_style_expression_bodied_methods = when_on_single_line:suggestion
77+
csharp_style_expression_bodied_constructors = false:suggestion
78+
csharp_style_expression_bodied_operators = when_on_single_line:suggestion
79+
csharp_style_expression_bodied_properties = true:suggestion
80+
csharp_style_expression_bodied_indexers = true:suggestion
81+
csharp_style_expression_bodied_accessors = true:suggestion
82+
csharp_style_expression_bodied_lambdas = true:suggestion
83+
csharp_style_expression_bodied_local_functions = when_on_single_line:suggestion
84+
85+
# Pattern matching preferences
86+
csharp_style_pattern_matching_over_is_with_cast_check = true:suggestion
87+
csharp_style_pattern_matching_over_as_with_null_check = true:suggestion
88+
csharp_style_prefer_switch_expression = true:suggestion
89+
csharp_style_prefer_pattern_matching = true:suggestion
90+
csharp_style_prefer_not_pattern = true:suggestion
91+
92+
# Code-block preferences
93+
csharp_prefer_braces = true:suggestion
94+
csharp_prefer_simple_using_statement = true:suggestion
95+
96+
# 'using' directive preferences
97+
csharp_using_directive_placement = outside_namespace:suggestion
98+
99+
# New line preferences
100+
csharp_new_line_before_open_brace = all
101+
csharp_new_line_before_else = true
102+
csharp_new_line_before_catch = true
103+
csharp_new_line_before_finally = true
104+
csharp_new_line_before_members_in_object_initializers = true
105+
csharp_new_line_before_members_in_anonymous_types = true
106+
csharp_new_line_between_query_expression_clauses = true
107+
108+
# Indentation preferences
109+
csharp_indent_case_contents = true
110+
csharp_indent_switch_labels = true
111+
csharp_indent_labels = one_less_than_current
112+
csharp_indent_block_contents = true
113+
csharp_indent_braces = false
114+
csharp_indent_case_contents_when_block = false
115+
116+
# Space preferences
117+
csharp_space_after_cast = false
118+
csharp_space_after_keywords_in_control_flow_statements = true
119+
csharp_space_between_parentheses = false
120+
csharp_space_before_colon_in_inheritance_clause = true
121+
csharp_space_after_colon_in_inheritance_clause = true
122+
csharp_space_around_binary_operators = before_and_after
123+
csharp_space_between_method_declaration_parameter_list_parentheses = false
124+
csharp_space_between_method_declaration_empty_parameter_list_parentheses = false
125+
csharp_space_between_method_declaration_name_and_open_parenthesis = false
126+
csharp_space_between_method_call_parameter_list_parentheses = false
127+
csharp_space_between_method_call_empty_parameter_list_parentheses = false
128+
csharp_space_between_method_call_name_and_opening_parenthesis = false
129+
csharp_space_after_comma = true
130+
csharp_space_before_comma = false
131+
csharp_space_after_dot = false
132+
csharp_space_before_dot = false
133+
csharp_space_after_semicolon_in_for_statement = true
134+
csharp_space_before_semicolon_in_for_statement = false
135+
csharp_space_around_declaration_statements = false
136+
csharp_space_before_open_square_brackets = false
137+
csharp_space_between_empty_square_brackets = false
138+
csharp_space_between_square_brackets = false
139+
140+
# Wrapping preferences
141+
csharp_preserve_single_line_statements = false
142+
csharp_preserve_single_line_blocks = true
143+
144+
# Naming conventions
145+
dotnet_naming_rule.private_fields_should_be_camel_case_with_underscore.severity = suggestion
146+
dotnet_naming_rule.private_fields_should_be_camel_case_with_underscore.symbols = private_fields
147+
dotnet_naming_rule.private_fields_should_be_camel_case_with_underscore.style = camel_case_with_underscore
148+
149+
dotnet_naming_symbols.private_fields.applicable_kinds = field
150+
dotnet_naming_symbols.private_fields.applicable_accessibilities = private
151+
152+
dotnet_naming_style.camel_case_with_underscore.capitalization = camel_case
153+
dotnet_naming_style.camel_case_with_underscore.required_prefix = _

.github/pull_request_template.md

Lines changed: 69 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,69 @@
1+
## Description
2+
3+
<!-- Provide a clear and concise description of your changes -->
4+
5+
## Type of Change
6+
7+
<!-- Mark the relevant option with an "x" -->
8+
9+
- [ ] Bug fix (non-breaking change which fixes an issue)
10+
- [ ] New feature (non-breaking change which adds functionality)
11+
- [ ] Breaking change (fix or feature that would cause existing functionality to not work as expected)
12+
- [ ] Documentation update
13+
- [ ] Code refactoring (no functional changes)
14+
- [ ] Performance improvement
15+
- [ ] CI/CD or build process change
16+
17+
## Related Issues
18+
19+
<!-- Link to related issues using #issue_number -->
20+
21+
Fixes #
22+
Relates to #
23+
24+
## Changes Made
25+
26+
<!-- List the key changes you've made -->
27+
28+
-
29+
-
30+
-
31+
32+
## Testing
33+
34+
<!-- Describe the tests you've run to verify your changes -->
35+
36+
### Test Environment
37+
38+
- OS: <!-- e.g., Windows 11 -->
39+
- Rust Version: <!-- e.g., 1.83.0 -->
40+
41+
### Test Steps
42+
43+
1.
44+
2.
45+
3.
46+
47+
## Checklist
48+
49+
<!-- Mark completed items with an "x" -->
50+
51+
- [ ] My code follows the project's coding conventions
52+
- [ ] I have run `cargo build --release` and verified no errors or warnings
53+
- [ ] I have run `cargo clippy` and addressed any lints
54+
- [ ] I have tested my changes locally
55+
- [ ] I have updated documentation if needed
56+
- [ ] My changes generate no new warnings or errors
57+
- [ ] I have followed conventional commit format in my commit messages
58+
59+
## Screenshots / Demo
60+
61+
<!-- If applicable, add screenshots or command output showing your changes -->
62+
63+
```
64+
# Paste relevant output here
65+
```
66+
67+
## Additional Notes
68+
69+
<!-- Any additional information that reviewers should know -->

.github/workflows/build.yml

Lines changed: 50 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,50 @@
1+
name: Build
2+
3+
on:
4+
workflow_dispatch:
5+
pull_request:
6+
types: [opened, reopened, synchronize]
7+
paths:
8+
- 'src/**'
9+
- 'Cargo.toml'
10+
- 'Cargo.lock'
11+
- '.github/workflows/build.yml'
12+
push:
13+
branches:
14+
- main
15+
paths:
16+
- 'src/**'
17+
- 'Cargo.toml'
18+
- 'Cargo.lock'
19+
- '.github/workflows/build.yml'
20+
21+
jobs:
22+
build:
23+
name: Build
24+
runs-on: windows-latest
25+
steps:
26+
- name: Checkout
27+
uses: actions/checkout@v4
28+
29+
- name: Setup Rust
30+
uses: dtolnay/rust-toolchain@stable
31+
with:
32+
components: clippy, rustfmt
33+
34+
- name: Cache cargo
35+
uses: Swatinem/rust-cache@v2
36+
37+
- name: Check formatting
38+
run: cargo fmt --check
39+
40+
- name: Clippy
41+
run: cargo clippy -- -D warnings
42+
43+
- name: Build
44+
run: cargo build --release
45+
46+
- name: Upload artifact
47+
uses: actions/upload-artifact@v4
48+
with:
49+
name: vscwhere
50+
path: target/release/vscwhere.exe

0 commit comments

Comments
 (0)