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

Fix/3336/add default value for tab width #3404

Merged
merged 12 commits into from
Nov 17, 2023

Conversation

fritschldwg
Copy link
Contributor

@fritschldwg fritschldwg commented Nov 13, 2023

Provide default value for tabwidth

Closes: #3336

Description

  • Sets the default value of tabwidth to 'unknown' when no value is entered
    by the user during configuration of the RawTextParser and tabwidth will get estimated
  • When user enters a non-integer value, the tabwidth gets estimated as well

Screenshots or gifs

Default tabwidth 3

@ce-bo
Copy link
Collaborator

ce-bo commented Nov 14, 2023

I would prefer something like "What is the tab with used (estimated if unknown)?" Default would be "unknown".
Is ist possible to have a string prompt and to cast the value to an int accordingly? If the result of the cast would be a NaN the estimation can take place.

Copy link
Collaborator

@ce-bo ce-bo left a comment

Choose a reason for hiding this comment

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

Would you please check my comment?

@fritschldwg
Copy link
Contributor Author

I would prefer something like "What is the tab with used (estimated if unknown)?" Default would be "unknown". Is ist possible to have a string prompt and to cast the value to an int accordingly? If the result of the cast would be a NaN the estimation can take place.

Implementation of requested changes:

  • If user does not enter anything - tabwidth will be estimated
  • If user enters non-integer value - tabwidth will be estimated
  • If user enters integer-value - tabwidth is set to specified value

@ce-bo
Copy link
Collaborator

ce-bo commented Nov 14, 2023

I think 0 should be an invalid tabWidth. Not sure how the parser would behave in this case.

@fritschldwg
Copy link
Contributor Author

I would prefer something like "What is the tab with used (estimated if unknown)?" Default would be "unknown". Is ist possible to have a string prompt and to cast the value to an int accordingly? If the result of the cast would be a NaN the estimation can take place.

Implementation of requested changes:

  • If user does not enter anything - tabwidth will be estimated
  • If user enters non-integer value - tabwidth will be estimated
  • If user enters integer-value - tabwidth is set to specified value

Updated implementation:

  • If user does not enter anything - tabwidth will be estimated
  • If user enters non-integer value - tabwidth will be estimated
  • If user enters negative integer-value or zero - tabwidth will be estimated
  • If user enters positive integer-value - tabwidth is set to specified value

CHANGELOG.md Outdated Show resolved Hide resolved
Copy link

sonarcloud bot commented Nov 16, 2023

[CodeCharta Analysis] Kudos, SonarCloud Quality Gate passed!    Quality Gate passed

Bug A 0 Bugs
Vulnerability A 0 Vulnerabilities
Security Hotspot A 0 Security Hotspots
Code Smell A 0 Code Smells

100.0% 100.0% Coverage
0.0% 0.0% Duplication

Copy link

sonarcloud bot commented Nov 16, 2023

[CodeCharta Visualization] Kudos, SonarCloud Quality Gate passed!    Quality Gate passed

Bug A 0 Bugs
Vulnerability A 0 Vulnerabilities
Security Hotspot A 0 Security Hotspots
Code Smell A 0 Code Smells

No Coverage information No Coverage information
No Duplication information No Duplication information

Copy link
Collaborator

@ce-bo ce-bo left a comment

Choose a reason for hiding this comment

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

LGTM!

@fritschldwg fritschldwg merged commit 478d9cf into main Nov 17, 2023
7 checks passed
@fritschldwg fritschldwg deleted the fix/3336/add-default-value-for-tab-width branch November 17, 2023 08:35
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.

Interactive RawTextParser - No default value for TabWidth?
2 participants