Hacktoberfest 2026: the issues maintainers tagged for October, open and beginner-friendly. Browse Hacktoberfest issues

File_Adapter: refactoring-refactor to match ReplaceInMemory refactoring

Open
#149 0 comments 0 reactions 1 assignee View on GitHub

@alelom is already working on this.

Since Jul 2, 2019.

Assessment

This issue has not been assessed yet.

Description

type:compliance
Description

As explained in https://github.com/BHoM/BHoM_Adapter/issues/106

Since File_Adapter does not set AdapterConfig.ProcessInMemory, that defaults to true.
This means that the call to Create will always have replaceAll set to true.

Therefore the following calls will have replaceAll always set to true:
https://github.com/BHoM/BHoM_Adapter/blob/49d63e82db3eefa5eecb960e1bd84ab410fc2c51/File_Adapter/CRUD/Create.cs#L40-L46

So these lines never get called
https://github.com/BHoM/BHoM_Adapter/blob/49d63e82db3eefa5eecb960e1bd84ab410fc2c51/File_Adapter/CRUD/Create.cs#L80-L81
As well as this is never called with Append:
https://github.com/BHoM/BHoM_Adapter/blob/49d63e82db3eefa5eecb960e1bd84ab410fc2c51/File_Adapter/CRUD/Create.cs#L57

Proposed change

If anything, the option for the Create method to override should be specifiable dynamically, rather than hard-coded.
This might be solved by making the so called config parameter available to all CRUD methods.

I would remove replaceAll as a parameter of the Create() and use another parameter like
config["CreateOverride"] = true.

Dominant language
C#
Stars
0
Forks
7
Avg merge
5d 8h
Merged PRs (30d)
2

Getting set up

First steps

  1. Read the whole issue, then the project's contributing guide.
  2. Comment on the issue to say you are picking it up — it saves two people doing the same work.
  3. Fork the repository and make your change on a branch.
  4. Open a pull request that references the issue number.

More from BHoM/File_Toolkit

All issues in BHoM/File_Toolkit

Similar issues

More C# issues

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.