Skip to content

Commit d1af780

Browse files
author
Benjamin Cance
committed
Update contributing
1 parent f406326 commit d1af780

File tree

1 file changed

+108
-9
lines changed

1 file changed

+108
-9
lines changed

CONTRIBUTING.MD

Lines changed: 108 additions & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -1,8 +1,6 @@
11
# Contributing to AnalyzeMFT
22

3-
We welcome all contributions to AnalyzeMFT and appreciate your effort in helping improve this project!
4-
5-
Please take a moment to read through the following guidelines before opening an issue, pull request (PR), or making any contributions.
3+
We welcome all contributions to AnalyzeMFT and appreciate your effort in helping improve this project! Please take a moment to read through the following guidelines before opening an issue, pull request (PR), or making any contributions.
64

75
## Code of Conduct
86

@@ -13,31 +11,132 @@ Please take a moment to read through the following guidelines before opening an
1311
To maintain a clean and manageable project history:
1412
- Each commit should represent **ONE** discrete change. Avoid bundling multiple changes into a single commit.
1513
- PRs will be **squashed** if necessary, but we strongly prefer a clear change-by-change commit history. This is essential for effective debugging and maintaining code quality.
16-
14+
1715
## How to Contribute
1816

1917
### Reporting Bugs
18+
2019
- **Create an issue** for any bug you encounter. Make sure to describe the issue clearly and include any necessary information (e.g., error messages, logs, steps to reproduce).
2120
- Feel free to contribute a fix after reporting!
2221

2322
### Proposing New Features
24-
- **Open an issue** to discuss your proposed feature before opening a PR. It’s important to make sure it aligns with the project goals.
23+
24+
- **Open an issue** to discuss your proposed feature before opening a PR. It's important to make sure it aligns with the project goals.
2525

2626
### Making Changes
27+
2728
1. **Fork the repository** and create your branch from `main`.
2829
2. **Make your changes**, ensuring that they address one issue at a time.
2930
3. **Test your changes** thoroughly.
3031
4. **Submit a pull request**, referencing the related issue if applicable.
3132

3233
### Commit Messages
34+
3335
- Use concise and descriptive commit messages that explain the context of your change.
3436
- Reference the issue number (if applicable) in your commit message.
3537

38+
Example:
39+
```
40+
Fix parsing of reparse point attribute (#123)
41+
42+
Add error handling for incomplete reparse point data
43+
Update documentation for reparse point parsing
44+
```
45+
3646
## Code Style
3747

38-
- Ensure your code follows the coding style used in the project.
39-
- Code quality is a priority, so be sure to run any existing linting or formatting checks before submitting your PR.
48+
We follow a specific code style to maintain consistency throughout the project. Please adhere to the following guidelines:
49+
50+
### Python Code Style
51+
52+
1. Use 4 spaces for indentation (no tabs).
53+
2. Follow PEP 8 guidelines for naming conventions and code layout.
54+
3. Use type hints for function parameters and return values.
55+
4. Keep lines to a maximum of 100 characters.
56+
5. Use descriptive variable names.
57+
58+
Example:
59+
60+
```
61+
from typing import List, Dict
62+
63+
def parse_mft_record(raw_record: bytes) -> Dict[str, Any]:
64+
record = {}
65+
return record
66+
67+
68+
class MftAnalyzer:
69+
def __init__(self, mft_file: str, output_file: str):
70+
self.mft_file = mft_file
71+
self.output_file = output_file
72+
73+
async def analyze(self) -> None:
74+
pass
75+
```
76+
77+
### Comments
78+
79+
- Though not implemented yet, future updates will include docstrings for modules, classes, and functions.
80+
- Keep inline comments to a minimum unless necessary for complex logic or non-obvious code.
81+
- Keep comments up-to-date with code changes.
82+
83+
Example - Future comment style:
84+
85+
```
86+
def parse_attribute(offset: int, raw_data: bytes) -> Dict[str, Any]:
87+
"""
88+
Parse an MFT attribute at the given offset.
89+
90+
Args:
91+
offset (int): The starting offset of the attribute.
92+
raw_data (bytes): The raw MFT record data.
93+
94+
Returns:
95+
Dict[str, Any]: A dictionary containing the parsed attribute information.
96+
"""
97+
```
98+
99+
### SQL - work in progress
100+
101+
We're working on bringing an SQL engine into this program because (IMO) it's the better way to sort and analyze massive datasets. With that in mind, I'd like to lay out a few SQL specific items:
102+
103+
SQL keywords need to be uppercase.
104+
SQL data columns should be lowercase and use `_` to separate words.
105+
106+
```
107+
CREATE TABLE mft_record (
108+
id INTEGER PRIMARY KEY,
109+
record_number INTEGER NOT NULL,
110+
parent_record_number INTEGER
111+
)
112+
```
113+
114+
### Pull Requests
115+
116+
After undering the joy of learning why branches have locks and the issues with trusting people to test fully, we're going to revamp the PR process.
117+
118+
1. Instituted branch safety on the main branch
119+
2. Built out a test suite (if anyone knows how to make this work on GH, lmk)
120+
121+
PRs will now be required to fit this format:
122+
123+
```
124+
## Description
125+
This PR adds support for parsing reparse point attributes in MFT records. It includes:
126+
- New function `parse_reparse_point` in `mft_record.py`
127+
- Updated `MftRecord` class to handle reparse point attributes
128+
- New tests for reparse point parsing in `test_mft_record.py`
129+
- Updated documentation in README.md
130+
131+
Fixes #123
132+
133+
## Checklist
134+
- [x] Code follows the project's style guidelines
135+
- [x] Tests have been added/updated
136+
- [x] Documentation has been updated
137+
- [x] All tests pass locally
138+
```
40139

41-
## Thank You
140+
# Thank You
141+
#### Your contribution is greatly appreciated, and we look forward to reviewing your work!
42142

43-
Your contribution is greatly appreciated, and we look forward to reviewing your work!

0 commit comments

Comments
 (0)