summaryrefslogtreecommitdiffstats
path: root/jrnl
AgeCommit message (Collapse)Author
12 daysFix -contains to allow multiple terms with "OR" logic unless -and is added ↵Ricardo Ruiz
(#1890) * Store multiple -contains arguments (OR default). Allow multiple occurrences of the -contains argument to be stored in a list. Previously, only the last occurrence was considered. Additionally, the behavior has been modified to default to OR logic, meaning that if multiple -contains arguments are provided, entries matching any of them will be included in the results. * Solved issue #1877 "-and" flag with multiple instances of the -contains option. * Run poe format * Fix unit test for contains to allow list instead of single value * Add BDD tests for multiple contains with and without -and * Black version updated. * Revert pyproject.toml to appease poetry --------- Co-authored-by: Micah Jerome Ellison <micah.jerome.ellison@gmail.com>
2024-02-01Update dependency black to v24 (#1849)renovate[bot]
* Update dependency black to v24 * update file to match new formatting from black --------- Co-authored-by: renovate[bot] <29139614+renovate[bot]@users.noreply.github.com> Co-authored-by: Jonathan Wren <jonathan@nowandwren.com>
2023-11-04Increment version to v4.1v4.1Jrnl Bot
2023-10-31Increment version to v4.1-beta2v4.1-beta2Jrnl Bot
2023-10-30Force rich to use color codes when pretty printing (#1821)Micah Jerome Ellison
2023-10-29Increment version to v4.1-betav4.1-betaJrnl Bot
2023-10-29Resolve parsedatetime "flag style" DeprecationWarning (#1818)Micah Jerome Ellison
* Stop ignoring parsedatetime warning flag style warning * Use new VERSION_CONTEXT_STYLE to bypass parsedatetime flag style warning * Replace "flag" and its magic numbers with contextual booleans
2023-09-09Update dependency ruff to v0.0.287 (#1778)renovate[bot]
* Update dependency ruff to v0.0.287 * add ruff target version to tailor linting to our required python versions * fix linting issues --------- Co-authored-by: renovate[bot] <29139614+renovate[bot]@users.noreply.github.com> Co-authored-by: Jonathan Wren <jonathan@nowandwren.com>
2023-07-29Use rich instead of ansiwrap to wrap text (#1693)Micah Jerome Ellison
2023-07-15Replace flake8 and isort with ruff linter and add `black --check` to linting ↵Micah Jerome Ellison
step (#1763) * Add ruff * Add ruff config * Add ruff rules that look useful and are already passing * Add more ruff rules after talking with Jonathan * Add line length exception for acceptably long indented line * Resolve ruff line length 88 rule in args. Changing small lines but adding a noqa ignore directive to longer lines that look best as they are. Their dedented length is still less than 88 * poe format * Resolve all remaining ruff line length errors * Replace flake* and isort with ruff calls * Add black --check as final lint step. ruff catches most but not all black formatting issues * Remove unneeded flakeheaven setting * Remove flake* and isort now that ruff is handling all their business * Update pyproject, lockfile with latest version of ruff * Document each ruff rule with comment * Add black --version call before black --check * Remove extraneous period
2023-06-20Increment version to v4.0.1v4.0.1Jrnl Bot
2023-05-20Increment version to v4.0.1-betav4.0.1-betaJrnl Bot
2023-05-20Refactor --template code (#1711)Micah Jerome Ellison
* Move path concerns to path.py and template concerns to editor.py -- BDD tests are failing * Move path-related constants from config.py to path.py * Mock get_templates_path in its new calling file * Mediate template arg vs. config in controller then read template text in editor and unify those two use cases. Some tests still failing * Fix test whose message had changed * poe format * Refactor for easier unit testing and add unit tests * Use path strings instead of Path objects in return values to prevent side effects that caused unit tests to fail on some platforms * poe format * Attempt to bypass getcwd errors in CI with patch * Consistently use strings for paths instead of some strings and some pathlib.Path * Keep pathlib within a function for readability * fix for ruamel.yaml versions >=0.17.22 * Run poe format --------- Co-authored-by: Jonathan Wren <jonathan@nowandwren.com>
2023-05-20fix some linting issues for failing PR (#1745)Jonathan Wren
2023-05-20Increment version to v4.0v4.0Jrnl Bot
2023-04-29Increment version to v4.0-beta3v4.0-beta3Jrnl Bot
2023-04-29Only read text files that look like entries when opening folder journal (#1697)Micah Jerome Ellison
* Add text file that should be ignored to basic test folder journal. Makes tons of tests fail * Add additional files that should be ignored by FolderJournal * Ignore all files in folder journal except year/month/day.txt * Completely remake get_files in FolderJournal: - move get_files into FolderJournal class and add underscore prefix - create iterables to get for year/month folders and day files - make year/month/day file reading strict: only exact expected months and days out of all possible months and days * Restore accidentally-deleted self.sort() line * Use match instead of string comparison to be os-agnostic * Explicitly declare static methods * Filter with glob first for max performance * Explicitly check for valid dates in FolderJournal and add unit test * Remove unneeded jrnl import * Clean up method comment and add type hints * Add is_valid_date unit test * Elucidate comment Co-authored-by: Jonathan Wren <jonathan@nowandwren.com>
2023-04-22Increment version to v4.0-beta2v4.0-beta2Jrnl Bot
2023-04-22fix typo (#1718)Zhizhen He
2023-03-25Increment version to v4.0-betav4.0-betaJrnl Bot
2023-03-25Allow combinations of `--change-time`, `--delete`, and `--edit` while ↵Jonathan Wren
correctly counting the number of entries affected (#1669) * Remove search mode conditional that added explicit tag search behavior * Fix failing change-time test by using same method signature as base journal class * Fix user input mock - was not appropriately checking return value * Clean up controller - streamline `run` function in `controller.py` - add debug logging - fix unnecessary import of Journal class (only needed for typing) - standardize summary display across different actions * Add currently-failing test conditions for count messages when changing time and deleting * Don't show summary if no entries found and prevent extra line break when no entries found by short-circuiting display method * Track found entry count and remove incorrect modified stat logic * Track journal entry deletion consistently * Remove unneeded exception when editor is empty and fix test that was testing incorrect message * Correct entry edit modified count test * Track modification of entries with --change-time * Preserve existing behavior when editor is empty but make the message more clear * Reconcile tests with new error message when clearing editor in edit mode * Add found/modified counts to edit tests * Add tests for found count with -n equivalent argument * Test combinations of found/deleted messages when using --delete * Add tests for counting combinations of action arguments (change-time, edit, delete) and for change-time counts. Some are failing and should be investigated * Remove extraneous comment in test * Track added/deleted counts in a register in the Journal class instead of attempting to infer it via controller counting * Add encrypted to more tests * Fix merge conflict typo * Change 'write mode' -> 'append mode' in more places --------- Co-authored-by: Micah Jerome Ellison <micah.jerome.ellison@gmail.com>
2023-03-25Add ability to use template with `--template` (#1667)Aaron Lichtman
* Add ability to pass template path with --template Update jrnl/args.py * Fix tests
2023-03-04Add message with config location and docs location when installation is ↵Micah Jerome Ellison
complete (#1695)
2023-03-04Use pytest-bdd 6 (#1685)Micah Jerome Ellison
* update pytest-bdd to 6.0 * update lock file * fix first test (inject command fixture to request) * fix some more tests * fix cli_run fixture * fix password fixture * Remove unused import * Fix greedy should_or_should_not parsing problems while also consolidating its parse/transformation-to-bool code * Prevent greedy matching in "we run" by using regular expression lookahead * Add missing "Outline" in scenario outlines with examples * Split "we use the config" and "we use no config" so pytest won't try to consume config_file as a fixture * Fix missing ShouldOrShouldNot * Formatting * fix get_fixture function * change output of failing test to be a little more useful * update lock file * update type builder to for should/should not to be in it's own file, rename some vars for readability * add parse-type new dev/testing dependency * update lock file --------- Co-authored-by: Jonathan Wren <jonathan@nowandwren.com>
2023-02-25Prompt to include colors in config when first running jrnl (#1687)Micah Jerome Ellison
* Add prompt to ask user if entries should be formatted with colors when installing jrnl * Use magenta instead of black for default date color * Use other default colors and alphabetize color list * Update tests * Delete test file * update lock file * fix failing test after merge conflict --------- Co-authored-by: Jonathan Wren <jonathan@nowandwren.com>
2023-02-25Save empty journal on install instead of just creating a zero-length file ↵Micah Jerome Ellison
(#1690) * Add failing test for issue #1493 * Write journal upon creation instead of just creating 0-length file * Fix test to accommodate current password mocking form
2023-02-11Don't save templated journal entries if the received raw text is the same as ↵Briscoooe
the template itself (#1653)
2023-01-28Search for entries with no tags or stars with `-not -starred` and `-not ↵Ciaran Concannon
-tagged` (#1663) * Allow for `-not -starred` to search for unstarred entries * Add `-tagged` and `-not -tagged` functionality
2023-01-14Refactor flow for easier access to some files (avoid things like ↵Jonathan Wren
`jrnl.Journal.Journal` and `jrnl.jrnl` co-existing) (#1662) * run format * rename cli.py to main.py * rename jrnl.py to controller.py * move journal class files into journals dir * rename start -> run in controller.py
2023-01-14Add more type hints (#1642)outa
2023-01-07Update copyright notices for 2023 (#1660)Jonathan Wren
* update copyright notice for 2023 * standardize whitespace after copyright notice
2023-01-07Add tag to XML file when edited DayOne entry and is searchable afterward (#1648)Jonathan van der Steege
* Add tag to XML file when edited DayOne entry * Remove forbidden change * undo edits * Tags working for DayOne journal * Correction doentries to prevent time-error * Add sorting to tags * Delete test statements * Revert time changes
2023-01-07Update version key in config file after version changes (#1646)Jonathan van der Steege
2022-11-19Rework Encryption to enable future support of other encryption methods (#1602)Jonathan Wren
- initial pass through to rework encryption into separate module - little more cleanup - rename function, fix some linting issues - more cleaning - fix password bug in encryption - fix linting issue - more cleanup - move prompt into prompt.py - more cleanup - update the upgrade process for new encryption classes - general cleanup - turn into enum instead of strings - store status code so tests don't fail - standardize the load and store methods in journals - get rid of old PlainJournal class - typing cleanup - more cleanup - format - fix linting issue - Fix obscure Windows line ending issue with decode See https://bugs.python.org/issue40863 - fix for python 3.11 - add more typing - don't use class variables because that's not what we want - fix more type hints - jrnlv1 encryption doesn't support encryption anymore (it's deprecated) - keep logic for password attemps inside the class that uses it - take out old line of code - add some more logging - update logging statements - clean up logging statements - run linters - fix typo - Fix for new test from develop branch There was a new test added for re-encrypting a journal. This updates the refactor to match the old (previously untested) behavior of jrnl. Co-authored-by: Micah Jerome Ellison <micah.jerome.ellison@gmail.com>
2022-11-05Add `simplify` plugin to linting checks (#1630)Jonathan Wren
* add simplify plugin for flakeheaven * update lock file * fix linting issues in current codebase
2022-11-05Add type hints (#1614)outa
* Add type hints * Fix linters * Add remaining type hints * Fix type-checking linter * Update jrnl/DayOneJournal.py Co-authored-by: Jonathan Wren <jonathan@nowandwren.com>
2022-11-03Add `type-checking` plugin to linting checks (#1629)Jonathan Wren
* add type-checking plugin for flakeheaven * update lock file * fix type-checking issues in current codebase * run linters
2022-10-31Add rich handler for better-formatted debug logging (#1627)Jonathan Wren
2022-10-29Increment version to v3.3Jrnl Bot
2022-10-22Increment version to v3.3-beta2v3.3-beta2Jrnl Bot
2022-10-22Fix bug for new `--list --format` options when no default journal is ↵Jonathan Wren
specified (#1621) * rename test config * Change journal name validation Journal name validation used to happen before postconfig commands could have a chance to run, so now each command is responsible for its own error-checking of the journal name. Added a new decorator and function that makes this error-checking easier. Co-authored-by: Micah Jerome Ellison <micah.jerome.ellison@gmail.com> * fix wrapper function call to be more like original * change arg names to show which aren't used * add type hints Co-authored-by: Micah Jerome Ellison <micah.jerome.ellison@gmail.com>
2022-10-08Increment version to v3.3-betav3.3-betaJrnl Bot
2022-10-08Don't create empty file when attempting a YAML export to a non-existing ↵outa
folder (#1600) * Call `export_journal` before opening file handle * Use correct exporter class * Fix unit test
2022-10-08Change default config to use journal key instead of journal name as key for ↵Micah Jerome Ellison
file path (#1594)
2022-09-24Add machine readable --list output (#1592)Kevin
* Add machine readable --list output * Refactor list_journals() Create three new methods for each journal list format. - JSON, YAML, STDOUT * Added journal list export test * Update test regex to handle windows filepaths
2022-09-17Change default timestamp to `%F %r` (#1595)Jonathan Wren
Fixes #1100
2022-09-03Increment version to v3.2v3.2Jrnl Bot
2022-08-27Increment version to v3.2-betav3.2-betaJrnl Bot
2022-08-27Suppress "Entry added" message if using default journal (#1561)Micah Jerome Ellison
* Suppress "Entry added to default journal" message if using default journal * Replace "Entry added" BDD test steps with "we should get no error" now that the message is suppressed * Add positive and negative tests for "Entry added" message behavior
2022-08-27Add message showing the number of search results (#1524)Kevin
* Added message showing the number of search results Modified _search_journal() to return a bool based upon whether any filter args were passed to the program. Added _print_entries_found_count() which prints a message based upon the number of entries found and prints warnings if the user was trying to edit or delete. * Add tests for search results msgs