Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
280 changes: 280 additions & 0 deletions .editorconfig
Original file line number Diff line number Diff line change
@@ -0,0 +1,280 @@
# EditorConfig: https://editorconfig.org
# Applied by Visual Studio, VS Code, Rider, and `dotnet format`.

root = true

# -----------------------------
# All files
# -----------------------------
[*]
charset = utf-8
end_of_line = crlf
insert_final_newline = true
trim_trailing_whitespace = true
indent_style = space
indent_size = 4

# -----------------------------
# Markdown
# -----------------------------
[*.md]
trim_trailing_whitespace = false

# -----------------------------
# YAML / GitHub Actions
# -----------------------------
[*.{yml,yaml}]
indent_size = 2

# -----------------------------
# JSON
# -----------------------------
[*.json]
indent_size = 2

# -----------------------------
# XML / MSBuild project files
# -----------------------------
[*.{xml,config,props,targets,nuspec,resx,ruleset,vsixmanifest,vsct}]
indent_style = tab
indent_size = 4

[*.{csproj,vbproj,vcxproj,vcxproj.filters,proj,projitems,shproj}]
indent_style = tab
indent_size = 4

[*.{sln,DotSettings}]
indent_style = tab
indent_size = 4

# -----------------------------
# Shell / scripts
# -----------------------------
[*.{sh,ps1,cmd,bat}]
end_of_line = lf
indent_size = 2

[*.{cmd,bat,ps1}]
end_of_line = crlf

# -----------------------------
# C# source
# -----------------------------
[*.cs]
indent_style = space
indent_size = 4

#### .NET coding conventions ####
dotnet_sort_system_directives_first = true
dotnet_separate_import_directive_groups = false

# this. / Me. preferences
dotnet_style_qualification_for_field = false:suggestion
dotnet_style_qualification_for_property = false:suggestion
dotnet_style_qualification_for_method = false:suggestion
dotnet_style_qualification_for_event = false:suggestion

# Language keywords vs BCL types
dotnet_style_predefined_type_for_locals_parameters_members = true:suggestion
dotnet_style_predefined_type_for_member_access = true:suggestion

# Modifier preferences
dotnet_style_require_accessibility_modifiers = for_non_interface_members:suggestion
dotnet_style_readonly_field = true:suggestion

# Parentheses preferences
dotnet_style_parentheses_in_arithmetic_binary_operators = always_for_clarity:silent
dotnet_style_parentheses_in_relational_binary_operators = always_for_clarity:silent
dotnet_style_parentheses_in_other_binary_operators = always_for_clarity:silent
dotnet_style_parentheses_in_other_operators = never_if_unnecessary:silent

# Expression-level preferences
dotnet_style_object_initializer = true:suggestion
dotnet_style_collection_initializer = true:suggestion
dotnet_style_explicit_tuple_names = true:suggestion
dotnet_style_prefer_inferred_tuple_names = true:suggestion
dotnet_style_prefer_inferred_anonymous_type_member_names = true:suggestion
dotnet_style_prefer_auto_properties = true:suggestion
dotnet_style_prefer_conditional_expression_over_assignment = true:silent
dotnet_style_prefer_conditional_expression_over_return = true:silent
dotnet_style_prefer_compound_assignment = true:suggestion
dotnet_style_prefer_simplified_interpolation = true:suggestion
dotnet_style_prefer_simplified_boolean_expressions = true:suggestion
dotnet_style_namespace_match_folder = true:suggestion

# Null checking
dotnet_style_coalesce_expression = true:suggestion
dotnet_style_null_propagation = true:suggestion
dotnet_style_prefer_is_null_check_over_reference_equality_method = true:suggestion
dotnet_style_prefer_null_check_over_type_check = true:suggestion

# Parameter preferences
dotnet_code_quality_unused_parameters = all:suggestion

# Suppression
dotnet_remove_unnecessary_suppression_exclusions = none

#### C# coding conventions ####
# var preferences — prefer explicit types (matches existing sample style)
csharp_style_var_for_built_in_types = false:suggestion
csharp_style_var_when_type_is_apparent = false:suggestion
csharp_style_var_elsewhere = false:suggestion

# Expression-bodied members
csharp_style_expression_bodied_methods = false:silent
csharp_style_expression_bodied_constructors = false:silent
csharp_style_expression_bodied_operators = false:silent
csharp_style_expression_bodied_properties = true:silent
csharp_style_expression_bodied_indexers = true:silent
csharp_style_expression_bodied_accessors = true:silent
csharp_style_expression_bodied_lambdas = true:silent
csharp_style_expression_bodied_local_functions = false:silent

# Pattern matching
csharp_style_pattern_matching_over_is_with_cast_check = true:suggestion
csharp_style_pattern_matching_over_as_with_null_check = true:suggestion
csharp_style_prefer_switch_expression = true:suggestion
csharp_style_prefer_pattern_matching = true:silent
csharp_style_prefer_not_pattern = true:suggestion
csharp_style_prefer_extended_property_pattern = true:suggestion

# Null checking
csharp_style_throw_expression = true:suggestion
csharp_style_conditional_delegate_call = true:suggestion

# Modifier preferences
csharp_prefer_static_local_function = true:suggestion
csharp_preferred_modifier_order = public,private,protected,internal,file,static,extern,new,virtual,abstract,sealed,override,readonly,unsafe,required,volatile,async:silent
csharp_style_prefer_readonly_struct = true:suggestion
csharp_style_prefer_readonly_struct_member = true:suggestion

# Code-block preferences (Allman / new-line braces — matches this repo)
csharp_prefer_braces = true:suggestion
csharp_prefer_simple_using_statement = true:suggestion
csharp_style_namespace_declarations = block_scoped:suggestion
csharp_style_prefer_method_group_conversion = true:silent
csharp_style_prefer_top_level_statements = false:suggestion
csharp_style_prefer_primary_constructors = false:suggestion

# Expression-level preferences
csharp_prefer_simple_default_expression = true:suggestion
csharp_style_deconstructed_variable_declaration = true:suggestion
csharp_style_inlined_variable_declaration = true:suggestion
csharp_style_prefer_index_operator = true:suggestion
csharp_style_prefer_range_operator = true:suggestion
csharp_style_prefer_local_over_anonymous_function = true:suggestion
csharp_style_prefer_tuple_swap = true:suggestion
csharp_style_prefer_utf8_string_literals = true:suggestion
csharp_style_implicit_object_creation_when_type_is_apparent = true:suggestion
csharp_style_prefer_null_check_over_type_check = true:suggestion

# 'using' directive preferences
csharp_using_directive_placement = outside_namespace:suggestion

# whether to prefer new() without type when type is apparent
dotnet_style_prefer_collection_expression = when_types_exactly_match:suggestion

#### C# formatting rules ####
# New line preferences
csharp_new_line_before_open_brace = all
csharp_new_line_before_else = true
csharp_new_line_before_catch = true
csharp_new_line_before_finally = true
csharp_new_line_before_members_in_object_initializers = true
csharp_new_line_before_members_in_anonymous_types = true
csharp_new_line_between_query_expression_clauses = true

# Indentation preferences
csharp_indent_case_contents = true
csharp_indent_switch_labels = true
csharp_indent_labels = one_less_than_current
csharp_indent_block_contents = true
csharp_indent_braces = false
csharp_indent_case_contents_when_block = true

# Space preferences
csharp_space_after_cast = false
csharp_space_after_keywords_in_control_flow_statements = true
csharp_space_between_method_declaration_parameter_list_parentheses = false
csharp_space_between_method_call_parameter_list_parentheses = false
csharp_space_between_parentheses = false
csharp_space_before_colon_in_inheritance_clause = true
csharp_space_after_colon_in_inheritance_clause = true
csharp_space_around_binary_operators = before_and_after
csharp_space_between_method_declaration_empty_parameter_list_parentheses = false
csharp_space_between_method_call_name_and_opening_parenthesis = false
csharp_space_between_method_call_empty_parameter_list_parentheses = false
csharp_space_after_comma = true
csharp_space_before_comma = false
csharp_space_after_dot = false
csharp_space_before_dot = false
csharp_space_after_semicolon_in_for_statement = true
csharp_space_before_semicolon_in_for_statement = false
csharp_space_around_declaration_statements = false
csharp_space_before_open_square_brackets = false
csharp_space_between_empty_square_brackets = false
csharp_space_between_square_brackets = false

# Wrapping preferences
csharp_preserve_single_line_statements = true
csharp_preserve_single_line_blocks = true

#### Naming conventions ####
dotnet_naming_style.pascal_case_style.capitalization = pascal_case
dotnet_naming_style.camel_case_style.capitalization = camel_case
dotnet_naming_style.i_prefix_style.required_prefix = I
dotnet_naming_style.i_prefix_style.capitalization = pascal_case
dotnet_naming_style.underscore_camel_case.required_prefix = _
dotnet_naming_style.underscore_camel_case.capitalization = camel_case

# Interfaces: IPascalCase
dotnet_naming_rule.interface_should_be_begins_with_i.severity = true
dotnet_naming_rule.interface_should_be_begins_with_i.symbols = interface_symbols
dotnet_naming_rule.interface_should_be_begins_with_i.style = i_prefix_style
dotnet_naming_symbols.interface_symbols.applicable_kinds = interface
dotnet_naming_symbols.interface_symbols.applicable_accessibilities = *
dotnet_naming_symbols.interface_symbols.required_modifiers =

# Types / non-field members: PascalCase
dotnet_naming_rule.types_should_be_pascal_case.severity = suggestion
dotnet_naming_rule.types_should_be_pascal_case.symbols = types_and_namespaces
dotnet_naming_rule.types_should_be_pascal_case.style = pascal_case_style
dotnet_naming_symbols.types_and_namespaces.applicable_kinds = class,struct,interface,enum,delegate,namespace
dotnet_naming_symbols.types_and_namespaces.applicable_accessibilities = *

dotnet_naming_rule.non_field_members_should_be_pascal_case.severity = suggestion
dotnet_naming_rule.non_field_members_should_be_pascal_case.symbols = non_field_members
dotnet_naming_rule.non_field_members_should_be_pascal_case.style = pascal_case_style
dotnet_naming_symbols.non_field_members.applicable_kinds = property,event,method
dotnet_naming_symbols.non_field_members.applicable_accessibilities = *

# Constants: PascalCase
dotnet_naming_rule.constant_fields_should_be_pascal_case.severity = suggestion
dotnet_naming_rule.constant_fields_should_be_pascal_case.symbols = constant_fields
dotnet_naming_rule.constant_fields_should_be_pascal_case.style = pascal_case_style
dotnet_naming_symbols.constant_fields.applicable_kinds = field
dotnet_naming_symbols.constant_fields.applicable_accessibilities = *
dotnet_naming_symbols.constant_fields.required_modifiers = const

# Private / internal instance fields: _camelCase
dotnet_naming_rule.private_fields_should_be_underscore_camel.severity = suggestion
dotnet_naming_rule.private_fields_should_be_underscore_camel.symbols = private_fields
dotnet_naming_rule.private_fields_should_be_underscore_camel.style = underscore_camel_case
dotnet_naming_symbols.private_fields.applicable_kinds = field
dotnet_naming_symbols.private_fields.applicable_accessibilities = private,private_protected,protected,internal,protected_internal
dotnet_naming_symbols.private_fields.required_modifiers =

# Static fields (non-const): PascalCase
dotnet_naming_rule.static_fields_should_be_pascal_case.severity = suggestion
dotnet_naming_rule.static_fields_should_be_pascal_case.symbols = static_fields
dotnet_naming_rule.static_fields_should_be_pascal_case.style = pascal_case_style
dotnet_naming_symbols.static_fields.applicable_kinds = field
dotnet_naming_symbols.static_fields.applicable_accessibilities = *
dotnet_naming_symbols.static_fields.required_modifiers = static

# Local variables / parameters: camelCase
dotnet_naming_rule.locals_should_be_camel_case.severity = suggestion
dotnet_naming_rule.locals_should_be_camel_case.symbols = locals_and_parameters
dotnet_naming_rule.locals_should_be_camel_case.style = camel_case_style
dotnet_naming_symbols.locals_and_parameters.applicable_kinds = parameter,local
dotnet_naming_symbols.locals_and_parameters.applicable_accessibilities = *
2 changes: 2 additions & 0 deletions .github/CODEOWNERS
Original file line number Diff line number Diff line change
@@ -0,0 +1,2 @@
# Default owners for code review requests
* @VAllens
48 changes: 48 additions & 0 deletions .github/ISSUE_TEMPLATE/bug_report.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,48 @@
name: Bug report
description: Report a problem with the crawler sample
labels: ["bug"]
body:
- type: markdown
attributes:
value: |
Thanks for filing a bug. Please include enough detail to reproduce the issue.
- type: textarea
id: description
attributes:
label: Description
description: What happened?
validations:
required: true
- type: textarea
id: repro
attributes:
label: Steps to reproduce
description: Exact commands / actions
value: |
1.
2.
3.
validations:
required: true
- type: input
id: sdk
attributes:
label: .NET SDK version
placeholder: e.g. 10.0.302
validations:
required: true
- type: dropdown
id: os
attributes:
label: OS
options:
- Windows
- Linux
- macOS
validations:
required: true
- type: textarea
id: logs
attributes:
label: Logs / exception
render: shell
23 changes: 23 additions & 0 deletions .github/ISSUE_TEMPLATE/feature_request.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,23 @@
name: Feature request
description: Suggest an improvement to the sample
labels: ["enhancement"]
body:
- type: textarea
id: problem
attributes:
label: Problem / motivation
description: What problem would this solve for learners or maintainers?
validations:
required: true
- type: textarea
id: proposal
attributes:
label: Proposed change
description: Describe the API / docs / sample change you want
validations:
required: true
- type: textarea
id: alternatives
attributes:
label: Alternatives considered
description: Optional
12 changes: 12 additions & 0 deletions .github/codex/prompts/review.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,12 @@
# Codex PR review rubric

When reviewing a pull request in this repository, focus on:

- Correctness bugs and exception paths
- Browser / page resource leaks
- Fragile HTML selectors and scraping breakage risks
- Security issues (secrets, unsafe deserialization, SSRF-like fetches)
- Missing docs / CI updates when runtime or packages change

Be concise and specific. Prefer actionable findings with file paths.
Keep feedback proportional to the size of the PR.
13 changes: 13 additions & 0 deletions .github/dependabot.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,13 @@
version: 2
updates:
- package-ecosystem: nuget
directory: /src/CrawlerSamples.ConsoleApp
schedule:
interval: weekly
open-pull-requests-limit: 5

- package-ecosystem: github-actions
directory: /
schedule:
interval: weekly
open-pull-requests-limit: 5
Loading