Code
Hub
Workspaces
Following
Trending
Connect
MCP
copy
Create free account
hub
/
github.com/sqlfluff/sqlfluff
/ functions
Functions
2,340 in github.com/sqlfluff/sqlfluff
⨍
Functions
2,340
◇
Types & classes
2,379
↳
Endpoints
59
↓ 2 callers
Method
count_tmp_prs_errors
Count templating or parse errors before and after filtering.
src/sqlfluff/core/linter/linting_result.py:216
↓ 2 callers
Method
create
Factory method. When ignoring=templating is configured, use 'name' as the value for undefined variables. We deliberately avoid record
src/sqlfluff/core/templaters/jinja.py:1169
↓ 2 callers
Function
curtail_string
Trim a string nicely to length.
src/sqlfluff/core/helpers/string.py:7
↓ 2 callers
Method
desired_indent_units
Calculate the desired indent units. This is the heart of the indentation calculations. First we work out how many previous indents a
src/sqlfluff/utils/reflow/reindent.py:155
↓ 2 callers
Method
dispatch_file_violations
Dispatch any violations found in a file.
src/sqlfluff/core/formatter.py:37
↓ 2 callers
Function
dump_file_payload
Write the output file content to stdout or file.
src/sqlfluff/cli/commands.py:631
↓ 2 callers
Method
enter
Add a block to the stack.
src/sqlfluff/core/parser/lexer.py:50
↓ 2 callers
Function
escape_ansi
Remove ANSI color codes for testing.
test/cli/formatters_test.py:21
↓ 2 callers
Function
extract_class_info
Extract information from a class for documentation. Args: cls: Class object to document module_name: Name of the module containin
docsv/scripts/generate-api-docs.py:293
↓ 2 callers
Method
filter_meta
Filter the segments to non-meta. Or optionally the opposite if keep_meta is True.
src/sqlfluff/core/rules/base.py:668
↓ 2 callers
Method
find_alias
Find corresponding table_aliases entry (if any) matching "table".
src/sqlfluff/utils/analysis/query.py:146
↓ 2 callers
Function
find_sql_files
Find SQL fixture files for benchmarking. Args: dialect: Specific dialect to test (e.g., 'ansi', 'tsql'). None = all dialects limi
utils/benchmark_parsing.py:26
↓ 2 callers
Function
findall
Yields all the positions sbstr within in_str. https://stackoverflow.com/questions/4664850/how-to-find-all-occurrences-of-a-substring
src/sqlfluff/core/helpers/string.py:15
↓ 2 callers
Function
first_create_anchor
Handle the potential case of an empty point with the next point with segments. While a reflow element's segments are empty, search for the next
src/sqlfluff/utils/reflow/rebreak.py:155
↓ 2 callers
Function
fix
Fix SQL files. PATH is the path to a sql file or directory to lint. This can be either a file ('path/to/file.sql'), a path ('directory/of/sql
src/sqlfluff/cli/commands.py:1330
↓ 2 callers
Method
flush
()
src/sqlfluff/dialects/dialect_bigquery.py:1906
↓ 2 callers
Method
format_config_vals
Format an iterable of config values from a config object.
src/sqlfluff/cli/formatters.py:538
↓ 2 callers
Method
format_dialect_warning
Output a warning for parsing errors.
src/sqlfluff/cli/formatters.py:613
↓ 2 callers
Method
from_config
Construct a ReflowBlock while extracting relevant configuration. This is the primary route to construct a ReflowBlock, as is allows a
src/sqlfluff/utils/reflow/elements.py:178
↓ 2 callers
Method
from_elements
Iterate through the elements to deduce important point indices.
src/sqlfluff/utils/reflow/rebreak.py:44
↓ 2 callers
Method
from_mapping
Recursively wrap mappings so nested lookups also fallback.
src/sqlfluff/core/templaters/python.py:289
↓ 2 callers
Method
from_points
(cls, indent_points: list[_IndentPoint])
src/sqlfluff/utils/reflow/reindent.py:116
↓ 2 callers
Method
from_raws_and_root
Generate a DepthMap a sequence of raws and a root. NOTE: This is the less efficient way to construct a DepthMap as it doesn't take ad
src/sqlfluff/utils/reflow/depthmap.py:141
↓ 2 callers
Method
from_slice
Construct template segment from slice of a source file.
src/sqlfluff/core/parser/segments/meta.py:219
↓ 2 callers
Method
from_span
Expand a span to a location.
src/sqlfluff/utils/reflow/rebreak.py:82
↓ 2 callers
Method
from_strings
Loads a config object given a series of nested config strings. Args: *config_strings (str): An iterable of config strings, assume
src/sqlfluff/core/config/fluffconfig.py:309
↓ 2 callers
Method
from_tree
Look for inline ignore comments and return NoQaDirectives.
src/sqlfluff/core/rules/noqa.py:168
↓ 2 callers
Function
get_bundle_name
Get display name for a bundle.
docsv/scripts/generate-rules-docs.py:459
↓ 2 callers
Method
get_context
Get the templating context from the config. This function retrieves the templating context from the config by loading the config and
src/sqlfluff/core/templaters/base.py:616
↓ 2 callers
Method
get_fix_slices
Returns slices touched by the fix.
src/sqlfluff/core/rules/fix.py:275
↓ 2 callers
Function
get_json_segment
Recursively search JSON parse result for specified segment type. Args: parse_result (Dict[str, Any]): JSON parse result from `sqlfluff.fi
examples/01_basic_api_usage.py:48
↓ 2 callers
Method
get_lexer_matchers
Fetch the lexer struct for this dialect.
src/sqlfluff/core/dialects/base.py:343
↓ 2 callers
Function
get_parse_fixtures
Search for all parsing fixtures.
test/conftest.py:61
↓ 2 callers
Function
get_parsed
Testing helper to parse paths.
test/core/templaters/jinja_test.py:46
↓ 2 callers
Method
get_raw_segments
Iterate raw segments, mostly for searching.
src/sqlfluff/core/parser/segments/base.py:993
↓ 2 callers
Function
get_rule_from_set
Fetch a rule from the rule set.
src/sqlfluff/utils/testing/rules.py:96
↓ 2 callers
Function
get_runner
Generate a runner instance based on parallel and system configuration. The processes argument can be positive or negative. - If positive, the
src/sqlfluff/core/linter/runner.py:370
↓ 2 callers
Method
get_templater_class
Get the configured templater class. .. note:: This is mostly useful to call directly when rules want to determine the *
src/sqlfluff/core/config/fluffconfig.py:435
↓ 2 callers
Method
has_inappropriate_newlines
Is the span surrounded by one (but not two) line breaks? Args: elements: The elements of the ReflowSequence this element
src/sqlfluff/utils/reflow/rebreak.py:122
↓ 2 callers
Method
has_templated_newline
Is either side a templated newline? If either side has a templated newline, then that's ok too. The intent here is that if the next n
src/sqlfluff/utils/reflow/rebreak.py:99
↓ 2 callers
Function
has_untemplated_newline
Determine whether a point contains any literal newlines. NOTE: We check for standard literal newlines, but also potential placeholder newline
src/sqlfluff/utils/reflow/reindent.py:36
↓ 2 callers
Function
identify_rebreak_spans
Identify areas in file to rebreak. A span here is a block, or group of blocks which have explicit configs for their line position, either dir
src/sqlfluff/utils/reflow/rebreak.py:177
↓ 2 callers
Method
imap_unordered
(self, *args, **kwargs)
test/core/linter/linter_test.py:342
↓ 2 callers
Method
insert_cte
Add a new CTE to the list as late as possible but before all its parents.
src/sqlfluff/rules/structure/ST05.py:394
↓ 2 callers
Function
is_keyword
Returns a function that determines if it's a matching keyword.
src/sqlfluff/utils/functional/segment_predicates.py:47
↓ 2 callers
Method
is_source_only_slice
Based on its slice_type, does it only appear in the *source*? There are some slice types which are automatically source only. There a
src/sqlfluff/core/templaters/base.py:100
↓ 2 callers
Method
is_source_slice_literal
Work out whether a slice of the source file is a literal or not.
src/sqlfluff/core/templaters/base.py:455
↓ 2 callers
Method
iter_raw_references
Generate a list of reference strings and elements. Each reference is an ObjectReferencePart. Overrides the base class because hyphens
src/sqlfluff/dialects/dialect_bigquery.py:1893
↓ 2 callers
Method
iter_vals
Return an iterable of tuples representing keys. Args: cfg (optional): An optional config mapping to format instead.
src/sqlfluff/core/config/fluffconfig.py:622
↓ 2 callers
Function
join_segments_raw
Make a string from the joined `raw` attributes of an iterable of segments.
src/sqlfluff/core/parser/helpers.py:11
↓ 2 callers
Function
lex
Basic parsing for the tests below.
test/dialects/conftest.py:14
↓ 2 callers
Function
lex_and_parse
Performs a Lex and Parse, with cacheable inputs within fixture.
test/dialects/dialects_test.py:30
↓ 2 callers
Function
lint_indent_points
Lint the indent points to check we have line breaks where we should. For linting indentation - we *first* need to make sure there are line br
src/sqlfluff/utils/reflow/reindent.py:1773
↓ 2 callers
Method
lint_rendered
Take a RenderedFile and return a LintedFile.
src/sqlfluff/core/linter/linter.py:897
↓ 2 callers
Method
list_used_names
Check CTEs and return used aliases.
src/sqlfluff/rules/structure/ST05.py:382
↓ 2 callers
Function
load_config_string_as_dict
Load the given config string and validate. This method is cached to mitigate being called multiple times. This doesn't manage the combinatio
src/sqlfluff/core/config/file.py:116
↓ 2 callers
Method
match
This will never be called. If it is then we're using it wrong.
src/sqlfluff/core/parser/segments/meta.py:64
↓ 2 callers
Method
move_to_slice
Given a template location, walk execution to that point. This updates the internal `program_counter` to the appropriate location.
src/sqlfluff/core/templaters/slicers/tracer.py:150
↓ 2 callers
Function
next_ex_bracket_match
Same as `next_match` but with bracket counting. NB: Given we depend on `next_match` we can also utilise the same performance optimisations wh
src/sqlfluff/core/parser/match_algorithms.py:469
↓ 2 callers
Function
object_ref_matches_table
Return True if any of the possible references matches a target.
src/sqlfluff/core/rules/reference.py:6
↓ 2 callers
Method
parse
Parses out the contents of the test tag.
src/sqlfluff/core/templaters/jinja.py:1261
↓ 2 callers
Function
parse_ansi_string
Parse an ansi sql string for testing.
test/utils/reflow/respace_test.py:16
↓ 2 callers
Function
parse_ansi_string
Parse an ansi sql string for testing.
test/utils/reflow/rebreak_test.py:15
↓ 2 callers
Function
parse_example_file
Parse example SQL file, return parse tree.
test/conftest.py:136
↓ 2 callers
Function
parse_google_docstring
Parse a Google-style docstring into structured sections. Args: docstring: The raw docstring text Returns: Dictionary with ke
docsv/scripts/generate-api-docs.py:104
↓ 2 callers
Function
parse_param_list
Parse parameter list from Google-style docstring. Args: text: Text containing parameter descriptions Returns: List of dicts
docsv/scripts/generate-api-docs.py:50
↓ 2 callers
Method
persist_timing_records
Persist the timing records as a csv for external analysis.
src/sqlfluff/core/linter/linting_result.py:135
↓ 2 callers
Function
prep_violations
Default to test rule if code is omitted.
src/sqlfluff/utils/testing/rules.py:250
↓ 2 callers
Function
process_struct
Process a nested dict or dict-like into a check tuple.
test/conftest.py:112
↓ 2 callers
Function
prune_options
Use the simple matchers to prune which options to match on. Works in the context of a grammar making choices between options such as AnyOf or
src/sqlfluff/core/parser/match_algorithms.py:81
↓ 2 callers
Function
purge_plugin_manager
Purge the current loaded plugin manager. NOTE: This method should not be used in normal SQFluff operation, but exists so that in the test sui
src/sqlfluff/core/plugin/host.py:115
↓ 2 callers
Method
qualification
Return the qualification type of this reference.
src/sqlfluff/dialects/dialect_ansi.py:1120
↓ 2 callers
Method
render_func
Used by JinjaTracer to instantiate templates. This function is a closure capturing internal state from process(). Note that c
src/sqlfluff/core/templaters/jinja.py:638
↓ 2 callers
Method
replace
Override a segment on the dialect directly. Usage is very similar to add, but elements specified must already exist.
src/sqlfluff/core/dialects/base.py:185
↓ 2 callers
Method
reset
Reset all metrics.
utils/compare_parser_metrics.py:82
↓ 2 callers
Method
segment_kwargs
Generates the segment_kwargs package for generating a matched segment.
src/sqlfluff/core/parser/parsers.py:59
↓ 2 callers
Method
sequence_files
Given files to be processed, return a valid processing sequence.
src/sqlfluff/core/templaters/base.py:534
↓ 2 callers
Method
slice_file
Patch a sliced file returned by the superclass.
test/utils/reflow/reindent_test.py:48
↓ 2 callers
Method
slice_is_point
Is this slice a point.
src/sqlfluff/core/parser/markers.py:231
↓ 2 callers
Method
source_only_slices
Return a list a slices which reference the parts only in the source. All of these slices should be expected to have zero-length in th
src/sqlfluff/core/templaters/base.py:478
↓ 2 callers
Method
source_position_dict_from_slice
Create a source position dict from a slice.
src/sqlfluff/core/templaters/base.py:492
↓ 2 callers
Method
stop_timer
Stop the linting timer.
src/sqlfluff/core/linter/linting_result.py:51
↓ 2 callers
Method
summary
Generate a summary for display.
src/sqlfluff/core/timing.py:20
↓ 2 callers
Method
templated_slice_to_source_slice
Convert a template slice to a source slice.
src/sqlfluff/core/templaters/base.py:339
↓ 2 callers
Method
timing_summary
Return a timing summary.
src/sqlfluff/core/linter/linting_result.py:123
↓ 2 callers
Method
trace
Executes raw_str. Returns template output and trace.
src/sqlfluff/core/templaters/slicers/tracer.py:66
↓ 2 callers
Method
trim_ends
Trim both ends of an intermediate slice.
src/sqlfluff/core/templaters/python.py:114
↓ 2 callers
Function
trim_non_code_segments
Take segments and split off surrounding non-code segments as appropriate. We use slices to avoid creating too many unnecessary tuples.
src/sqlfluff/core/parser/helpers.py:34
↓ 2 callers
Method
try_simple
Try to turn this intermediate slice into a simple slice.
src/sqlfluff/core/templaters/python.py:131
↓ 2 callers
Method
validate_non_code_ends
Validates the start and end of the sequence based on it's config. Most normal segments may *not* start or end with whitespace. Any su
src/sqlfluff/core/parser/segments/base.py:1223
↓ 2 callers
Function
validate_segment
Get and validate segment for tests below.
test/dialects/conftest.py:27
↓ 2 callers
Method
verify_dialect_specified
Check if the config specifies a dialect, raising an error if not. Raises: SQLFluffUserError: If dialect config value is unset. Th
src/sqlfluff/core/config/fluffconfig.py:167
↓ 2 callers
Method
violations
Returns the combination of violations for this variant. NOTE: This is implemented as a property for backward compatibility.
src/sqlfluff/core/linter/common.py:107
↓ 2 callers
Method
working_visual_column
Calculate visual column position accounting for tab expansion. This calculates the visual column (how it appears on screen) by walking
src/sqlfluff/core/parser/markers.py:168
↓ 2 callers
Function
yaml_loader
Return a yaml loading function.
test/conftest.py:181
↓ 1 callers
Method
__add__
(self, segments_)
src/sqlfluff/utils/functional/segments.py:38
↓ 1 callers
Method
__eq__
Two grammars are equal if their elements and types are equal. NOTE: We use the equality_kwargs tuple on the class to define other kwa
src/sqlfluff/core/parser/grammar/base.py:203
↓ 1 callers
Method
__init__
(self, iterator)
test/core/linter/linter_test.py:595
↓ 1 callers
Method
__init__
(self)
src/sqlfluff/diff_quality_plugin.py:25
↓ 1 callers
Method
__init__
Constructor for MetaSegment. Args: pos_marker (:obj:`PositionMarker`, optional): The position of the segment.
src/sqlfluff/core/parser/segments/meta.py:31
← previous
next →
501–600 of 2,340, ranked by callers