<commit_before># email2pdf - Hacking

This document talks about hacking/developing on email2pdf - for more
information on email2pdf and how to use it, please see
[README.md](https://github.com/andrewferrier/email2pdf/blob/master/README.md).

In general, [bug reports/enhancement
requests](https://github.com/andrewferrier/email2pdf/issues) as well as [pull
requests](https://github.com/andrewferrier/email2pdf/pulls) are welcome;
please note the [license
conditions](https://github.com/andrewferrier/email2pdf/blob/master/LICENSE.txt).
If you are trying to report an issue, please try running email2pdf with the
`-vv` option to maximise the debugging output first.

## Building & Packaging

All the supplied build and packaging is based on a
[Makefile](https://github.com/andrewferrier/email2pdf/blob/master/Makefile).
You'll need `make` if you don't have it (`sudo apt-get install make` on
Ubuntu/Debian, `brew install make` on OS X).

## Design & Coding Principles

* Follow [PEP-8](https://www.python.org/dev/peps/pep-0008/). Running `make
  analysis` will check against this and run other static code analysis checks
  also.

* Try to keep `email2pdf` as "safe" as possible by default. Without supplying
  any potentially harmful command-line options, `email2pdf` will not ignore
  parts of the email it shouldn't, and will fail in the standard UNIX way with
  an error code if it has any significant doubts about the integrity of the
  email it's reading, or any other serious error occurs.

## Unit Tests

All the unit tests are in the `tests/` directory. You can run them from the
Makefile using the `unittest` or `unittest_test` targets (the second is more
verbose, and stops on failing tests).

All new code should be covered by a test. There is a code coverage checker
target in the Makefile - run `make coverage`. You'll need to have the
`coverage` Python module installed (`pip3 install coverage`) to run it.

In addition to the standard dependencies from the [standard install
documentation](https://github.com/andrewferrier/email2pdf/blob/master/README.md),
there are some additional dependencies which will be needed to make the tests
work:

### OS X

Just run `pip3 install freezegun pdfminer3k reportlab`.<commit_msg>Add flake8 dependency for OS X.<commit_after># email2pdf - Hacking

This document talks about hacking/developing on email2pdf - for more
information on email2pdf and how to use it, please see
[README.md](https://github.com/andrewferrier/email2pdf/blob/master/README.md).

In general, [bug reports/enhancement
requests](https://github.com/andrewferrier/email2pdf/issues) as well as [pull
requests](https://github.com/andrewferrier/email2pdf/pulls) are welcome;
please note the [license
conditions](https://github.com/andrewferrier/email2pdf/blob/master/LICENSE.txt).
If you are trying to report an issue, please try running email2pdf with the
`-vv` option to maximise the debugging output first.

## Building & Packaging

All the supplied build and packaging is based on a
[Makefile](https://github.com/andrewferrier/email2pdf/blob/master/Makefile).
You'll need `make` if you don't have it (`sudo apt-get install make` on
Ubuntu/Debian, `brew install make` on OS X).

## Design & Coding Principles

* Follow [PEP-8](https://www.python.org/dev/peps/pep-0008/). Running `make
  analysis` will check against this and run other static code analysis checks
  also.

* Try to keep `email2pdf` as "safe" as possible by default. Without supplying
  any potentially harmful command-line options, `email2pdf` will not ignore
  parts of the email it shouldn't, and will fail in the standard UNIX way with
  an error code if it has any significant doubts about the integrity of the
  email it's reading, or any other serious error occurs.

## Unit Tests

All the unit tests are in the `tests/` directory. You can run them from the
Makefile using the `unittest` or `unittest_test` targets (the second is more
verbose, and stops on failing tests).

All new code should be covered by a test. There is a code coverage checker
target in the Makefile - run `make coverage`. You'll need to have the
`coverage` Python module installed (`pip3 install coverage`) to run it.

In addition to the standard dependencies from the [standard install
documentation](https://github.com/andrewferrier/email2pdf/blob/master/README.md),
there are some additional dependencies which will be needed to make the tests
work:

### OS X

Just run `pip3 install flake8 freezegun pdfminer3k reportlab`.
{'fraction_non_alphanumeric': 0.08346316492321389, 'fraction_numerical': 0.009347874471399956, 'mean_word_length': 4.603491271820449, 'pattern_counts': {'":': 0, '<': 3, '<?xml version=': 0, '>': 3, 'https://': 14, 'lorem ipsum': 0, 'www.': 2, 'xml': 0}, 'pii_count': 0, 'substrings_counts': 0, 'word_list_counts': {'cursed_substrings.json': 0, 'profanity_word_list.json': 0, 'sexual_word_list.json': 0, 'zh_pornsignals.json': 0}}
{'dir': 'git-commits-cleaned', 'id': '5055616', 'n_tokens_mistral': 1313, 'n_tokens_neox': 1264, 'n_words': 563}