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

[#254] Revise dump-config command #257

Merged
merged 3 commits into from
Dec 29, 2022
Merged

Conversation

aeqz
Copy link
Contributor

@aeqz aeqz commented Dec 22, 2022

Description

Problem: xrefcheck does not allow to print the config to stdout instead of writing it to a file. Also, it is easy to overwrite your changes by mistake by executing the command again.

Solution: provide a --stdout flag to print the config to stdout, and do not write it to a file unless a --force flag has been included.

Related issue(s)

Fixes #254

✅ Checklist for your Pull Request

Ideally a PR has all of the checkmarks set.

If something in this list is irrelevant to your PR, you should still set this
checkmark indicating that you are sure it is dealt with (be that by irrelevance).

Related changes (conditional)

  • Tests

    • If I added new functionality, I added tests covering it.
    • If I fixed a bug, I added a regression test to prevent the bug from
      silently reappearing again.
  • Documentation

    • I checked whether I should update the docs and did so if necessary:
  • Public contracts

    • Any modifications of public contracts comply with the Evolution
      of Public Contracts
      policy.
    • I added an entry to the changelog if my changes are visible to the users
      and
    • provided a migration guide for breaking changes if possible

Stylistic guide (mandatory)

@aeqz aeqz force-pushed the aeqz/#254-revise-dump-config-command branch from 353491c to 510eedf Compare December 22, 2022 16:08
Copy link
Member

@Martoon-00 Martoon-00 left a comment

Choose a reason for hiding this comment

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

Nice 👍

Still leaving a few suggestions.

exec/Main.hs Outdated Show resolved Hide resolved
src/Xrefcheck/CLI.hs Outdated Show resolved Hide resolved
@@ -130,6 +130,7 @@ executables:
dependencies:
- xrefcheck
- universum
- directory
Copy link
Member

Choose a reason for hiding this comment

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

Mm, I wanted to ask you to follow the alphabetical order here, but it's really hard to follow 😒

Copy link
Contributor Author

Choose a reason for hiding this comment

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

Don't worry. I will sort dependencies and default-extensions in a separate commit.

Copy link
Member

@Martoon-00 Martoon-00 left a comment

Choose a reason for hiding this comment

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

Awesome, thank you.

There is a typo in the 8edffa2 commit's subject, but other than that looks good.

aeqz added 2 commits December 23, 2022 12:19
Problem: xrefcheck does not allow to print the config to stdout instead
of writing it to a file. Also, it is easy to overwrite your changes by
mistake by executing the command again.

Solution: provide a --stdout flag to print the config to stdout, and do
not write it to a file unless a --force flag has been included.
Problem: some arrays from the package.yaml file seemed to be almost
alphabetically sorted, but not completely.

Solution: sort the default-extensions and dependencies arrays from the
package.yaml file.
@aeqz aeqz force-pushed the aeqz/#254-revise-dump-config-command branch from 8edffa2 to 1c44c1c Compare December 23, 2022 11:20
@aeqz aeqz force-pushed the aeqz/#254-revise-dump-config-command branch from 15264ee to c9486e7 Compare December 23, 2022 14:18
@Martoon-00
Copy link
Member

This PR is quite small, I think let's merge it.

@aeqz aeqz merged commit 9213017 into master Dec 29, 2022
@aeqz aeqz deleted the aeqz/#254-revise-dump-config-command branch December 29, 2022 12:04
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

Revise behaviour of dump-config command
2 participants