2
1

sample_python_pathspec.py 856 B

123456789101112131415161718192021222324252627282930313233343536
  1. # example from https://pypi.org/project/pathspec/
  2. import pathspec
  3. # The gitignore-style patterns for files to select, but we're including
  4. # instead of ignoring.
  5. spec_text = """
  6. # This is a comment because the line begins with a hash: "#"
  7. # Include several project directories (and all descendants) relative to
  8. # the current directory. To reference a directory you must end with a
  9. # slash: "/"
  10. /project-a/
  11. /project-b/
  12. /project-c/
  13. # Patterns can be negated by prefixing with exclamation mark: "!"
  14. # Ignore temporary files beginning or ending with "~" and ending with
  15. # ".swp".
  16. !~*
  17. !*~
  18. !*.swp
  19. # These are python projects so ignore compiled python files from
  20. # testing.
  21. !*.pyc
  22. # Ignore the build directories but only directly under the project
  23. # directories.
  24. !/*/build/
  25. """
  26. spec = pathspec.PathSpec.from_lines('gitwildmatch', spec_text.splitlines())