MCPcopy Create free account

hub / github.com/sqlfluff/sqlfluff / functions

Functions2,340 in github.com/sqlfluff/sqlfluff

↓ 2 callersMethodcount_tmp_prs_errors
Count templating or parse errors before and after filtering.
src/sqlfluff/core/linter/linting_result.py:216
↓ 2 callersMethodcreate
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 callersFunctioncurtail_string
Trim a string nicely to length.
src/sqlfluff/core/helpers/string.py:7
↓ 2 callersMethoddesired_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 callersMethoddispatch_file_violations
Dispatch any violations found in a file.
src/sqlfluff/core/formatter.py:37
↓ 2 callersFunctiondump_file_payload
Write the output file content to stdout or file.
src/sqlfluff/cli/commands.py:631
↓ 2 callersMethodenter
Add a block to the stack.
src/sqlfluff/core/parser/lexer.py:50
↓ 2 callersFunctionescape_ansi
Remove ANSI color codes for testing.
test/cli/formatters_test.py:21
↓ 2 callersFunctionextract_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 callersMethodfilter_meta
Filter the segments to non-meta. Or optionally the opposite if keep_meta is True.
src/sqlfluff/core/rules/base.py:668
↓ 2 callersMethodfind_alias
Find corresponding table_aliases entry (if any) matching "table".
src/sqlfluff/utils/analysis/query.py:146
↓ 2 callersFunctionfind_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 callersFunctionfindall
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 callersFunctionfirst_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 callersFunctionfix
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 callersMethodflush
()
src/sqlfluff/dialects/dialect_bigquery.py:1906
↓ 2 callersMethodformat_config_vals
Format an iterable of config values from a config object.
src/sqlfluff/cli/formatters.py:538
↓ 2 callersMethodformat_dialect_warning
Output a warning for parsing errors.
src/sqlfluff/cli/formatters.py:613
↓ 2 callersMethodfrom_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 callersMethodfrom_elements
Iterate through the elements to deduce important point indices.
src/sqlfluff/utils/reflow/rebreak.py:44
↓ 2 callersMethodfrom_mapping
Recursively wrap mappings so nested lookups also fallback.
src/sqlfluff/core/templaters/python.py:289
↓ 2 callersMethodfrom_points
(cls, indent_points: list[_IndentPoint])
src/sqlfluff/utils/reflow/reindent.py:116
↓ 2 callersMethodfrom_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 callersMethodfrom_slice
Construct template segment from slice of a source file.
src/sqlfluff/core/parser/segments/meta.py:219
↓ 2 callersMethodfrom_span
Expand a span to a location.
src/sqlfluff/utils/reflow/rebreak.py:82
↓ 2 callersMethodfrom_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 callersMethodfrom_tree
Look for inline ignore comments and return NoQaDirectives.
src/sqlfluff/core/rules/noqa.py:168
↓ 2 callersFunctionget_bundle_name
Get display name for a bundle.
docsv/scripts/generate-rules-docs.py:459
↓ 2 callersMethodget_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 callersMethodget_fix_slices
Returns slices touched by the fix.
src/sqlfluff/core/rules/fix.py:275
↓ 2 callersFunctionget_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 callersMethodget_lexer_matchers
Fetch the lexer struct for this dialect.
src/sqlfluff/core/dialects/base.py:343
↓ 2 callersFunctionget_parse_fixtures
Search for all parsing fixtures.
test/conftest.py:61
↓ 2 callersFunctionget_parsed
Testing helper to parse paths.
test/core/templaters/jinja_test.py:46
↓ 2 callersMethodget_raw_segments
Iterate raw segments, mostly for searching.
src/sqlfluff/core/parser/segments/base.py:993
↓ 2 callersFunctionget_rule_from_set
Fetch a rule from the rule set.
src/sqlfluff/utils/testing/rules.py:96
↓ 2 callersFunctionget_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 callersMethodget_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 callersMethodhas_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 callersMethodhas_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 callersFunctionhas_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 callersFunctionidentify_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 callersMethodimap_unordered
(self, *args, **kwargs)
test/core/linter/linter_test.py:342
↓ 2 callersMethodinsert_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 callersFunctionis_keyword
Returns a function that determines if it's a matching keyword.
src/sqlfluff/utils/functional/segment_predicates.py:47
↓ 2 callersMethodis_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 callersMethodis_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 callersMethoditer_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 callersMethoditer_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 callersFunctionjoin_segments_raw
Make a string from the joined `raw` attributes of an iterable of segments.
src/sqlfluff/core/parser/helpers.py:11
↓ 2 callersFunctionlex
Basic parsing for the tests below.
test/dialects/conftest.py:14
↓ 2 callersFunctionlex_and_parse
Performs a Lex and Parse, with cacheable inputs within fixture.
test/dialects/dialects_test.py:30
↓ 2 callersFunctionlint_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 callersMethodlint_rendered
Take a RenderedFile and return a LintedFile.
src/sqlfluff/core/linter/linter.py:897
↓ 2 callersMethodlist_used_names
Check CTEs and return used aliases.
src/sqlfluff/rules/structure/ST05.py:382
↓ 2 callersFunctionload_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 callersMethodmatch
This will never be called. If it is then we're using it wrong.
src/sqlfluff/core/parser/segments/meta.py:64
↓ 2 callersMethodmove_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 callersFunctionnext_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 callersFunctionobject_ref_matches_table
Return True if any of the possible references matches a target.
src/sqlfluff/core/rules/reference.py:6
↓ 2 callersMethodparse
Parses out the contents of the test tag.
src/sqlfluff/core/templaters/jinja.py:1261
↓ 2 callersFunctionparse_ansi_string
Parse an ansi sql string for testing.
test/utils/reflow/respace_test.py:16
↓ 2 callersFunctionparse_ansi_string
Parse an ansi sql string for testing.
test/utils/reflow/rebreak_test.py:15
↓ 2 callersFunctionparse_example_file
Parse example SQL file, return parse tree.
test/conftest.py:136
↓ 2 callersFunctionparse_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 callersFunctionparse_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 callersMethodpersist_timing_records
Persist the timing records as a csv for external analysis.
src/sqlfluff/core/linter/linting_result.py:135
↓ 2 callersFunctionprep_violations
Default to test rule if code is omitted.
src/sqlfluff/utils/testing/rules.py:250
↓ 2 callersFunctionprocess_struct
Process a nested dict or dict-like into a check tuple.
test/conftest.py:112
↓ 2 callersFunctionprune_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 callersFunctionpurge_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 callersMethodqualification
Return the qualification type of this reference.
src/sqlfluff/dialects/dialect_ansi.py:1120
↓ 2 callersMethodrender_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 callersMethodreplace
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 callersMethodreset
Reset all metrics.
utils/compare_parser_metrics.py:82
↓ 2 callersMethodsegment_kwargs
Generates the segment_kwargs package for generating a matched segment.
src/sqlfluff/core/parser/parsers.py:59
↓ 2 callersMethodsequence_files
Given files to be processed, return a valid processing sequence.
src/sqlfluff/core/templaters/base.py:534
↓ 2 callersMethodslice_file
Patch a sliced file returned by the superclass.
test/utils/reflow/reindent_test.py:48
↓ 2 callersMethodslice_is_point
Is this slice a point.
src/sqlfluff/core/parser/markers.py:231
↓ 2 callersMethodsource_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 callersMethodsource_position_dict_from_slice
Create a source position dict from a slice.
src/sqlfluff/core/templaters/base.py:492
↓ 2 callersMethodstop_timer
Stop the linting timer.
src/sqlfluff/core/linter/linting_result.py:51
↓ 2 callersMethodsummary
Generate a summary for display.
src/sqlfluff/core/timing.py:20
↓ 2 callersMethodtemplated_slice_to_source_slice
Convert a template slice to a source slice.
src/sqlfluff/core/templaters/base.py:339
↓ 2 callersMethodtiming_summary
Return a timing summary.
src/sqlfluff/core/linter/linting_result.py:123
↓ 2 callersMethodtrace
Executes raw_str. Returns template output and trace.
src/sqlfluff/core/templaters/slicers/tracer.py:66
↓ 2 callersMethodtrim_ends
Trim both ends of an intermediate slice.
src/sqlfluff/core/templaters/python.py:114
↓ 2 callersFunctiontrim_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 callersMethodtry_simple
Try to turn this intermediate slice into a simple slice.
src/sqlfluff/core/templaters/python.py:131
↓ 2 callersMethodvalidate_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 callersFunctionvalidate_segment
Get and validate segment for tests below.
test/dialects/conftest.py:27
↓ 2 callersMethodverify_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 callersMethodviolations
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 callersMethodworking_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 callersFunctionyaml_loader
Return a yaml loading function.
test/conftest.py:181
↓ 1 callersMethod__add__
(self, segments_)
src/sqlfluff/utils/functional/segments.py:38
↓ 1 callersMethod__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 callersMethod__init__
(self, iterator)
test/core/linter/linter_test.py:595
↓ 1 callersMethod__init__
(self)
src/sqlfluff/diff_quality_plugin.py:25
↓ 1 callersMethod__init__
Constructor for MetaSegment. Args: pos_marker (:obj:`PositionMarker`, optional): The position of the segment.
src/sqlfluff/core/parser/segments/meta.py:31
← previousnext →501–600 of 2,340, ranked by callers