file_query_text 0.1.4__py3-none-any.whl → 0.1.5__py3-none-any.whl

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
@@ -2,4 +2,4 @@
2
2
  SQL-like interface for querying files in your filesystem.
3
3
  """
4
4
 
5
- __version__ = "0.1.4"
5
+ __version__ = "0.1.5"
file_query_text/cli.py CHANGED
@@ -25,6 +25,11 @@ def main():
25
25
  action="store_true",
26
26
  help="Don't respect .gitignore files (show ignored files)"
27
27
  )
28
+ parser.add_argument(
29
+ "--show-hidden", "-s",
30
+ action="store_true",
31
+ help="Show hidden files (starting with a dot)"
32
+ )
28
33
  args = parser.parse_args()
29
34
 
30
35
  # Get current working directory for the query
@@ -54,7 +59,8 @@ def main():
54
59
  visitor.select,
55
60
  visitor.from_dirs,
56
61
  visitor.where,
57
- respect_gitignore=not args.no_gitignore
62
+ respect_gitignore=not args.no_gitignore,
63
+ show_hidden=args.show_hidden
58
64
  )
59
65
 
60
66
  # Display results
file_query_text/main.py CHANGED
@@ -31,7 +31,7 @@ class QueryVisitor:
31
31
  self.from_dirs = parsed_query.get("from_dirs", [])
32
32
  self.where = parsed_query.get("where", None)
33
33
 
34
- def execute_query(select, from_dirs, where_conditions, respect_gitignore=True):
34
+ def execute_query(select, from_dirs, where_conditions, respect_gitignore=True, show_hidden=False):
35
35
  matched_files = []
36
36
 
37
37
  # Set up gitignore matching if requested
@@ -63,6 +63,18 @@ def execute_query(select, from_dirs, where_conditions, respect_gitignore=True):
63
63
  for filename in files:
64
64
  file_path = os.path.join(root, filename)
65
65
 
66
+ # Skip hidden files or files in hidden directories unless explicitly requested
67
+ if not show_hidden:
68
+ # Check if file name starts with dot
69
+ if os.path.basename(file_path).startswith('.'):
70
+ continue
71
+
72
+ # Check if any parent directory starts with dot
73
+ rel_path = os.path.relpath(file_path, directory)
74
+ path_parts = rel_path.split(os.sep)
75
+ if any(part.startswith('.') for part in path_parts[:-1]): # Check all except the filename
76
+ continue
77
+
66
78
  # Check if file is ignored by gitignore rules
67
79
  if respect_gitignore:
68
80
  # Find which repo this file belongs to
@@ -1,6 +1,6 @@
1
1
  Metadata-Version: 2.4
2
2
  Name: file_query_text
3
- Version: 0.1.4
3
+ Version: 0.1.5
4
4
  Summary: SQL-like interface for querying files in your filesystem
5
5
  Author-email: nik <42a11b@nikdav.is>
6
6
  License-Expression: MIT
@@ -0,0 +1,9 @@
1
+ file_query_text/__init__.py,sha256=TR6o-sOsqfd8VfdEVBpdzVzQbFEzBzcOJR8IC3YuYVw,89
2
+ file_query_text/cli.py,sha256=EEhvQXPOd9j_SixosrNbf1ZWnmno6ywkcEaVoCVv79U,3494
3
+ file_query_text/grammar.py,sha256=XanSi9VCKuIQNlOMXRBZbeWxaJj2UhMJPDIYKgw4lEQ,1655
4
+ file_query_text/main.py,sha256=YUdNijSm_iIcb2rkdKtDsE0Jl2tVbGi0J3G-bSO5_J0,7024
5
+ file_query_text-0.1.5.dist-info/METADATA,sha256=IaXuonSrI6hdAY-WMJLuPH17Co0v8G9H9JsH7Gbf5jo,2480
6
+ file_query_text-0.1.5.dist-info/WHEEL,sha256=CmyFI0kx5cdEMTLiONQRbGQwjIoR1aIYB7eCAQ4KPJ0,91
7
+ file_query_text-0.1.5.dist-info/entry_points.txt,sha256=rNFYWzvcIsUZkGNsc_E_B5HyYRnqqdj_u8_IeQpw1wo,48
8
+ file_query_text-0.1.5.dist-info/top_level.txt,sha256=o1FzSvLa6kSV61b7RLHWRhEezc96m05YwIKqjuWUSxU,16
9
+ file_query_text-0.1.5.dist-info/RECORD,,
@@ -1,9 +0,0 @@
1
- file_query_text/__init__.py,sha256=RtXk4T4ak476yGSYu2rV0NLWYC6hu4Mfb6gFdVcwlmI,89
2
- file_query_text/cli.py,sha256=z1e16emuXsgsJP298UKbezhtIVMx9NZQ6v7FNHAahoo,3306
3
- file_query_text/grammar.py,sha256=XanSi9VCKuIQNlOMXRBZbeWxaJj2UhMJPDIYKgw4lEQ,1655
4
- file_query_text/main.py,sha256=PVUQ6BZsvN2eEUhORjWr2aNh761evNieOaXTs_RDlB4,6377
5
- file_query_text-0.1.4.dist-info/METADATA,sha256=HdJD2CkT8EYd7d3YD7ewdeid3SZF_o5pbHDOzMWUKE4,2480
6
- file_query_text-0.1.4.dist-info/WHEEL,sha256=CmyFI0kx5cdEMTLiONQRbGQwjIoR1aIYB7eCAQ4KPJ0,91
7
- file_query_text-0.1.4.dist-info/entry_points.txt,sha256=rNFYWzvcIsUZkGNsc_E_B5HyYRnqqdj_u8_IeQpw1wo,48
8
- file_query_text-0.1.4.dist-info/top_level.txt,sha256=o1FzSvLa6kSV61b7RLHWRhEezc96m05YwIKqjuWUSxU,16
9
- file_query_text-0.1.4.dist-info/RECORD,,