Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Sanitise input data #200

Merged
merged 48 commits into from
Aug 21, 2023
Merged
Changes from 1 commit
Commits
Show all changes
48 commits
Select commit Hold shift + click to select a range
bed9892
Remove create_output_folder() function
alexdewar Aug 7, 2023
50505e1
Use std::filesystem::path cf. std::string in a few places
alexdewar Aug 8, 2023
2700324
Drop support for v1 config files
alexdewar Aug 8, 2023
358c762
load_configuration(): Remove some indentation
alexdewar Aug 8, 2023
a2fd569
Make separate function for rebasing paths
alexdewar Aug 8, 2023
c66c0b8
Put new functions for loading JSON into configuration.cpp
alexdewar Aug 8, 2023
d9a8ab8
Add ConfigurationError class and use in a few places
alexdewar Aug 8, 2023
100ffd7
Remove unused field
alexdewar Aug 8, 2023
d1cc571
Clean up and add extra error checking to config file loading
alexdewar Aug 8, 2023
f480522
Remove superfluous helper functions
alexdewar Aug 9, 2023
2597d32
Fix: Seemingly MSVC isn't happy about casting filesystem::paths to st…
alexdewar Aug 9, 2023
9a1188c
Move some functions out of configuration.cpp to program.cpp
alexdewar Aug 9, 2023
3efc2be
Put functionality related to command-line args in own cpp file
alexdewar Aug 9, 2023
0d1f803
Move some parsing functions into configuration_parsing.cpp
alexdewar Aug 9, 2023
3d72290
Put configuration parsing helper function defs into own header
alexdewar Aug 9, 2023
edc505d
Rename some functions and mark noexcept
alexdewar Aug 9, 2023
04eab1e
Remove unused API version functionality
alexdewar Aug 9, 2023
a7ee4b5
Move version.h.in to src/HealthGPS
alexdewar Aug 9, 2023
7ff7cc1
Build most console functionality as lib for testability
alexdewar Aug 9, 2023
c6306a1
Spelling
alexdewar Aug 11, 2023
3934a7f
Add JSON (de)serialisation code for Interval<> class
alexdewar Aug 11, 2023
3111772
Make SettingsInfo.age_range an IntegerInterval
alexdewar Aug 11, 2023
35b93a2
Base OptionalRange on Interval class and rename
alexdewar Aug 11, 2023
9557033
Add tests for some config code
alexdewar Aug 11, 2023
efd97bf
Merge remote-tracking branch 'origin/main' into sanitise_input_data
alexdewar Aug 11, 2023
9f5eaec
Fix typo
alexdewar Aug 14, 2023
6180f36
Allow for parsing JSON objects to any map type with Identifier as key
alexdewar Aug 14, 2023
babf513
Use default comparators cf. custom operator==
alexdewar Aug 14, 2023
f5f55f4
Add test for load_interventions
alexdewar Aug 14, 2023
3191348
Make active intervention into an optional type
alexdewar Aug 14, 2023
4c9ee02
Add final tests for config code
alexdewar Aug 15, 2023
5625e26
MSVC resources file should live in HealthGPS.Console/
alexdewar Aug 15, 2023
d4f531e
Remove unused var
alexdewar Aug 15, 2023
d5c2aa7
Use different get_to overload in a couple of places
alexdewar Aug 15, 2023
d19cdd8
Explicitly convert to string to appease MSVC
alexdewar Aug 15, 2023
c1b6636
Fix: Appease g++ v11 by not using structured bindings
alexdewar Aug 15, 2023
9d9801d
Fix narrowing warning on MSVC
alexdewar Aug 15, 2023
7deec87
Fix: Interval class's members should be default-initialised
alexdewar Aug 16, 2023
aafadfb
Fix/suppress bugprone-exception-escape clang-tidy warning
alexdewar Aug 16, 2023
6f19143
Fix: Use absolute cf. weakly canonical paths in rebase_valid_path()
alexdewar Aug 16, 2023
cbd23d7
Fix docstring warnings and rename a couple of args
alexdewar Aug 16, 2023
a592a1b
Add docstrings to poco.h
alexdewar Aug 16, 2023
26f1b31
Remove unused function definition
alexdewar Aug 16, 2023
6438589
Add file-level documentation for several headers
alexdewar Aug 16, 2023
0157f76
range parameter doesn't need a default value
alexdewar Aug 17, 2023
c9e3b2d
Revert "range parameter doesn't need a default value"
jamesturner246 Aug 18, 2023
72d6519
Remove special-casing for std::optional<Interval<T>>
alexdewar Aug 21, 2023
00fc19f
Merge branch 'main' into sanitise_input_data
alexdewar Aug 21, 2023
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Prev Previous commit
Next Next commit
Remove unused function definition
alexdewar committed Aug 16, 2023
commit 26f1b3122e9f8b99181e89029cd82033919b314b
8 changes: 0 additions & 8 deletions src/HealthGPS.Console/configuration_parsing_helpers.h
Copy link
Contributor

@jamesturner246 jamesturner246 Aug 16, 2023

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Looks like this header is more for risk factor model JSON parsing stuff, right? Was the plan to have a separate header for the parsing interfaces of each model type? Maybe renaming this something like configuration_parsing_risk_factor.h would clarify this?

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Good idea. The reason I put these bits into their own header was really just because it felt like configuration_parsing.h was getting a bit cluttered and these functions only needed to be exported so we could access them for the tests.

Original file line number Diff line number Diff line change
@@ -84,14 +84,6 @@ void rebase_valid_path_to(const nlohmann::json &j, const std::string &key,
/// @throw ConfigurationError: Invalid config file format
poco::FileInfo get_file_info(const nlohmann::json &node, const std::filesystem::path &base_dir);

/// @brief Read FoodsDataFile attribute from JSON
/// @param j Input JSON
/// @param base_dir Base folder
/// @return FileInfo
/// @throw ConfigurationError: Invalid config file format
poco::FileInfo get_foods_data_file_info(const nlohmann::json &j,
const std::filesystem::path &base_dir);

/// @brief Load settings section of JSON
/// @param j Input JSON
/// @return SettingsInfo