+251 -5 +/-5 browse
1 | diff --git a/CODE_OF_CONDUCT.md b/CODE_OF_CONDUCT.md |
2 | new file mode 100644 |
3 | index 0000000..88e89a1 |
4 | --- /dev/null |
5 | +++ b/CODE_OF_CONDUCT.md |
6 | @@ -0,0 +1,128 @@ |
7 | + # Contributor Covenant Code of Conduct |
8 | + |
9 | + ## Our Pledge |
10 | + |
11 | + We as members, contributors, and leaders pledge to make participation in our |
12 | + community a harassment-free experience for everyone, regardless of age, body |
13 | + size, visible or invisible disability, ethnicity, sex characteristics, gender |
14 | + identity and expression, level of experience, education, socio-economic status, |
15 | + nationality, personal appearance, race, religion, or sexual identity |
16 | + and orientation. |
17 | + |
18 | + We pledge to act and interact in ways that contribute to an open, welcoming, |
19 | + diverse, inclusive, and healthy community. |
20 | + |
21 | + ## Our Standards |
22 | + |
23 | + Examples of behavior that contributes to a positive environment for our |
24 | + community include: |
25 | + |
26 | + * Demonstrating empathy and kindness toward other people |
27 | + * Being respectful of differing opinions, viewpoints, and experiences |
28 | + * Giving and gracefully accepting constructive feedback |
29 | + * Accepting responsibility and apologizing to those affected by our mistakes, |
30 | + and learning from the experience |
31 | + * Focusing on what is best not just for us as individuals, but for the |
32 | + overall community |
33 | + |
34 | + Examples of unacceptable behavior include: |
35 | + |
36 | + * The use of sexualized language or imagery, and sexual attention or |
37 | + advances of any kind |
38 | + * Trolling, insulting or derogatory comments, and personal or political attacks |
39 | + * Public or private harassment |
40 | + * Publishing others' private information, such as a physical or email |
41 | + address, without their explicit permission |
42 | + * Other conduct which could reasonably be considered inappropriate in a |
43 | + professional setting |
44 | + |
45 | + ## Enforcement Responsibilities |
46 | + |
47 | + Community leaders are responsible for clarifying and enforcing our standards of |
48 | + acceptable behavior and will take appropriate and fair corrective action in |
49 | + response to any behavior that they deem inappropriate, threatening, offensive, |
50 | + or harmful. |
51 | + |
52 | + Community leaders have the right and responsibility to remove, edit, or reject |
53 | + comments, commits, code, wiki edits, issues, and other contributions that are |
54 | + not aligned to this Code of Conduct, and will communicate reasons for moderation |
55 | + decisions when appropriate. |
56 | + |
57 | + ## Scope |
58 | + |
59 | + This Code of Conduct applies within all community spaces, and also applies when |
60 | + an individual is officially representing the community in public spaces. |
61 | + Examples of representing our community include using an official e-mail address, |
62 | + posting via an official social media account, or acting as an appointed |
63 | + representative at an online or offline event. |
64 | + |
65 | + ## Enforcement |
66 | + |
67 | + Instances of abusive, harassing, or otherwise unacceptable behavior may be |
68 | + reported to the community leaders responsible for enforcement at |
69 | + manos@pitsidianak.is. |
70 | + All complaints will be reviewed and investigated promptly and fairly. |
71 | + |
72 | + All community leaders are obligated to respect the privacy and security of the |
73 | + reporter of any incident. |
74 | + |
75 | + ## Enforcement Guidelines |
76 | + |
77 | + Community leaders will follow these Community Impact Guidelines in determining |
78 | + the consequences for any action they deem in violation of this Code of Conduct: |
79 | + |
80 | + ### 1. Correction |
81 | + |
82 | + **Community Impact**: Use of inappropriate language or other behavior deemed |
83 | + unprofessional or unwelcome in the community. |
84 | + |
85 | + **Consequence**: A private, written warning from community leaders, providing |
86 | + clarity around the nature of the violation and an explanation of why the |
87 | + behavior was inappropriate. A public apology may be requested. |
88 | + |
89 | + ### 2. Warning |
90 | + |
91 | + **Community Impact**: A violation through a single incident or series |
92 | + of actions. |
93 | + |
94 | + **Consequence**: A warning with consequences for continued behavior. No |
95 | + interaction with the people involved, including unsolicited interaction with |
96 | + those enforcing the Code of Conduct, for a specified period of time. This |
97 | + includes avoiding interactions in community spaces as well as external channels |
98 | + like social media. Violating these terms may lead to a temporary or |
99 | + permanent ban. |
100 | + |
101 | + ### 3. Temporary Ban |
102 | + |
103 | + **Community Impact**: A serious violation of community standards, including |
104 | + sustained inappropriate behavior. |
105 | + |
106 | + **Consequence**: A temporary ban from any sort of interaction or public |
107 | + communication with the community for a specified period of time. No public or |
108 | + private interaction with the people involved, including unsolicited interaction |
109 | + with those enforcing the Code of Conduct, is allowed during this period. |
110 | + Violating these terms may lead to a permanent ban. |
111 | + |
112 | + ### 4. Permanent Ban |
113 | + |
114 | + **Community Impact**: Demonstrating a pattern of violation of community |
115 | + standards, including sustained inappropriate behavior, harassment of an |
116 | + individual, or aggression toward or disparagement of classes of individuals. |
117 | + |
118 | + **Consequence**: A permanent ban from any sort of public interaction within |
119 | + the community. |
120 | + |
121 | + ## Attribution |
122 | + |
123 | + This Code of Conduct is adapted from the [Contributor Covenant][homepage], |
124 | + version 2.0, available at |
125 | + https://www.contributor-covenant.org/version/2/0/code_of_conduct.html. |
126 | + |
127 | + Community Impact Guidelines were inspired by [Mozilla's code of conduct |
128 | + enforcement ladder](https://github.com/mozilla/diversity). |
129 | + |
130 | + [homepage]: https://www.contributor-covenant.org |
131 | + |
132 | + For answers to common questions about this code of conduct, see the FAQ at |
133 | + https://www.contributor-covenant.org/faq. Translations are available at |
134 | + https://www.contributor-covenant.org/translations. |
135 | diff --git a/CONTRIBUTING.md b/CONTRIBUTING.md |
136 | new file mode 100644 |
137 | index 0000000..3bb6970 |
138 | --- /dev/null |
139 | +++ b/CONTRIBUTING.md |
140 | @@ -0,0 +1,102 @@ |
141 | + # Contributing to mailpot |
142 | + |
143 | + Contributions are welcome and encouraged. |
144 | + They can be anything from spelling corrections, art, documentation, or source code fixes & additions. |
145 | + If a source code contribution is correct, functional and follows the code style and feature goals of the rest of the project, it will be merged. |
146 | + |
147 | + **Table of contents**: |
148 | + |
149 | + - [Important links](#important-links) |
150 | + - [Developing environment](#developing-environment) |
151 | + - [Testing](#testing) |
152 | + - [How to submit changes](#how-to-submit-changes) |
153 | + - [Choosing what to work on](#choosing-what-to-work-on) |
154 | + - [How to request an enhancement, new features](#how-to-request-an-enhancement-new-features) |
155 | + - [Style Guide / Coding conventions](#style-guide--coding-conventions) |
156 | + - [Specific questions and answers](#specific-questions-and-answers) |
157 | + - [How do I include new images / icons?](#how-do-i-include-new-images--icons) |
158 | + |
159 | + ## Important links |
160 | + |
161 | + - Main repository: <https://git.meli.delivery/meli/mailpot> |
162 | + - Bug/Issue tracker: <https://git.meli.delivery/meli/mailpot/issues> |
163 | + - Mailing list: <https://lists.meli.delivery/list/mailpot-general/> |
164 | + |
165 | + To privately contact the repository's owner, check their commit history for their e-mail address. |
166 | + |
167 | + <sup><sub><a href="#contributing-to-mailpot">back to top</a></sub></sup> |
168 | + |
169 | + ## Developing environment |
170 | + |
171 | + You will need a UNIX-like operating system that is supported by Rust. |
172 | + You can install rust and cargo with the [`rustup`](https://rustup.rs) tool. |
173 | + |
174 | + <sup><sub><a href="#contributing-to-mailpot">back to top</a></sub></sup> |
175 | + |
176 | + ## Testing |
177 | + |
178 | + All tests can be executed with `cargo`. |
179 | + Run |
180 | + |
181 | + ```shell |
182 | + cargo test --all --no-fail-fast --all-features |
183 | + ``` |
184 | + |
185 | + to run all tests. |
186 | + |
187 | + <sup><sub><a href="#contributing-to-mailpot">back to top</a></sub></sup> |
188 | + |
189 | + ## How to submit changes |
190 | + |
191 | + Use gitea's PR functionality. |
192 | + Alternatively, submit patches to the mailing list. |
193 | + |
194 | + <sup><sub><a href="#contributing-to-mailpot">back to top</a></sub></sup> |
195 | + |
196 | + ## Choosing what to work on |
197 | + |
198 | + You can find some tasks in the bug tracker. |
199 | + Additionally, tasks are annotated inside the source code with the keywords `FIXME`, `TODO` and others. |
200 | + For a list of all tags search for `[tag:`. |
201 | + For a list of all references search for `[ref:`. |
202 | + To find tag references you can use a text search tool of your choice such as `grep`, `ripgrep` or others. |
203 | + The CLI tool `tagref` can also be used: |
204 | + |
205 | + ```shell |
206 | + /path/to/mailpot $ tagref list-refs |
207 | + [ref:FIXME] @ ./src/module.rs:106 |
208 | + [ref:FIXME] @ ./src/module.rs:867 |
209 | + [ref:FIXME] @ ./src/module.rs:30 |
210 | + [ref:TODO] @ ./src/where.rs:411 |
211 | + ... |
212 | + ``` |
213 | + |
214 | + You can of course filter or sort them by tag: |
215 | + |
216 | + ```shell |
217 | + /path/to/mailpot $ tagref list-refs | grep TODO |
218 | + ... |
219 | + /path/to/mailpot $ tagref list-refs | sort -u |
220 | + ... |
221 | + ``` |
222 | + |
223 | + <sup><sub><a href="#contributing-to-mailpot">back to top</a></sub></sup> |
224 | + |
225 | + ## How to request an enhancement, new features |
226 | + |
227 | + Simply open a new issue on the bug tracker or post on the mailing list. |
228 | + |
229 | + <sup><sub><a href="#contributing-to-mailpot">back to top</a></sub></sup> |
230 | + |
231 | + ## Style Guide / Coding conventions |
232 | + |
233 | + All Rust code must be formatted by `rustfmt`, and pass clippy lints. |
234 | + |
235 | + ```shell |
236 | + cargo check --all-features --all --tests --examples --benches --bins |
237 | + cargo +nightly fmt --all || cargo fmt --all |
238 | + cargo clippy --no-deps --all-features --all --tests --examples --benches --bins |
239 | + djhtml -i web/src/templates/* || printf "djhtml binary not found in PATH.\n" |
240 | + ``` |
241 | + |
242 | + <sup><sub><a href="#contributing-to-mailpot">back to top</a></sub></sup> |
243 | diff --git a/Makefile b/Makefile |
244 | index 7705d30..729c13a 100644 |
245 | --- a/Makefile |
246 | +++ b/Makefile |
247 | @@ -1,6 +1,6 @@ |
248 | .PHONY: check |
249 | check: |
250 | - cargo check --all |
251 | + cargo check --all-features --all --tests --examples --benches --bins |
252 | |
253 | .PHONY: fmt |
254 | fmt: |
255 | @@ -10,4 +10,9 @@ fmt: |
256 | |
257 | .PHONY: lint |
258 | lint: |
259 | - cargo clippy --all |
260 | + cargo clippy --no-deps --all-features --all --tests --examples --benches --bins |
261 | + |
262 | + |
263 | + .PHONY: test |
264 | + test: check lint |
265 | + cargo test --all --no-fail-fast --all-features |
266 | diff --git a/cli/tests/basic_interfaces.rs b/cli/tests/basic_interfaces.rs |
267 | index da6950b..2550788 100644 |
268 | --- a/cli/tests/basic_interfaces.rs |
269 | +++ b/cli/tests/basic_interfaces.rs |
270 | @@ -23,15 +23,13 @@ |
271 | |
272 | use std::path::Path; |
273 | |
274 | - use assert_cmd::assert::OutputAssertExt; |
275 | + use assert_cmd::{assert::OutputAssertExt, Command}; |
276 | use mailpot::{models::*, Configuration, Connection, SendMail}; |
277 | use predicates::prelude::*; |
278 | use tempfile::TempDir; |
279 | |
280 | #[test] |
281 | fn test_cli_basic_interfaces() { |
282 | - use assert_cmd::Command; |
283 | - |
284 | fn no_args() { |
285 | let mut cmd = Command::cargo_bin("mpot").unwrap(); |
286 | // 2 -> incorrect usage |
287 | diff --git a/core/src/lib.rs b/core/src/lib.rs |
288 | index 1704daf..f93e2bb 100644 |
289 | --- a/core/src/lib.rs |
290 | +++ b/core/src/lib.rs |
291 | @@ -124,6 +124,19 @@ |
292 | //! # do_test(config); |
293 | //! ``` |
294 | |
295 | + /* Annotations: |
296 | + * |
297 | + * Global tags (in tagref format <https://github.com/stepchowfun/tagref>) for source code |
298 | + * annotation: |
299 | + * |
300 | + * - [tag:needs_unit_test] |
301 | + * - [tag:needs_user_doc] |
302 | + * - [tag:needs_dev_doc] |
303 | + * - [tag:FIXME] |
304 | + * - [tag:TODO] |
305 | + * - [tag:VERIFY] Verify whether this is the correct way to do something |
306 | + */ |
307 | + |
308 | #[macro_use] |
309 | extern crate error_chain; |
310 | extern crate anyhow; |