Skip to content

Commit 4593cf3

Browse files
Merge pull request #4 from PhanCongVuDuc/ducphan/Code-Clean
Feature/Code clean
2 parents 2377de6 + f6d9fe5 commit 4593cf3

File tree

85 files changed

+1207
-1357
lines changed

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

85 files changed

+1207
-1357
lines changed

.editorconfig

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -23,7 +23,7 @@ generated_code = true
2323
# C# files
2424
[*.cs]
2525
# New line preferences
26-
csharp_new_line_before_open_brace = all
26+
csharp_new_line_before_open_brace = accessors, anonymous_methods, anonymous_types, events, indexers, lambdas, local_functions, methods, object_collection_array_initializers, types
2727
csharp_new_line_before_else = true
2828
csharp_new_line_before_catch = true
2929
csharp_new_line_before_finally = true

CODE_OF_CONDUCT.md

Lines changed: 35 additions & 11 deletions
Original file line numberDiff line numberDiff line change
@@ -2,7 +2,10 @@
22

33
## Our Pledge
44

5-
We as members, contributors, and leaders pledge to make participation in our community a harassment-free experience for everyone, regardless of age, body size, visible or invisible disability, ethnicity, sex characteristics, gender identity and expression, level of experience, education, socio-economic status, nationality, personal appearance, race, religion, or sexual identity and orientation.
5+
We as members, contributors, and leaders pledge to make participation in our community a harassment-free experience for
6+
everyone, regardless of age, body size, visible or invisible disability, ethnicity, sex characteristics, gender identity
7+
and expression, level of experience, education, socio-economic status, nationality, personal appearance, race, religion,
8+
or sexual identity and orientation.
69

710
We pledge to act and interact in ways that contribute to an open, welcoming, diverse, inclusive, and healthy community.
811

@@ -26,41 +29,62 @@ Examples of unacceptable behavior include:
2629

2730
## Enforcement Responsibilities
2831

29-
Community leaders are responsible for clarifying and enforcing our standards of acceptable behavior and will take appropriate and fair corrective action in response to any behavior that they deem inappropriate, threatening, offensive, or harmful.
32+
Community leaders are responsible for clarifying and enforcing our standards of acceptable behavior and will take
33+
appropriate and fair corrective action in response to any behavior that they deem inappropriate, threatening, offensive,
34+
or harmful.
3035

31-
Community leaders have the right and responsibility to remove, edit, or reject comments, commits, code, wiki edits, issues, and other contributions that are not aligned to this Code of Conduct, or to ban temporarily or permanently any contributor for other behaviors that they deem inappropriate, threatening, offensive, or harmful.
36+
Community leaders have the right and responsibility to remove, edit, or reject comments, commits, code, wiki edits,
37+
issues, and other contributions that are not aligned to this Code of Conduct, or to ban temporarily or permanently any
38+
contributor for other behaviors that they deem inappropriate, threatening, offensive, or harmful.
3239

3340
## Scope
3441

35-
This Code of Conduct applies within all community spaces, and also applies when an individual is officially representing the community in public spaces. Examples of representing our community include using an official e-mail address, posting via an official social media account, or acting as an appointed representative at an online or offline event.
42+
This Code of Conduct applies within all community spaces, and also applies when an individual is officially representing
43+
the community in public spaces. Examples of representing our community include using an official e-mail address, posting
44+
via an official social media account, or acting as an appointed representative at an online or offline event.
3645

3746
## Enforcement
3847

39-
Instances of abusive, harassing, or otherwise unacceptable behavior may be reported to the community leaders responsible for enforcement by creating a [GitHub Issue](https://github.com/PhanCongVuDuc/Sonny/issues/new) with the `code-of-conduct` label. All complaints will be reviewed and investigated promptly and fairly.
48+
Instances of abusive, harassing, or otherwise unacceptable behavior may be reported to the community leaders responsible
49+
for enforcement by creating a [GitHub Issue](https://github.com/PhanCongVuDuc/Sonny/issues/new) with the
50+
`code-of-conduct` label. All complaints will be reviewed and investigated promptly and fairly.
4051

4152
All community leaders are obligated to respect the privacy and security of the reporter of any incident.
4253

4354
## Enforcement Guidelines
4455

45-
Community leaders will follow these Community Impact Guidelines in determining the consequences for any action they deem in violation of this Code of Conduct:
56+
Community leaders will follow these Community Impact Guidelines in determining the consequences for any action they deem
57+
in violation of this Code of Conduct:
4658

4759
### 1. Correction
48-
**Community Impact**: Use of inappropriate language or other behavior deemed unprofessional or unwelcome in the community.
4960

50-
**Consequence**: A private, written warning from community leaders, providing clarity around the nature of the violation and an explanation of why the behavior was inappropriate. A public apology may be requested.
61+
**Community Impact**: Use of inappropriate language or other behavior deemed unprofessional or unwelcome in the
62+
community.
63+
64+
**Consequence**: A private, written warning from community leaders, providing clarity around the nature of the violation
65+
and an explanation of why the behavior was inappropriate. A public apology may be requested.
5166

5267
### 2. Warning
68+
5369
**Community Impact**: A violation through a single incident or series of actions.
5470

55-
**Consequence**: A warning with consequences for continued behavior. No interaction with the people involved, including unsolicited interaction with those enforcing the Code of Conduct, for a specified period of time. This includes avoiding interactions in community spaces as well as external channels like social media. Violating these terms may lead to a temporary or permanent ban.
71+
**Consequence**: A warning with consequences for continued behavior. No interaction with the people involved, including
72+
unsolicited interaction with those enforcing the Code of Conduct, for a specified period of time. This includes avoiding
73+
interactions in community spaces as well as external channels like social media. Violating these terms may lead to a
74+
temporary or permanent ban.
5675

5776
### 3. Temporary Ban
77+
5878
**Community Impact**: A serious violation of community standards, including sustained inappropriate behavior.
5979

60-
**Consequence**: A temporary ban from any sort of interaction or public communication with the community for a specified period of time. No public or private interaction with the people involved, including unsolicited interaction with those enforcing the Code of Conduct, is allowed during this period. Violating these terms may lead to a permanent ban.
80+
**Consequence**: A temporary ban from any sort of interaction or public communication with the community for a specified
81+
period of time. No public or private interaction with the people involved, including unsolicited interaction with those
82+
enforcing the Code of Conduct, is allowed during this period. Violating these terms may lead to a permanent ban.
6183

6284
### 4. Permanent Ban
63-
**Community Impact**: Demonstrating a pattern of violation of community standards, including sustained inappropriate behavior, harassment of an individual, or aggression toward or disparagement of classes of individuals.
85+
86+
**Community Impact**: Demonstrating a pattern of violation of community standards, including sustained inappropriate
87+
behavior, harassment of an individual, or aggression toward or disparagement of classes of individuals.
6488

6589
**Consequence**: A permanent ban from any sort of public interaction within the community.
6690

CONTRIBUTING.md

Lines changed: 27 additions & 12 deletions
Original file line numberDiff line numberDiff line change
@@ -28,34 +28,42 @@ We love new ideas! Please create an issue with:
2828

2929
This project follows the **Git Flow** branching model with the following branches:
3030

31-
- **`master`**: Production-ready code. Only stable, tested releases are merged here. This branch should always be deployable.
32-
- **`develop`**: Integration branch for features. All feature branches merge into this branch. This is the main development branch.
31+
- **`master`**: Production-ready code. Only stable, tested releases are merged here. This branch should always be
32+
deployable.
33+
- **`develop`**: Integration branch for features. All feature branches merge into this branch. This is the main
34+
development branch.
3335
- **`feature/*`**: Feature branches for new functionality. Created from and merged back into `develop`.
34-
- **`release/*`**: Release branches for preparing new production releases. Created from `develop` and merged into both `master` and `develop`.
35-
- **`hotfix/*`**: Hotfix branches for urgent production bug fixes. Created from `master` and merged into both `master` and `develop`.
36+
- **`release/*`**: Release branches for preparing new production releases. Created from `develop` and merged into both
37+
`master` and `develop`.
38+
- **`hotfix/*`**: Hotfix branches for urgent production bug fixes. Created from `master` and merged into both `master`
39+
and `develop`.
3640

3741
#### Git Flow Diagram
3842

3943
![Git Flow Branching Model](assets/images/gitflow.png)
4044

41-
*Visual representation of the Git Flow branching model showing how commits flow between master, develop, feature, release, and hotfix branches.*
45+
*Visual representation of the Git Flow branching model showing how commits flow between master, develop, feature,
46+
release, and hotfix branches.*
4247

4348
#### Branch Usage Guidelines
4449

4550
**Feature Branches:**
51+
4652
- Created from `develop`
4753
- Used for developing new features
4854
- Merged back into `develop` via Pull Request
4955
- Naming convention: `feature/feature-name` (e.g., `feature/add-new-tool`)
5056

5157
**Release Branches:**
58+
5259
- Created from `develop` when preparing a new release
5360
- Used for final bug fixes and release preparations
5461
- Merged into both `master` (with version tag) and `develop`
5562
- Naming convention: `release/version-number` (e.g., `release/v1.0.0`)
5663
- Only maintainers create release branches
5764

5865
**Hotfix Branches:**
66+
5967
- Created from `master` for urgent production fixes
6068
- Used for critical bug fixes that cannot wait for the next release
6169
- Merged into both `master` (with version tag) and `develop`
@@ -65,20 +73,23 @@ This project follows the **Git Flow** branching model with the following branche
6573
### Pull Requests
6674

6775
**Workflow Overview:**
76+
6877
1. Fork the repository and clone it locally
6978
2. Create a feature branch from `develop` (see Git Flow diagram above)
7079
3. Make your changes and commit them
7180
4. Push your feature branch to your fork
7281
5. Create a Pull Request targeting `develop` branch
7382

7483
**Important Guidelines:**
84+
7585
- **Always create feature branches from `develop`**, not from `master`
7686
- **Pull requests must target `develop` branch** (not `master`)
7787
- Only maintainers merge `develop` into `master` for releases
7888
- Keep your feature branch up to date with `develop` before creating PR
7989

8090
**Commit Message Format:**
8191
Use clear commit messages following this format:
92+
8293
- `Add:` for new features
8394
- `Fix:` for bug fixes
8495
- `Update:` for updates to existing features
@@ -87,6 +98,7 @@ Use clear commit messages following this format:
8798
- `Test:` for test additions or changes
8899

89100
**When Creating a Pull Request:**
101+
90102
- Describe what your PR does
91103
- Reference any related issues (use `Closes #123` or `Fixes #123`)
92104
- Include screenshots if UI changes
@@ -96,12 +108,14 @@ Use clear commit messages following this format:
96108
### Release & Hotfix Branches (Maintainers Only)
97109

98110
**Release Branches:**
111+
99112
- Created from `develop` when preparing a new release
100113
- Used for final bug fixes and release preparations
101114
- Merged into both `master` (with version tag) and `develop`
102115
- See Git Flow diagram above for visual workflow
103116

104117
**Hotfix Branches:**
118+
105119
- Created from `master` for urgent production bug fixes
106120
- Used for critical fixes that cannot wait for the next release
107121
- Merged into both `master` (with version tag) and `develop`
@@ -114,9 +128,9 @@ Use clear commit messages following this format:
114128
- Follow the `.editorconfig` settings
115129
- Use meaningful variable and method names
116130
- Follow C# naming conventions:
117-
- PascalCase for classes, methods, properties
118-
- camelCase for local variables
119-
- _camelCase for private fields
131+
- PascalCase for classes, methods, properties
132+
- camelCase for local variables
133+
- _camelCase for private fields
120134
- Add XML documentation comments for public APIs
121135
- Keep methods focused and small
122136
- Use `var` when type is apparent
@@ -153,10 +167,10 @@ public double FromInternalUnit(double value, ForgeTypeId displayUnit)
153167
## Development Setup
154168

155169
1. Install prerequisites:
156-
- .NET Framework 4.8
157-
- .NET 9 SDK
158-
- Visual Studio or JetBrains Rider
159-
- Revit (for testing)
170+
- .NET Framework 4.8
171+
- .NET 9 SDK
172+
- Visual Studio or JetBrains Rider
173+
- Revit (for testing)
160174

161175
2. Clone repository with submodules:
162176
```bash
@@ -182,6 +196,7 @@ public double FromInternalUnit(double value, ForgeTypeId displayUnit)
182196
## Questions?
183197

184198
If you have questions about contributing, please:
199+
185200
- Open an issue with the `question` label
186201
- Check existing issues and discussions
187202
- Review the README.md for more information

Changelog.md

Lines changed: 4 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,17 +1,20 @@
11
# 1.0.0
22

33
## Features
4+
45
-**AutoColumnDimension** - Automatically create dimensions for columns in Revit
56
- 🌐 **Multi-language Support** - Multi-language support with ResourceDictionary and WPFLocalizeExtension
67
- ⚙️ **Settings Dialog** - Settings dialog for the plugin
78
- 🔧 **Multi-version Support** - Support for Revit 2021 - 2026
89
- 📏 **Multiple Units Support** - Support for multiple measurement units (feet, meters, inches, etc.)
910

1011
## Architecture
12+
1113
- 🏗️ **Dependency Injection** - Using Microsoft.Extensions.DependencyInjection
1214
- 🎨 **MVVM Pattern** - Implementing MVVM with CommunityToolkit.Mvvm
1315
- 🧪 **Unit Testing** - Testing framework with NUnit and NSubstitute
1416

1517
## Build & Development
18+
1619
- 🛠️ **Build Automation** - Build automation with Nuke
17-
- 📦 **MSBuild Customization** - Custom MSBuild targets and tasks
20+
- 📦 **MSBuild Customization** - Custom MSBuild targets and tasks

Readme.md

Lines changed: 25 additions & 10 deletions
Original file line numberDiff line numberDiff line change
@@ -15,11 +15,13 @@ Sonny is an **open source** project built with the following goals:
1515
- 🤝 **Community**: Together we develop, share knowledge and experiences
1616
- 🆓 **Free**: Create free tools for everyone to use
1717

18-
This project focuses on developing useful tools for the Revit community, with open source code so that everyone can learn, contribute, and use freely.
18+
This project focuses on developing useful tools for the Revit community, with open source code so that everyone can
19+
learn, contribute, and use freely.
1920

2021
## Table of content
2122

2223
<!-- TOC -->
24+
2325
* [What You Can Learn](#what-you-can-learn)
2426
* [Videos](#videos)
2527
* [Prerequisites](#prerequisites)
@@ -31,6 +33,7 @@ This project focuses on developing useful tools for the Revit community, with op
3133
* [License](#license)
3234
* [Security](#security)
3335
* [Acknowledgments](#acknowledgments)
36+
3437
<!-- TOC -->
3538

3639
## What You Can Learn
@@ -80,7 +83,8 @@ After installation, clone this repository to your local machine and navigate to
8083

8184
## Cloning the Repository
8285

83-
This project uses **Git Submodule** to manage dependencies. The following libraries are included as submodules from their own repositories:
86+
This project uses **Git Submodule** to manage dependencies. The following libraries are included as submodules from
87+
their own repositories:
8488

8589
- **Revit.Async** - Async utilities for Revit API
8690
- **Sonny.EasyRibbon** - Attribute-based framework for creating Revit Ribbon UI
@@ -117,25 +121,29 @@ git push origin master
117121
This project includes the following submodules:
118122

119123
#### Revit.Async
124+
120125
- **Submodule location**: `source/Revit.Async`
121126
- **Submodule repository**: [Revit.Async](https://github.com/PhanCongVuDuc/Revit.Async)
122127
- The submodule tracks a specific commit from the Revit.Async repository
123128
- Changes to Revit.Async should be committed in its own repository, not in Sonny
124129

125130
#### Sonny.EasyRibbon
131+
126132
- **Submodule location**: `source/Sonny.EasyRibbon`
127133
- **Submodule repository**: [Sonny.EasyRibbon](https://github.com/PhanCongVuDuc/Sonny.EasyRibbon)
128134
- The submodule tracks a specific commit from the Sonny.EasyRibbon repository
129135
- Changes to Sonny.EasyRibbon should be committed in its own repository, not in Sonny
130136

131137
#### Sonny.RevitExtensions
138+
132139
- **Submodule location**: `source/Sonny.RevitExtensions`
133140
- **Submodule repository**: [Sonny.RevitExtensions](https://github.com/PhanCongVuDuc/Sonny.RevitExtensions)
134141
- The submodule tracks a specific commit from the Sonny.RevitExtensions repository
135142
- Changes to Sonny.RevitExtensions should be committed in its own repository, not in Sonny
136143

137144
> [!NOTE]
138-
> If you see empty submodule folders after cloning, you need to initialize submodules using `git submodule update --init --recursive`
145+
> If you see empty submodule folders after cloning, you need to initialize submodules using
146+
`git submodule update --init --recursive`
139147

140148
## Solution Structure
141149

@@ -160,11 +168,14 @@ For detailed documentation, see [RevitTemplates Wiki](https://github.com/Nice3po
160168

161169
This project uses the following libraries and tools:
162170

163-
- **[RevitTemplates](https://github.com/Nice3point/RevitTemplates)** - Project templates and build system for Revit plugins
171+
- **[RevitTemplates](https://github.com/Nice3point/RevitTemplates)** - Project templates and build system for Revit
172+
plugins
164173
- **[Revit.Async](https://github.com/PhanCongVuDuc/Revit.Async)** - Async utilities for Revit API
165174
- **[RevitTest](https://github.com/ricaun-io/RevitTest)** - Testing framework for Revit applications
166-
- **[Sonny.EasyRibbon](https://github.com/PhanCongVuDuc/Sonny.EasyRibbon)** - Attribute-based framework for creating Revit Ribbon UI
167-
- **[Sonny.RevitExtensions](https://github.com/PhanCongVuDuc/Sonny.RevitExtensions)** - Revit API extension methods and utilities library
175+
- **[Sonny.EasyRibbon](https://github.com/PhanCongVuDuc/Sonny.EasyRibbon)** - Attribute-based framework for creating
176+
Revit Ribbon UI
177+
- **[Sonny.RevitExtensions](https://github.com/PhanCongVuDuc/Sonny.RevitExtensions)** - Revit API extension methods and
178+
utilities library
168179

169180
## Contributing
170181

@@ -183,12 +194,16 @@ This project is licensed under the MIT License - see the [LICENSE](LICENSE) file
183194

184195
## Security
185196

186-
If you discover a security vulnerability, please see our [Security Policy](SECURITY.md) for information on how to report it.
197+
If you discover a security vulnerability, please see our [Security Policy](SECURITY.md) for information on how to report
198+
it.
187199

188200
## Acknowledgments
189201

190202
We would like to express our gratitude to the creators of the following open-source libraries:
191203

192-
- **[RevitTemplates](https://github.com/Nice3point/RevitTemplates)** by [Nice3point](https://github.com/Nice3point) - Project templates and build system for Revit plugins
193-
- **[Revit.Async](https://github.com/PhanCongVuDuc/Revit.Async)** by [KennanChan](https://github.com/KennanChan) - Async utilities for Revit API
194-
- **[RevitTest](https://github.com/ricaun-io/RevitTest)** by [ricaun-io](https://github.com/ricaun-io) - Testing framework for Revit applications
204+
- **[RevitTemplates](https://github.com/Nice3point/RevitTemplates)** by [Nice3point](https://github.com/Nice3point) -
205+
Project templates and build system for Revit plugins
206+
- **[Revit.Async](https://github.com/PhanCongVuDuc/Revit.Async)** by [KennanChan](https://github.com/KennanChan) - Async
207+
utilities for Revit API
208+
- **[RevitTest](https://github.com/ricaun-io/RevitTest)** by [ricaun-io](https://github.com/ricaun-io) - Testing
209+
framework for Revit applications

SECURITY.md

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -6,9 +6,11 @@ Only the latest version receives security patches.
66

77
## Reporting a Vulnerability
88

9-
Please report security vulnerabilities by creating a [GitHub Issue](https://github.com/PhanCongVuDuc/Sonny/issues/new) with the `security` label. **Do NOT create a public issue** - use private communication instead.
9+
Please report security vulnerabilities by creating a [GitHub Issue](https://github.com/PhanCongVuDuc/Sonny/issues/new)
10+
with the `security` label. **Do NOT create a public issue** - use private communication instead.
1011

1112
Include:
13+
1214
- Type of issue
1315
- Affected source code location
1416
- Steps to reproduce

0 commit comments

Comments
 (0)