-
Notifications
You must be signed in to change notification settings - Fork 39
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
Refactor active configuration handling #158
Labels
good first issue
Easy-to-start-with issue with no in-depth knowledge or complex implementation required.
refactor
Implementation refactor
Comments
haxscramper
added
good first issue
Easy-to-start-with issue with no in-depth knowledge or complex implementation required.
refactor
Implementation refactor
labels
Jan 16, 2022
haxscramper
added a commit
to haxscramper/nimskull
that referenced
this issue
Jan 28, 2022
- Move active configuration handing into a separate type that should contain all the required configuration parameters. Use this type in `ConfigRef` module, and use accessor procs for getting and setting values of different options, thus removing unguarded access for fields in a number of cases. - Move report kind and category enums into `report_enums` in order to make them accessible from the `in_options` - it must be a lightweight dependency since it is supposed to be reused by other tools, like testament, that have to directly interact with the compiler. Closes nim-works#158
haxscramper
added a commit
to haxscramper/nimskull
that referenced
this issue
Jan 28, 2022
- Move active configuration handing into a separate type that should contain all the required configuration parameters. Use this type in `ConfigRef` module, and use accessor procs for getting and setting values of different options, thus removing unguarded access for fields in a number of cases. - Move report kind and category enums into `report_enums` in order to make them accessible from the `in_options` - it must be a lightweight dependency since it is supposed to be reused by other tools, like testament, that have to directly interact with the compiler. Closes nim-works#158
haxscramper
added a commit
to haxscramper/nimskull
that referenced
this issue
Jan 28, 2022
- Move active configuration handing into a separate type that should contain all the required configuration parameters. Use this type in `ConfigRef` module, and use accessor procs for getting and setting values of different options, thus removing unguarded access for fields in a number of cases. - Move report kind and category enums into `report_enums` in order to make them accessible from the `in_options` - it must be a lightweight dependency since it is supposed to be reused by other tools, like testament, that have to directly interact with the compiler. Closes nim-works#158
haxscramper
added a commit
to haxscramper/nimskull
that referenced
this issue
Jan 28, 2022
- Move active configuration handing into a separate type that should contain all the required configuration parameters. Use this type in `ConfigRef` module, and use accessor procs for getting and setting values of different options, thus removing unguarded access for fields in a number of cases. - Move report kind and category enums into `report_enums` in order to make them accessible from the `in_options` - it must be a lightweight dependency since it is supposed to be reused by other tools, like testament, that have to directly interact with the compiler. Closes nim-works#158
haxscramper
added a commit
to haxscramper/nimskull
that referenced
this issue
Jan 28, 2022
- Move active configuration handing into a separate type that should contain all the required configuration parameters. Use this type in `ConfigRef` module, and use accessor procs for getting and setting values of different options, thus removing unguarded access for fields in a number of cases. - Move report kind and category enums into `report_enums` in order to make them accessible from the `in_options` - it must be a lightweight dependency since it is supposed to be reused by other tools, like testament, that have to directly interact with the compiler. Closes nim-works#158
haxscramper
added a commit
to haxscramper/nimskull
that referenced
this issue
Jan 28, 2022
- Move active configuration handing into a separate type that should contain all the required configuration parameters. Use this type in `ConfigRef` module, and use accessor procs for getting and setting values of different options, thus removing unguarded access for fields in a number of cases. - Move report kind and category enums into `report_enums` in order to make them accessible from the `in_options` - it must be a lightweight dependency since it is supposed to be reused by other tools, like testament, that have to directly interact with the compiler. Closes nim-works#158
This was referenced Jan 28, 2022
haxscramper
added a commit
to haxscramper/nimskull
that referenced
this issue
Jan 31, 2022
- Move active configuration handing into a separate type that should contain all the required configuration parameters. Use this type in `ConfigRef` module, and use accessor procs for getting and setting values of different options, thus removing unguarded access for fields in a number of cases. - Move report kind and category enums into `report_enums` in order to make them accessible from the `in_options` - it must be a lightweight dependency since it is supposed to be reused by other tools, like testament, that have to directly interact with the compiler. Closes nim-works#158
bors bot
added a commit
that referenced
this issue
Feb 6, 2022
209: Refactor active configuration handing r=saem a=haxscramper - Move active configuration handing into a separate type that should contain all the required configuration parameters. Use this type in `ConfigRef` module, and use accessor procs for getting and setting values of different options, thus removing unguarded access for fields in a number of cases. - Move report kind and category enums into `report_enums` in order to make them accessible from the `in_options` - it must be a lightweight dependency since it is supposed to be reused by other tools, like testament, that have to directly interact with the compiler. Closes #158 Co-authored-by: haxscramper <haxscramper@gmail.com>
Repository owner
moved this from Todo
to Done
in Test tooling improvements
Feb 6, 2022
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Labels
good first issue
Easy-to-start-with issue with no in-depth knowledge or complex implementation required.
refactor
Implementation refactor
Refactor active configuration handling in the
options.ConfigRef
- right now every single field is placed on the same level, including both mutable non-configuration values (error counter, list of symbols) and active/passive configurations (list of active notes, local and global options).Field that are used to store explicit configuration values (backend/target/options/globalOptions) need to be factored out into a separate type definition.
proc compile(config: ActiveOptions)
.ConfigRef
object and mutating it in-place, it can simply returnActiveOptions
objectOld code should continue to work using getters and setters. Additional upside - this change would provide a single point of tracing for the active configuration and reduce number of direct access to fields (which cannot be debugged with
echo
, cannot be asserted and so on).Repeated for all "input" fields:
backend
,target
,options
,filenamesOption
The text was updated successfully, but these errors were encountered: