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
↓ 3 callers
Method
_get_jinja_analyzer
Creates a new object derived from JinjaAnalyzer. Derived classes can provide their own analyzers (e.g. to support custom Jinja tags).
src/sqlfluff/core/templaters/jinja.py:511
↓ 3 callers
Method
_get_macros_path
Get the list of macros paths from the provided config object. This method searches for a config section specified by the templater_se
src/sqlfluff/core/templaters/jinja.py:452
↓ 3 callers
Method
_get_profile
Get a dbt profile name from the configuration.
plugins/sqlfluff-templater-dbt/sqlfluff_templater_dbt/templater.py:415
↓ 3 callers
Method
_get_profiles_dir
Get the dbt profiles directory from the configuration. The default is `~/.dbt` but we use the default_profiles_dir from the dbt libra
plugins/sqlfluff-templater-dbt/sqlfluff_templater_dbt/templater.py:354
↓ 3 callers
Method
_get_threads
Get the dbt threads value from the configuration. If not set, returns ``None`` which lets dbt use the value from ``profiles.yml``.
plugins/sqlfluff-templater-dbt/sqlfluff_templater_dbt/templater.py:433
↓ 3 callers
Method
_handle_segment
(self, segment: BaseSegment, context: RuleContext)
src/sqlfluff/rules/capitalisation/CP01.py:93
↓ 3 callers
Method
_is_simple_cast_expression
Return whether a cast expression wraps a simple expression.
src/sqlfluff/rules/structure/ST06.py:105
↓ 3 callers
Method
_is_simple_expression_segment
Return whether a segment should be treated as a simple expression.
src/sqlfluff/rules/structure/ST06.py:112
↓ 3 callers
Function
_iter_source_fix_patches
Yield any source patches as fixes now. NOTE: This yields source fixes for the segment and any of its children, so it's important to call it a
src/sqlfluff/core/linter/patch.py:38
↓ 3 callers
Function
_linter_with_node_limit
Linter with max_parse_nodes set, forcing the Python parser path.
test/core/parser/max_parse_nodes_test.py:15
↓ 3 callers
Function
_load_specs_from_lines
Load the ignore spec from an iterable of lines. Raises SQLFluffUserError if unparsable for any reason.
src/sqlfluff/core/linter/discovery.py:53
↓ 3 callers
Function
_parse_mode_match_result
A helper function for the return values of AnyNumberOf. This method creates UnparsableSegments as appropriate depending on the parse mode and
src/sqlfluff/core/parser/grammar/anyof.py:23
↓ 3 callers
Function
_pos_line
Return the line number in the chosen coordinate space.
src/sqlfluff/utils/reflow/respace.py:49
↓ 3 callers
Method
_position_segments
Refresh positions of segments within a span. This does two things: - Assign positions to any segments without them. - Updates
src/sqlfluff/core/parser/segments/base.py:450
↓ 3 callers
Method
_recalculate_caches
(self)
src/sqlfluff/core/parser/segments/base.py:704
↓ 3 callers
Method
_regex_sub_with_overlap
Replace `regex` with `replacement` twice on `original`. This is used by string normalization to perform replaces on overlapping matches.
src/sqlfluff/rules/convention/CV10.py:200
↓ 3 callers
Method
_sorted_occurrence_tuples
Sort a dict of occurrences into a sorted list of tuples.
src/sqlfluff/core/templaters/python.py:517
↓ 3 callers
Method
_table_ref_as_tuple
( self, table_reference: ObjectReferenceSegment, )
src/sqlfluff/rules/references/RF01.py:107
↓ 3 callers
Function
_unpack_constraint
Unpack a spacing constraint. Used as a helper function in `determine_constraints`.
src/sqlfluff/utils/reflow/respace.py:129
↓ 3 callers
Method
_validate
(self, i: int, segment: BaseSegment)
src/sqlfluff/rules/structure/ST06.py:87
↓ 3 callers
Function
_validate_indentation_config
Validate the indentation config section of the config. We check for valid values for enum-like config options.
src/sqlfluff/core/config/validate.py:90
↓ 3 callers
Function
_validate_max_parse_depth_config
Validate and normalize the max_parse_depth config value. The parser convention is that ``0`` disables the limit. We also normalize missing/No
src/sqlfluff/core/config/validate.py:116
↓ 3 callers
Function
_validate_max_parse_nodes_config
Validate and normalize the max_parse_nodes config value. The parser convention is that ``0`` disables the limit. We also normalize missing/No
src/sqlfluff/core/config/validate.py:154
↓ 3 callers
Function
_wide_select_sql
()
test/core/parser/max_parse_nodes_test.py:28
↓ 3 callers
Method
add
Add a file to this path. This function _always_ updates the metadata tracking, but may or may not persist the `file` object itself de
src/sqlfluff/core/linter/linted_dir.py:63
↓ 3 callers
Method
allowed_rule_ref_map
Generate a noqa rule reference map.
src/sqlfluff/core/linter/linter.py:876
↓ 3 callers
Function
assert_pickle_robust
Test that the class remains the same through copying and pickling.
test/core/errors_test.py:23
↓ 3 callers
Function
assert_reflow_structure
Assert a ReflowSequence has the defined structure.
test/utils/reflow/sequence_test.py:19
↓ 3 callers
Method
cache_key
Get the cache key for this grammar. For grammars these are unique per-instance.
src/sqlfluff/core/parser/grammar/base.py:168
↓ 3 callers
Function
clean_docstring
Clean up docstring formatting by removing excess indentation. Args: text: Raw docstring text Returns: Cleaned text with norm
docsv/scripts/generate-cli-docs.py:23
↓ 3 callers
Function
coerce_value
Try to coerce to a more specific type.
src/sqlfluff/core/config/ini.py:12
↓ 3 callers
Method
completion_message
Prints message when SQLFluff is finished.
src/sqlfluff/cli/formatters.py:762
↓ 3 callers
Function
compute_anchor_edit_info
Group and count fixes by anchor, return dictionary.
src/sqlfluff/core/linter/fix.py:96
↓ 3 callers
Function
construct_single_indent
Construct a single indent unit.
src/sqlfluff/utils/reflow/reindent.py:761
↓ 3 callers
Method
copy
Create a copy of this ``FluffConfig``. Copies created using this method can safely be modified without those changes propagating back
src/sqlfluff/core/config/fluffconfig.py:218
↓ 3 callers
Method
crawl
Run the rule on a given tree. Returns: A tuple of (vs, raw_stack, fixes, memory)
src/sqlfluff/core/rules/base.py:490
↓ 3 callers
Function
create_mock_token
( token_type, raw, source_idx, templated_idx, instance_types=None )
test/core/parser/lexer_test.py:478
↓ 3 callers
Function
deduce_line_indent
Given a raw segment, deduce the indent of its line.
src/sqlfluff/utils/reflow/helpers.py:36
↓ 3 callers
Function
dialect_specific_segment_parses
Fixture to check specific segments of a dialect.
test/dialects/conftest.py:119
↓ 3 callers
Method
dispatch_compilation_header
Dispatch the header displayed before linting.
src/sqlfluff/cli/formatters.py:204
↓ 3 callers
Method
end_source_idx
Return the closing index of this slice.
src/sqlfluff/core/templaters/base.py:92
↓ 3 callers
Method
expand
Expand any callable references to concrete ones. This must be called before using the dialect. But allows more flexible definitions t
src/sqlfluff/core/dialects/base.py:53
↓ 3 callers
Function
extract_block
Extract a block of text. Extracts from the input string starting at the given marker and ending at the next occurrence of '];'. Raises Runtim
utils/rust_to_python_grammar.py:25
↓ 3 callers
Function
extract_function_info
Extract information from a function for documentation. Args: func: Function object to document module_name: Name of the module co
docsv/scripts/generate-api-docs.py:181
↓ 3 callers
Method
from_raw_segments
Construct a ReflowSequence from a sequence of raw segments. This is intended as a base constructor, which others can use. In particul
src/sqlfluff/utils/reflow/sequence.py:175
↓ 3 callers
Method
from_rs_position_marker
Create a PositionMarker from an RsPositionMarker.
src/sqlfluff/core/parser/markers.py:294
↓ 3 callers
Method
from_source_with_dialect
Parse noqa directives from raw source using a dialect's comment matcher. If a dialect does not define an ``inline_comment`` lexer matcher, re
src/sqlfluff/core/rules/noqa.py:218
↓ 3 callers
Function
generic_roundtrip_test
A test for roundtrip testing, take a file buffer, lint, fix and lint. This is explicitly different from the linter version of this, in that i
test/cli/commands_test.py:1048
↓ 3 callers
Method
get_block_config
Given the class types of a ReflowBlock return spacing config. When fetching the config for a single class type for a simple block we
src/sqlfluff/utils/reflow/config.py:135
↓ 3 callers
Method
get_bracket_from_dialect
Rehydrate the bracket segments in question.
src/sqlfluff/core/parser/grammar/sequence.py:445
↓ 3 callers
Function
get_config_info
Get the config from core sqlfluff and sqlfluff plugins and merges them. NOTE: This should be the entry point into getting config info rather than
src/sqlfluff/core/rules/config_info.py:86
↓ 3 callers
Method
get_config_ref
Return the config lookup ref for this rule. If a `name` is defined, it's the name - otherwise the code. The name is a much more unde
src/sqlfluff/core/rules/base.py:454
↓ 3 callers
Method
get_eventual_alias
Return the eventual table name referred to by this table expression. Returns: :obj:`tuple` of (:obj:`str`, :obj:`BaseSegment`, :o
src/sqlfluff/dialects/dialect_ansi.py:1674
↓ 3 callers
Method
get_eventual_aliases
Return the eventual table name referred to by this join clause.
src/sqlfluff/dialects/dialect_ansi.py:2024
↓ 3 callers
Method
get_identifier
Get the identifier of this CTE. Note: it blindly gets the first identifier it finds which given the structure of a CTE definition is
src/sqlfluff/dialects/dialect_ansi.py:2985
↓ 3 callers
Method
get_indent_segment_vals
Iterate through any indent segments and extract their values.
src/sqlfluff/utils/reflow/elements.py:372
↓ 3 callers
Function
get_package_version
Get the current version of the sqlfluff package.
src/sqlfluff/cli/helpers.py:25
↓ 3 callers
Function
get_rules_from_path
Reads all of the Rule classes from a path into a list.
src/sqlfluff/core/rules/loader.py:12
↓ 3 callers
Function
get_simple_config
Get a config object from simple API arguments.
src/sqlfluff/api/simple.py:15
↓ 3 callers
Method
get_start_loc
Get a location tuple at the start of this segment.
src/sqlfluff/core/parser/segments/base.py:823
↓ 3 callers
Method
get_wildcard_info
Find wildcard (*) targets in the SELECT.
src/sqlfluff/utils/analysis/query.py:111
↓ 3 callers
Function
greedy_match
Match anything up to some defined terminator.
src/sqlfluff/core/parser/match_algorithms.py:553
↓ 3 callers
Method
ignore_if_in
Ignore this violation if it matches the iterable.
src/sqlfluff/core/errors.py:137
↓ 3 callers
Method
incorporate
Mutate the config based on additional information.
src/sqlfluff/utils/reflow/config.py:27
↓ 3 callers
Method
infer_next_position
Using the raw string provided to infer the position of the next. NB: Line position in 1-indexed.
src/sqlfluff/core/parser/markers.py:243
↓ 3 callers
Method
is_all_unrendered
Return whether this element is all unrendered. Returns True if contains only whitespace, indents, template loops or placeholders.
src/sqlfluff/utils/reflow/elements.py:103
↓ 3 callers
Function
is_dbt_exception
Check whether this looks like a dbt exception.
plugins/sqlfluff-templater-dbt/sqlfluff_templater_dbt/templater.py:74
↓ 3 callers
Method
is_just_source_edit
Return whether this a valid source only edit. Args: single_source_fix (:obj:`bool`): Check for a single source_fixes.
src/sqlfluff/core/rules/fix.py:90
↓ 3 callers
Method
iter_block_segments
(self, elements: ReflowSequenceType)
src/sqlfluff/utils/reflow/reindent.py:140
↓ 3 callers
Function
iter_indices_of_newlines
Find the indices of all newlines in a string.
src/sqlfluff/core/templaters/base.py:23
↓ 3 callers
Method
lex
Take a string or TemplatedFile and return segments.
src/sqlfluff/core/parser/lexer.py:932
↓ 3 callers
Method
lex_match
Iteratively match strings using the selection of submatchers.
src/sqlfluff/core/parser/lexer.py:851
↓ 3 callers
Method
lint_parsed
Lint a ParsedString and return a LintedFile.
src/sqlfluff/core/linter/linter.py:708
↓ 3 callers
Function
load_config_file_as_dict
Load the given config file into a dict and validate. This method is cached to mitigate being called multiple times. This doesn't manage the
src/sqlfluff/core/config/file.py:96
↓ 3 callers
Function
load_config_resource
Load a config resource from a python package. Args: package (str): The name of the python package to load the resource from.
src/sqlfluff/core/config/loader.py:136
↓ 3 callers
Function
load_config_string
Load a config from a string in ini format. Args: config_string (str): The raw config file as a string. The content is assumed
src/sqlfluff/core/config/loader.py:172
↓ 3 callers
Function
load_file
Load a file.
test/conftest.py:105
↓ 3 callers
Function
load_test_cases
Load rule test cases from YAML files. Args: test_cases_path (str): A glob string specifying the files containing test cases t
src/sqlfluff/utils/testing/rules.py:64
↓ 3 callers
Function
longest_match
Return longest match from a selection of matchers. Priority is: 1. The first total match, which means we've matched all available segments or
src/sqlfluff/core/parser/match_algorithms.py:140
↓ 3 callers
Method
lookup_cte
Look up a CTE by name, in the current or any parent scope.
src/sqlfluff/utils/analysis/query.py:210
↓ 3 callers
Method
match
Given a string, match what we can and return the rest. Returns: :obj:`LexMatch`
src/sqlfluff/core/parser/lexer.py:266
↓ 3 callers
Function
merge_source_patches
Merge source patches from multiple variants. Patches are deduplicated in source space. Conflicting patches are skipped so that the non-confli
src/sqlfluff/core/linter/patch.py:366
↓ 3 callers
Function
next_match
Look ahead for matches beyond the first element of the segments list. NOTE: Returns *only clean* matches. This function also contains the pe
src/sqlfluff/core/parser/match_algorithms.py:280
↓ 3 callers
Method
opening_balance
The opening indent balance of the line. NOTE: We use the first point for the starting balance rather than the line starting balance b
src/sqlfluff/utils/reflow/reindent.py:212
↓ 3 callers
Function
parse_ansi_string
Parse an ansi sql string for testing.
test/utils/reflow/depthmap_test.py:7
↓ 3 callers
Method
record_trace
Add the specified (default: current) location to the trace. Args: target_slice_length (int): The length of the target slice.
src/sqlfluff/core/templaters/slicers/tracer.py:215
↓ 3 callers
Method
recursive_crawl
Recursively crawl for segments of a given type. Args: seg_type: :obj:`str`: one or more type of segment to look f
src/sqlfluff/core/parser/segments/base.py:1076
↓ 3 callers
Method
render
Dummy method that renders the tag.
plugins/sqlfluff-templater-dbt/sqlfluff_templater_dbt/templater.py:912
↓ 3 callers
Method
render_file
Load and render a file with relevant config.
src/sqlfluff/core/linter/linter.py:988
↓ 3 callers
Method
reraise
Reraise the encapsulated exception.
src/sqlfluff/core/linter/runner.py:365
↓ 3 callers
Function
resolve_bracket
Recursive match to resolve an opened bracket. If `nested_match` is True, then inner bracket matches are also returned as child matches. Other
src/sqlfluff/core/parser/match_algorithms.py:366
↓ 3 callers
Method
root_parse
This is the entry method into parsing a file lexed segments. For single pass matching, this trims any non code off the start, matches
src/sqlfluff/core/parser/segments/file.py:44
↓ 3 callers
Function
save_results
Save benchmark results to JSON file. Args: results: Benchmark results dictionary output_file: Path to output JSON file
utils/benchmark_parsing.py:454
↓ 3 callers
Method
select_children
Retrieve subset of children based on range and filters. Often useful by linter rules when generating fixes, e.g. to find whitespace s
src/sqlfluff/core/parser/segments/base.py:1044
↓ 3 callers
Method
set_as_parent
Set this segment as parent for child all segments.
src/sqlfluff/core/parser/segments/base.py:741
↓ 3 callers
Method
set_lexer_matchers
Set the lexer struct for the dialect. This is what is used for base dialects. For derived dialects (which don't exist yet) the assump
src/sqlfluff/core/dialects/base.py:333
↓ 3 callers
Method
set_parent
Set the weak reference to the parent. We keep a reference to the index within the parent too as that is often used at the same point
src/sqlfluff/core/parser/segments/base.py:749
↓ 3 callers
Method
set_value
Set a value at a given path. Args: config_path: An iterable of strings. Each should be a one of the elements whic
src/sqlfluff/core/config/fluffconfig.py:584
↓ 3 callers
Method
should_produce_plain_output
Returns True if text output should be plain (not colored).
src/sqlfluff/cli/formatters.py:105
↓ 3 callers
Function
skip_stop_index_backward_to_code
Move an index backward through segments until segments[index - 1] is code.
src/sqlfluff/core/parser/match_algorithms.py:32
← previous
next →
301–400 of 2,340, ranked by callers