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

[Feature]: Allow configuration of source and test directories that don't exist #258

Closed
17 tasks done
mengdaming opened this issue Feb 16, 2023 · 0 comments · Fixed by #396
Closed
17 tasks done

[Feature]: Allow configuration of source and test directories that don't exist #258

mengdaming opened this issue Feb 16, 2023 · 0 comments · Fixed by #396
Assignees
Labels
config Configuration-related issue enhancement New feature or request language Language-related issue murex Items related to using TCR at Murex S Small

Comments

@mengdaming
Copy link
Contributor

mengdaming commented Feb 16, 2023

Contact Details

damien.menanteau@gmail.com

Feature Request

Currently, TCR reports an error and exits when the configured language directories are missing from the filesystem.

Having the possibility to let TCR run even if some configured source and/or test directories are missing could improve usability and allow to come up with "generic" language configurations that do not require additional tuning when running on components that have slight variations in directory structure.

Feature Description

  • Display a warning instead of exiting on error when a configured source or test directory configured for the language is not present on disk
  • TCR should still report an error and exit if no source or test directory is present on disk (there should at least be 1 of each)
  • It’s ok if they need to restart TCR in case they create the directory after

Alternatives

N/A

Additional Context

N/A

TODO

  • Ignore absent directories mentioned in “watch” settings
    • Display a warning instead of an error in the configuration checker
      • Create a new kind of error that accumulates ‘bogus’ dirs
      • Update file_tree_filter.go findAllMatchingFiles to not systematically return an error
        • Accumulate a list of errors instead of a single error, and continue on next dir
        • Check that dir exists before calling afero.Walk()
      • Update language checker to handle these errors
    • Stop watching directories that do not exist
      • make sure no warning or error is displayed / happens
      • Do not say “Watching xxx” if xxx does not exist
      • Create a wrapper function around DirsToWatch, that filters out absent dirs, so that language remains indep from OS and filesystem
        • Implement general case
        • bubble up errors
      • Wrap calls to DirsToWatch with this new function
      • Stop TCR in case of error
    • Deal with the case where nothing is watched
      • Current behaviour:
        • tcr check reports warnings (no src/test directories, no matching files found)
        • tcr in driver mode works, but does not watch any directory. As a consequence the TCR cycle will never be triggered
      • Decision: Ignore this case as this is not how TCR is supposed to be used. We just display a warning at startup for every configured directory that cannot be accessed.
    • Add a warning at startup when a watched dir is missing
      • this could be combined with a warning displayed at startup if there is nothing to watch

Code of Conduct

  • I agree to follow this project's Code of Conduct
@mengdaming mengdaming added enhancement New feature or request S Small murex Items related to using TCR at Murex language Language-related issue config Configuration-related issue labels Feb 16, 2023
mengdaming added a commit that referenced this issue Jul 28, 2023
…gFiles()

- to allow retrieval of all the unreachable directories when running tcr check
mengdaming added a commit that referenced this issue Jul 28, 2023
- to display a warning per unreachable directory when running tcr check
mengdaming added a commit that referenced this issue Aug 7, 2023
…gFiles()

- to allow retrieval of all the unreachable directories when running tcr check
mengdaming added a commit that referenced this issue Aug 7, 2023
- to display a warning per unreachable directory when running tcr check
mengdaming added a commit that referenced this issue Aug 9, 2023
- reports number of src and test files found, or a warning if none is found
- reports 1 warning per unreachable source or test directory
@mengdaming mengdaming linked a pull request Aug 9, 2023 that will close this issue
5 tasks
mengdaming added a commit that referenced this issue Aug 11, 2023
…gFiles()

- to allow retrieval of all the unreachable directories when running tcr check
mengdaming added a commit that referenced this issue Aug 11, 2023
- to display a warning per unreachable directory when running tcr check
mengdaming added a commit that referenced this issue Aug 11, 2023
- reports number of src and test files found, or a warning if none is found
- reports 1 warning per unreachable source or test directory
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
config Configuration-related issue enhancement New feature or request language Language-related issue murex Items related to using TCR at Murex S Small
Development

Successfully merging a pull request may close this issue.

3 participants